Setting up a vehicle to stop midway using the traci interface
Add your issue description here. After I call traci.vehicle.setParkingAreaStop() and traci.vehicle.setStop() at a certain moment. Printing traci.vehicle.getRoadID() and traci.vehicle.getDrivingDistance() before the vehicle moves has no effect. If possible, upload an example that shows your problem. pythonProject1.zip
SUMO-version: 1.19 operating system: windows 10
Your download link lets Github return "NOT FOUND"...?
I have re-uploaded it.
You have chosen a problematic border case with your stop settings. The vehicle is already at (lane E0_0 position 18m) because the parking area is defined up to that point. Sumo gets confused by the second stop command
traci.vehicle.setStop('d1','E0',pos=18, laneIndex=0, duration=100, flags=0).
If it is not extremely important, I advise to shift the second stop a little downstream (pos > 18) and it should work as expected.
You have chosen a problematic border case with your stop settings. The vehicle is already at (lane E0_0 position 18m) because the parking area is defined up to that point. Sumo gets confused by the second stop command
traci.vehicle.setStop('d1','E0',pos=18, laneIndex=0, duration=100, flags=0).If it is not extremely important, I advise to shift the second stop a little downstream (pos > 18) and it should work as expected.
Thank you for your reply. The reason I did this is that I wanted to use traci.vehicle.getDrivingDistance to calculate the distance from the vehicle to a certain edge along the route during the parking area, but I found that I couldn't achieve it. Do you have any good ideas?
An idea (still to be implemented!) would be to compute the distance from a reference point of the current stop on the network (only on request / if wished by the TraCI client). Then there wouldn't be any need for a second stop on the road network.
An idea (still to be implemented!) would be to compute the distance from a reference point of the current stop on the network (only on request / if wished by the TraCI client). Then there wouldn't be any need for a second stop on the road network.
That's a good idea! Also, I thought of a way to do this. Add a vehicle of the same type to an adjacent lane in a parking area and set up the same route and parking position. Get distance data based on the added vehicle, and remove the vehicle after getting the distance data. (It's a bit clumsy though :) )