Open caferavci opened 1 year ago
You use a relatively old SUMO release. Can you please update to v.1.19 and check whether the problem still is present?
I have updated with v.1.19, it is still same.
I cannot reproduce this using a very similar circular driving scenario. Do you want to share a minimal scenario including python code (either your script or a log of your commands, see docs)?
Your example code crashes - respectively the getLeader() function returns 'None
' - because the leading vehicle 'CACC_3
' is already on the next edge in the current time step that you're calling the getLeader() function.
I am not sure what would be a convenient solution to get the leading vehicle across consecutive edges. Not that simple I guess, but maybe my colleagues have an idea or I simply missed something.
This structure can be common problem in most of the simulation platforms. I want to get help especially in building the strcuture for the consecutive edges part. This scenario is first step for my study. If I solve edge issues, remaining steps could be easier for me.
There is something special with your example I haven't entirely discovered yet. The problem happens only at a specific node. I'll keep you posted.
@caferavci As a workaround, please call traci.vehicle.getLeader(vehID, dist=DIST)
where DIST is the minimum lookahead distance in meters. The automatic lookahead computed out of the brake gap triggered by the default dist=0 seems not to be reliable. We'll have to work on that.
Thank you very much for your quick and efficient responses. It works now. I can continue with DIST until your update. All the best.
There seems to be a discontinuity in our search for the leader vehicle. When the leader has left the edge with the front, the search does not check for vehicles with the back still on the same edge as the follower. Instead, it already stops the search before:
Additionally, the search distance currently does not play a role as long as the vehicles are on the same lane.
Thank you for the update. Yes, I realized that part when I applied shockwave in the simulation. There were continuous peaks for the accelerations. So, I need further suggestions.
The results from using the brake gap with dist=0 are conform to their description in the documentation but we understand that the discontinuities across edges are problematic for users. So we have decided to change the default distance of traci.vehicle.getLeader
to 100 [m]. As the internal logic used for this function is used on more places, we cannot change it easily.
Hi,
I have issue with getLeader() function as indicated screenshot below. It returns 'None' while the leading vehicle present.
I debugged getFollower with that leading vehicle, it returns correct value. What are the possible issues in my approach?
This is error line in my code: control_cacc(ids, traci.vehicle.getLeader(ids)[0])
If possible, upload an example that shows your problem.
SUMO-version: 1.13.0 operating system: Win OS 11 Pro 22621.2428