Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_autopilot API can't stop the vehicle #7626

Open
lightlefter opened this issue May 11, 2024 · 0 comments
Open

set_autopilot API can't stop the vehicle #7626

lightlefter opened this issue May 11, 2024 · 0 comments

Comments

@lightlefter
Copy link

CARLA version:0.9.12
Platform/OS:windows10
Problem you have experienced:set_autopilot API can't stop the vehicle
What you expected to happen:stop the vehicle from autopilot
Steps to reproduce:

In my python script. I set the autopilot to all spawned vehicle.

for vehicles in world.get_actors().filter('vehicle'):
vehicles.set_autopilot(True)

It runed perfectly.
But,When I tried to stop all the vehicle(set_autopilot(False)),I failed to stop them. Those vehicle holds different VehicleControl VehicleControl(throttle=0.631335, steer=0.000000, brake=0.000000, hand_brake=False, reverse=False, manual_gear_shift=False, gear=1)
I can't apply any VehicleControl to any vehicle. How to stop those vehicle.

The API I tried:
(1)
vehicle_control = carla.VehicleControl(throttle=0.000000)
for vehicles in world.get_actors().filter('vehicle'):
vehicles.set_autopilot(False)
carla.command.ApplyVehicleControl(vehicles,vehicle_control)
carla.command.ApplyTargetVelocity(vehicles,carla.Vector3D(0,0,0))
(2)
traffic_manager = client.get_trafficmanager()
traffic_manager.shut_down()
for vehicles in world.get_actors().filter('vehicle'):
vehicles.set_autopilot(False)
carla.command.ApplyVehicleControl(vehicles,vehicle_control)
carla.command.ApplyTargetVelocity(vehicles,carla.Vector3D(0,0,0))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant