Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Identify a successful lane change in TraCI

let state,stateTraci be the result of calling getLaneChangeState.
A successful lane change in a specific direction corresponds to a 'True' result by vehicle.wantsAndCouldChangeLane(vehID, direction, stateTraCI).
For details, see

The urgent bit currently signals that speed adaptations are taken to facilitate a lanechange that is still blocked.

Am Di., 22. Feb. 2022 um 21:28 Uhr schrieb Hriday Sanghvi via sumo-user <sumo-user@xxxxxxxxxxx>:

I am trying to differentiate the "intent" to lane change from the actual act of lane changing for vehicles (since the time at which it may happen might differ due to blocking vehicles or other reasons). What bits have to be set for the lane change state to indicate a successful lane change to the left / right via TraCI.

Supposing I can get the bits set from traci.vehicle.getLaneChangeState(vehID=vh, direction=+1) - what bits have to be checked to see if there was a successful lane change to the left or the right by TraCI's traci.vehicle.changeLane(vehID=vh, laneIndex=0, duration=1) command, considering the meaning of the bits:

2^0: stay
2^1: left
2^2: right

2^3: strategic
2^4: cooperative
2^5: speedGain
2^6: keepRight
2^7: TraCI
2^8: urgent
2^9: blocked by left leader
2^10: blocked by left follower
2^11: blocked by right leader
2^12: blocked by right follower
2^13: overlapping
2^14: insufficient space
2^15: sublane

I have also tried traci.vehicle.getLaneChangeStatePretty(vehID=vh, direction=+1) to get varied results - sometimes with both the 2^1 and 2^2 bits being set, which I am not sure what it would mean since it returns ['left', 'right']. Also, not fully sure when the "urgent" (2^8) bit is set?

Thank you.

sumo-user mailing list
To unsubscribe from this list, visit

Back to the top