Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Inconsistent space headway

Hi Ahsen,

 

This behaviour is compliant with how traci.vehicle.getLeader is specified. The minGap distance of the follower is excluded (2.5 is the default value). See the description in the python TraCI reference.

 

Best regards,

Mirko

 

 

 

 

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

Betreff: [sumo-user] Inconsistent space headway

Datum: 2024-10-24T20:54:36+0200

Von: "Ahsen Hamid via sumo-user" <sumo-user@xxxxxxxxxxx>

An: "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>

 

 

 

Hi
 
Let's say we are running the following scenario.
 
ego_x, ego_y = traci.vehicle.getPosition(x)
leader=traci.vehicle.getLeader(x)
leader_id=leader[0]
leader_pos_1=leader[1]
leader_pos_2x, leader_pos_2y=traci.vehicle.getPosition(leader_id)
 
The headway between two cars computed either way is not consistent rather always gives a difference of 2.5 which I presume equals to the standstill distance between the two vehicles. The following equation describes the relation.
 
leader_pos_1 = leader_pos_2x-ego_x-length-2.5
 
The attached image shows calculations from my outputs. column a is leader_pos_2x - ego_x - length and column b is leader_pos_1 - a.

Why am I seeing this difference and which of these two values is to be trusted as the real space headway between the two vehicles at any time instance?
 
Thanks
Ahsen
 
 
 

 



Back to the top