Geographic coordinates not working properly on NS3

410 views
Skip to first unread message

Ricardo G.

unread,
Jul 24, 2014, 8:49:16 PM7/24/14
to ns-3-...@googlegroups.com
Hi, while doing tests with SUMO-NS3 conversion, I found that I can let SUMO keep the "geographic coordinates" (I don't know its name) into the FCD trace with:

sumo -c sumoMap.sumocfg --fcd-output fcd_trace.xml --fcd-output.geo true

Instead of

<vehicle id="0" x="152.28" y="489.97" angle="91.59" type="DEFAULT_VEHTYPE" speed="10.13" pos="137.97" lane="-27467626#1_0" slope="0.00"/>

I get this

<vehicle id="0" x="-99.140278" y="19.490436" angle="91.591243" type="DEFAULT_VEHTYPE" speed="10.125433" pos="137.972700" lane="-27467626#1_0" slope="0.000000"/>

That is fine. Then I convert this fcd trace into the mobility trace that is needed for the Ns2MobilityHelper.

$SUMO_HOME/tools/bin/traceExporter.py --fcd-input fcd_trace.xml --ns2config-output ns2.config.tcl --ns2activity-output ns2.activity.tcl --ns2mobility-output ns2.mobility.tcl

In the mobility trace instead of

$node_(0) set X_ 152.28
$node_(0) set Y_ 489.97

I get this

$node_(0) set X_ -99.140278
$node_(0) set Y_ 19.490436

As I intented. I thought it was going to work fine, and using the mobility model I could get the "GPS position". But it didn't work out as planned.

The problem is that the nodes having coordinates (-99.138528, 19.49085), (-99.140472, 19.490461), (-99.138551, 19.490733), (-99.140595, 19.490457), (-99.138575, 19.49061), (-99.140719, 19.490454) and so on, the coordinates vary in hundredths and the nodes result in being next to each other, almost in the same spot.

Does someone know how to use this geographic coordinates with NS3 interpreting them correctly?

I could use the cartesian approach and use the coordinates as SUMO transforms them, and when I set the area of interest of my geographic routing protocol I use cartesian coordinates.

Ricardo G.

unread,
Jul 25, 2014, 5:42:35 PM7/25/14
to ns-3-...@googlegroups.com
Does someone knows how does SUMO performs this geographic to cartesian coordinates translation?

Konstantinos

unread,
Jul 25, 2014, 6:16:24 PM7/25/14
to ns-3-...@googlegroups.com
Dear Ricardo,

I think that the SUMO mailing list is more appropriate place to ask.
NS-3 can read (x,y) co-ordinates as in NS-2 format. They are not geographic.
So, I guess that you should export non-GPS coordinates from SUMO. This does not restrict you or does not change much in program functionalities. 

pdbarnes

unread,
Jul 26, 2014, 10:24:01 AM7/26/14
to ns-3-...@googlegroups.com
Just guessing, but the SUMO coordinates might be decimal lat/lon. ns-3 coordinates are probably in meters.
Reply all
Reply to author
Forward
0 new messages