sumo icon indicating copy to clipboard operation
sumo copied to clipboard

Vehicle position mismatch while using traci.vehicle.moveTo

Open prasuka4 opened this issue 1 year ago • 3 comments

Hi, I have tried to make vehicle to move from one position to other using "traci.vehicle.moveTo(veh2, lane1, pos1)". But every time when vehicle is trying to move it is moving to start of new edge but not the exact position that is mentioned. Could you please help me in this regard.

Thanks image

SUMO-version: V1_20 operating system: Windows

prasuka4 avatar Oct 12 '24 15:10 prasuka4

vehicle.moveTo takes effect before vehicle movements, which means that the final position in that step will be the sum of the moveTo position and the vehicle movement.

namdre avatar Oct 14 '24 06:10 namdre

Hi Thanks for the response, but if we try to log the previous position and passing it to the vehicle it should ideal move there but here it is trying to move to start of the edge. Let me know how to proceed with that.

THanks

prasuka4 avatar Oct 15 '24 17:10 prasuka4

  • either use a moveToPosition that is reduced by the current vehicle speed
  • or use moveToXY which sets the position after vehicle movements

namdre avatar Oct 15 '24 21:10 namdre