PythonAPI icon indicating copy to clipboard operation
PythonAPI copied to clipboard

How to modify the speed of NPC vehicles during simulator running

Open zhwmonkey opened this issue 4 years ago • 2 comments

Hi, I want to create a scene which the speed of NPC can change suddenly. Is there any way to do it? Thanks

zhwmonkey avatar Mar 24 '20 11:03 zhwmonkey

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.

hadiTab avatar Mar 30 '20 23:03 hadiTab

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.

zhwmonkey avatar Apr 02 '20 06:04 zhwmonkey