lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.28k stars 781 forks source link

Custom Traffic Light and Signs #932

Open gizegizem opened 4 years ago

gizegizem commented 4 years ago

Hi , I am trying to use my own Traffic Light and Sign system . I just followed the guide in the website. I have managed to do all traffic light change and other stuff but npc's not obeying the traffic light. They just ran over them .

I am trying to find the missing point . Thanks.

EricBoiseLGSVL commented 4 years ago

@gizegizem Be sure that the traffic signals are annotated correctly and stoplines are referenced. Please see CubeTown repo to see a simple map annotation done correctly.

gizegizem commented 4 years ago

Thank you for answer @EricBoiseLGSVL as you said, I followed exact structure in CubeTown but as far as I see, the NPCs can do right turn after a second eventhough the light is red. But if the car tries to do left turn or go straight , it just waits and obey the traffic light. How can I manage to npc's not to turn right immediately . They just wait 1-2 sec and turn right.

gizegizem commented 4 years ago

By the way , I also try to add speed bump however I couldn't find AutonomousStaff Speed Bump Mesh. How can I find it ? Or is there any solution

alperenbayraktar commented 4 years ago

I was dealing with the same problem earlier today, traced back the code, and saw that the MapIntersection.cs initializes the TrafficLightLoop. I had my traffic lights on the MapLaneSections, not in the MapIntersections. Also had a TrafficLight.cs but decided to delete my code and assets and just copy the traffic lights in CubeTown and thus, their code.

Now, it works perfectly. Hope this helps!

EricBoiseLGSVL commented 4 years ago

@alperenbayraktar Thanks for the helpful post! Does this help you on your issue