From 235cc8ffee38cd2ff108080323fbeeaf0465088a Mon Sep 17 00:00:00 2001 From: Daniel Santos-Olivan Date: Mon, 23 Nov 2020 11:47:43 +0100 Subject: [PATCH] Added wheel sweep by default in manual_control --- PythonAPI/examples/manual_control.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PythonAPI/examples/manual_control.py b/PythonAPI/examples/manual_control.py index 773e08bbb..8e62c4029 100755 --- a/PythonAPI/examples/manual_control.py +++ b/PythonAPI/examples/manual_control.py @@ -234,6 +234,7 @@ class World(object): spawn_point.rotation.pitch = 0.0 self.destroy() self.player = self.world.try_spawn_actor(blueprint, spawn_point) + self.modify_vehicle_physics(self.player) while self.player is None: if not self.map.get_spawn_points(): print('There are no spawn points available in your map/town.') @@ -242,6 +243,7 @@ class World(object): spawn_points = self.map.get_spawn_points() spawn_point = random.choice(spawn_points) if spawn_points else carla.Transform() self.player = self.world.try_spawn_actor(blueprint, spawn_point) + self.modify_vehicle_physics(self.player) # Set up the sensors. self.collision_sensor = CollisionSensor(self.player, self.hud) self.lane_invasion_sensor = LaneInvasionSensor(self.player, self.hud) @@ -282,6 +284,11 @@ class World(object): self.radar_sensor.sensor.destroy() self.radar_sensor = None + def modify_vehicle_physics(self, vehicle): + physics_control = vehicle.get_physics_control() + physics_control.use_sweep_wheel_collision = True + vehicle.apply_physics_control(physics_control) + def tick(self, clock): self.hud.tick(self, clock)