Open patmalcolm91 opened 4 years ago
Right, SUMO does not simulation individual carriages. What you are seeing is basically a graphical hack to make the train look nice. sumo-gui uses the geometry of the track and the length of the rail vehicle (along with parameters for carriageLength and carriageGap) to draw the carriages onto the tracks.
It could make sense to return the "shape" of the train (i.e. the list front and back position of the locomotive and carriages) in a new traci position traci.vehicle.getShape(vehID)
Right now you could replicate the sumo-gui computations by retrieving the shape of the current train edge an all the predecessor edges within the length of the train.
Thanks for the fast response, @namdre. It would be great to have such an API function in a future release. In the meantime, I will follow your suggestion of taking the predecessor edges from the vehicle route. Thanks again!
work on rail car shape API has improved in the context of JuPedSim handling of train doors (#14334)
Hello,
I'm trying to extract the coordinates of individual carriages of a rail vehicle using TraCI, or at the very least, be able to estimate them from the shape of the train as a whole. However, looking through the API documentation, I can only see how to get the vehicle position as a single point, even though it appears the entire train shape is calculated internally somewhere (the display in "real world" mode shows rail vehicles correctly, for example). Is there currently any way to get coordinates along a rail vehicle (particularly one spanning multiple edges or going around curves) using TraCI?
Thanks in advance