Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Value between two vehicles

Dear Joseph,

 

in the case of two vehicles following each other on the same lane, you can use the TraCI function traci.vehicle.getLeader. It will search downstream of the current vehicle whether it can find a leader within a given distance (100m by default). If you want to know the distance between random vehicles, you can get their positions using other Traci functions like traci.vehicle.getPosition , traci.vehicle.getLanePosition, traci.vehicle.getLaneID . Then you can use them as input of a distance metric (euclidean distance, routing in the road graph using sumolib.net.getShortestPath,...).

 

Best regards

Mirko

 

 

 

 

-----Original-Nachricht-----

Betreff: [sumo-user] Value between two vehicles

Datum: 2024-03-03T21:59:25+0100

Von: "Joseph Grech via sumo-user" <sumo-user@xxxxxxxxxxx>

An: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>

 

 

 

Hi,
 
I need to find a way to get the distance between any two vehicles in the simulation. Is there a TraCI function that can do so? 
 
Thanks,
Joseph Grech

 



Back to the top