PythonAPI
PythonAPI copied to clipboard
How to modify the speed of NPC vehicles during simulator running
Hi, I want to create a scene which the speed of NPC can change suddenly. Is there any way to do it? Thanks
Using waypoint mode for NPC's (see example), you can set the velocity for each waypoint. So if you define the path of the NPC using waypoints you can increase the speed at specific waypoints to get a sudden change.
Copy that. However, this approach will result in the behavior of NPCs not being flexible enough and NPCs unable to interact with the ego vehicle.For example, we can't create a scenario that NPC will slow down when the distance between ego vehicle and NPC is less than 100m. Is there any way to implement this deceleration mode? Thank you so much.