smoke_test: minor updates to test_vehicle_physics

This commit is contained in:
Daniel Santos-Olivan 2021-09-14 12:20:03 +02:00 committed by bernat
parent 3d8cfb4765
commit 727b10fe26
1 changed files with 6 additions and 9 deletions

View File

@ -278,8 +278,7 @@ class TestVehicleFriction(SyncSmokeTest):
# workaround: give time to UE4 to clean memory after loading (old assets)
time.sleep(5)
bp_vehicles = self.world.get_blueprint_library().filter("vehicle.*")
bp_vehicles = [x for x in bp_vehicles if int(x.get_attribute('number_of_wheels')) == 4]
bp_vehicles = self.world.get_blueprint_library().filter("*charger_2020")
value_vol_friction = 5.0
friction_bp = self.world.get_blueprint_library().find('static.trigger.friction')
@ -397,10 +396,8 @@ class TestVehicleFriction(SyncSmokeTest):
for bp_veh in bp_vehicles:
veh_transf = carla.Transform(carla.Location(36, -200, 0.3), carla.Rotation(yaw=90))
veh_transf_00 = carla.Transform(carla.Location(36, -200, 0.2), carla.Rotation(yaw=90))
veh_transf_01 = carla.Transform(carla.Location(28, -200, 0.7), carla.Rotation(yaw=90))
veh_transf_00 = carla.Transform(carla.Location(35, -200, 0.2), carla.Rotation(yaw=90))
veh_transf_01 = carla.Transform(carla.Location(29, -200, 0.7), carla.Rotation(yaw=90))
batch = [
SpawnActor(bp_veh, veh_transf_00)
@ -432,13 +429,13 @@ class TestVehicleFriction(SyncSmokeTest):
ApplyTargetVelocity(veh_refs[0], carla.Vector3D(0, vel_ref, 0)),
ApplyTargetVelocity(veh_refs[1], carla.Vector3D(0, vel_ref, 0))
])
self.wait(50)
self.wait(20)
vel_veh_00 = veh_refs[0].get_velocity().y
loc_veh_00 = veh_refs[0].get_location().y
loc_veh_01 = veh_refs[1].get_location().y
for _i in range(0, 150):
for _i in range(0, 50):
self.world.tick()
self.client.apply_batch_sync([
ApplyVehicleControl(veh_refs[0], carla.VehicleControl(brake=1.0)),
@ -448,7 +445,7 @@ class TestVehicleFriction(SyncSmokeTest):
dist_veh_00 = veh_refs[0].get_location().y - loc_veh_00
dist_veh_01 = veh_refs[1].get_location().y - loc_veh_01
err_veh_01 = dist_veh_01 > 0.90 * dist_veh_00
err_veh_01 = dist_veh_01 > dist_veh_00
if err_veh_01:
self.fail("%s: Friction test failed: ErrVeh01: %r -> (%f, %f)"