sumo icon indicating copy to clipboard operation
sumo copied to clipboard

Vehicle Doesn't follow `lateralAlignment` during forced lane change using `traci.vehicle.changeLane(..)`

Open IamDipankar opened this issue 7 months ago • 4 comments

In the sublane model, when the vehicle width is significantly low than the lane width, the vehicle can be align in the lane in different styles like: center, right, left etc. which are controlled by an attribute lateralAlignment. It usually works well. Also, traci.vehicle module has a method changeLane() which forces lane change to a specific lane. But I have noticed when then method is called the vehicle barely just go to the target lane and doesn't follow the specified lateralAlignment at all.

IamDipankar avatar May 10 '25 04:05 IamDipankar

the traci lane change ends as soon as the vehicle enters the new lane. Afterwards the vehicle is expected to continue lateral movement with its own "sublane" motivation (not reliant on traci) to achieve the desired alignment. However, this only works if the value of laneChangeMode doesn't prohibit this kind of change.

namdre avatar May 10 '25 09:05 namdre

Yes, but the lateral movement doesn't happen which is expected form latAlignment parameter of "SL2015". Its likely a glitch.

I have used these: latAlignment = "center" in vType.

and then used traci.vehicle.changeLane('ego-vehicle", 1, 1000.00) where ego-vehicle is the vehicle id. I expected it will go to lane index 1 and continue through the center of the lane. But the vehicle enters lane 1 but doesn't go to the center of the lane at all.

https://github.com/user-attachments/assets/6c394f3b-560a-4cbf-9ae3-5ed2edab9c02

Image

IamDipankar avatar May 10 '25 11:05 IamDipankar

I suppose the duration parameter 1000, has the effect of overrruling "natural" behavior and preventing the change to the center. Try a lower value.

namdre avatar May 11 '25 08:05 namdre

Yes, in that case it goes to center after the specified duration is over. But if I use small duration number there is no guarantee that this vehicle will remain in the specified lane.

IamDipankar avatar May 11 '25 09:05 IamDipankar