问题
I am using a TraCI call to set the lane change mode of a vehicle to 0
to disable all lane changing:
TraCICommandInterface::setLaneChangeMode(0b000000000000);
However, the vehicle still does a lane change afterwards. I also tried 256 (i.e. 0b000100000000
and 512 (i.e. 0b001000000000
) as indicated in the wiki or in this post.
It seems that the executed lane change action was queued earlier (i.e. before the TraCI call), because the vehicle is flashing its turn light, and could not be executed due to a blocked lane. After the target lane is free, the vehicle executes the lane change, even though I set the lane change mode to 0
.
- Is there a way to abort already queued lane changes?
- Or is this a bug in SuMO?
- Or am I doing it completely wrong?
回答1:
i have disabled lane change mode by this code and it worked but after i have specified the location where i want lane change mode to be 0.
traciVehicle->setLaneChangeMode(0b001000000000);
回答2:
it works by setting setLaneChangeMode(0b000000000000)
for example
traci.vehicle.setLaneChangeMode("rear", 0b001000000000)
来源:https://stackoverflow.com/questions/50875773/how-to-disable-lane-changes-in-sumo