carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.18k stars 3.61k forks source link

About detection of collision events #7901

Closed Nancy22-NJ closed 1 month ago

Nancy22-NJ commented 3 months ago

Hello, I'm wandering how to stop the current simulation when collision events are caught by the collision detector sensor, and then run the next simulation? Thank you for your reply!!!

Blyron commented 3 months ago

Right now we do not have pause function in the simulator but you have an example of how to do a pause in the manual control. Every sensor has listen method to act as callback

PatrickPromitzer commented 2 months ago

Hi, I guess you mean that the collision sensor keep getting data, and the Python API is keeping open the program? Or do you mean something else?

You can stop listening to the sensor and destroy it.

sensor.stop()
sensor.destroy()