BeamNGpy
BeamNGpy copied to clipboard
BeamNGpy should not ignore cling when spawning a vehicle
Spawning a vehicle (either statically or dynamically) on a map where's the ground level is below 0 results in the cars dropped in the air.
Steps to reproduce:
- install tig level from here or create a level for which the ground level is below 0. For
tig
, the ground level is -28.0 - create a new scenario and add a car at (0,0,0), set cling=True (this should be the default value anyway)
- Start the simulation and check the car appears "in the air"
with BeamNGpy('localhost', 64256) as bng:
scenario = Scenario('tig', 'test_scenario_1')
# This car is "on-the ground"
vehicle_1 = Vehicle('vehicle_1', model='etk800', licence='ground', color="red")
orig = (0, 0, -28.0)
scenario.add_vehicle(vehicle_1, cling=0, pos=orig, rot=None, rot_quat=(0, 0, 1, 0))
# This car is "in-the-air" and crash into the ground
vehicle_2 = Vehicle('vehicle_2', model='etk800', licence='Fly')
orig = (10, 10, 0.0)
scenario.add_vehicle(vehicle_2, cling=True, pos=orig, rot=None, rot_quat=(0, 0, 1, 0))
scenario.make(bng)
bng.load_scenario(scenario)
bng.start_scenario()
input('Press enter when done...')
I tried placing a vehicle above the ground level on the Utah map and it works fine, so I suspect the issue might be placing vehicles below the 0.0 level.