Discussion:
[sumo-user] Different coordinates between sumo-gui and traci
Luca Bedogni
2012-09-22 08:14:51 UTC
Permalink
Hi
Today I stumbled upon a strange problem. I have set up a simulation with sumo and omnet through veins. I placed several POIs using sumo-gui, but the weird fact is that the coordinates returned by traci are different by the ones returned by pointing an object in sumo-gui.

Since I never saw a problem like that, I have no idea on where's the problem.

Any hint?
Christoph Sommer
2012-09-22 19:19:44 UTC
Permalink
Dear Luca,
I have set up a simulation with sumo and omnet through veins. [...] the coordinates returned by traci are different by the ones returned by pointing an object in sumo-gui
SUMO and OMNeT++ use different coordinate systems:
- Coordinates (0,0) are assigned to the bottom left corner for SUMO, to
the top left corner for OMNeT++.
- Some SUMO maps use non-normalized coordinates (e.g., going from
x=700000 to x=700010); the simulation canvas in OMNeT++ always includes
(0,0).
- Some SUMO maps use negative coordinates; simulations in OMNeT++ are
restricted to using positive coordinates only.

For these reasons, coordinates transformation needs to take place when
both simulators are coupled. The Veins TraCI modules transparently
perform this transformation (using internal methods omnet2traci and
traci2omnet).

This is why the coordinates returned by them are different from the ones
you see in SUMO.


Best,

Chris
--
Dr. Christoph Sommer
Network Research Lab, UCLA
Phone: +1 310-425-4674
BH 3803, 420 Westwood Plaza
Los Angeles, CA, 90095
Luca Bedogni
2012-09-22 19:22:21 UTC
Permalink
Hi Christoph
thank you very much for your quick and deep response. I have
understood the problem and found a solution.

Thank you again
Post by Christoph Sommer
Dear Luca,
I have set up a simulation with sumo and omnet through veins. [...] the coordinates returned by traci are different by the ones returned by pointing an object in sumo-gui
- Coordinates (0,0) are assigned to the bottom left corner for SUMO, to
the top left corner for OMNeT++.
- Some SUMO maps use non-normalized coordinates (e.g., going from
x=700000 to x=700010); the simulation canvas in OMNeT++ always includes
(0,0).
- Some SUMO maps use negative coordinates; simulations in OMNeT++ are
restricted to using positive coordinates only.
For these reasons, coordinates transformation needs to take place when
both simulators are coupled. The Veins TraCI modules transparently
perform this transformation (using internal methods omnet2traci and
traci2omnet).
This is why the coordinates returned by them are different from the ones
you see in SUMO.
Best,
Chris
--
Luca Bedogni
PHD Student in Computer Science
Department of Computer Science
University of Bologna, Italy
http://lbedogni.web.cs.unibo.it
Loading...