-
Notifications
You must be signed in to change notification settings - Fork 779
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
No collision effects with NPC vehicle controlled by waypoints following #1802
Comments
This is by design. Waypoint mode with the API has collision off. We are looking at possibly changing this. |
Thanks for the reply. Do you have any idea whether I could change this in the source code? Thanks! |
The suggested method can work. Thanks a lot! |
@ZiwenWan @EricBoiseLGSVL Hi, I wonder does this also work for the collisions among the NPC vehicles (i.e. the vehicles not controlled by the user and both follow some specified waypoints)? I am following the instruction here and still observe no collision effects between NPC vehicles themselves. Another related question is about pedestrians. Is there a way to enable their collision effects with other vehicles? Right now they just follow waypoints and "passing through" everything along the way. |
Hi @EricBoiseLGSVL , Thank you for your reply! I indeed commented out the line of 2021-12-14.13-52-34.mp4In terms of pedestrian, after I set 2021-12-14.14-07-28.mp4Two possible behaviors for the pedestrians are acceptable: 1.the pedestrian stops if a collision happens (as a rag doll). Something similar to the case in the CARLA simulator as shown below. 2.the pedestrian keeps trying to finish the path but will be blocked (rather than passing through) by the vehicle. When the vehicle moves away, the pedestrian then finishes the original path. |
How are you adding the NPCs? Are you using API commands? |
Hi @EricBoiseLGSVL ,
where Regarding pedestrian collider, do you know what files I can potentially look into for that? |
No problem. Sorry we can't add this feature right now. Look to AddAgent to see where the logic starts for API. Then Pedestrian waypoint behaviour controller and manager. Same for NPC |
@EricBoiseLGSVL Thanks for the help! I will look into those then. |
Hi @EricBoiseLGSVL , |
Actually, I also tried to build the assets and nothing changed so this is probably not the cause. I also tried to use on_collision for the NPC vehicles and pedestrians to try to change their behaviors when they "pass through" each other. However, it seems that the on_collision won't be triggered. |
Here ya go. Maybe this will solve the issue. |
Hi @EricBoiseLGSVL , I also tried to use on_collision for the NPC vehicles and pedestrians to try to change their behaviors when they "pass through" each other. However, it seems that the on_collision won't be triggered. |
Darn, well you will need to do some significant refactoring to enable this feature change. Walk through the npc initialization and inspect the npc in the unity editor while running to see why the collider is not working. Then you will need to change the on collision to make sure it works with the change to trigger systems. It worries me that other users have collision after making the change but you are not. I feel something is still not being correctly changed. |
@EricBoiseLGSVL Happy New Year! I have a question regarding on_collision. In the 2021.3 official release version, should on_collision defined for an NPC vehicle be triggered for its collision with another NPC vehicle (both are waypoint followers)? I tried this and on_collision is not triggered. |
OnCollision the method? |
Yes |
If you look at NPCController.cs it is the base class for all NPCs. The OnCollision method is only looking for agent layer collision. You will need to add a check for the NPCs or peds.
you can also see that this method calls the active behaviour OnAgentCollision method. In NPCWaypointBehaviour there is a todo. You will need to copy NPCLaneFollowBehaviour code or add your own. NPCLaneFollowBehaviour
NPCWaypointBehaviour
|
Hi @EricBoiseLGSVL thanks a lot! this is very helpful! I also realized that I did not comment out |
Hi,
I recently met some problem when I run the simulation with Apollo 5.0 and SVL (version 2021.2). I controlled a NPC vehicle by setting waypoints. When the collision happens, there is no collision effects in simulation. The assets are the default ones in SVL store (for ego vehicle: Jagur 2015, for NPC vehicle: Sedan).

I manually verify that when I drive the ego vehicle manually, the ego vehicle can have collision effects with NPC vehicle. I am wondering whether there are some problems in waypoints following mode such that the collision effect is missing.
Thanks a lot!
The text was updated successfully, but these errors were encountered: