Hi Taylor,
you can read all static information about your network using
https://sumo.dlr.de/pydoc/sumolib.html , for example which incoming and
outgoing lanes you have at your intersection. Then you obviously need
the vehicle's route to know in advance where it will go. Then you can
compare whether a specific outgoing edge is part of the route.
1. Read net with sumolib.net readNet function
2. Get your intersection node with sumolib net.getNode()
3. read incoming and outgoing lanes, gather edge IDs
https://sumo.dlr.de/pydoc/sumolib.net.node.html node.getIncoming() ,
node.getOutgoing() and store them in an adequate data structure
4. call TraCI vehicle.getRoute()
5. compare edge from route with your stored edge IDs from sumolib
This way you save some TraCI calls... But you can also reach the goal
with your approach.
Regards
Mirko
Am 28.02.2020 um 14:46 schrieb Taylor Oliveira:
Hi all,
is there any way to know which lane/edge a vehicle will turn to at an
intersection (with traffic light) using TraCI? For example, when the
vehicle enters the intersection's north lane/edge, know that it will
turn to the right.
I thought of using vehicle.getRoute(), vehicle.getRoadID() and
vehicle.getRouteIndex(), but I am not sure if it is the best approach.
Thank you and best regards,
Taylor
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user