Set Starting Position of Vehicle in Veins from Generated Topology in SUMO

246 views
Skip to first unread message

Yasir Saleem

unread,
Oct 26, 2020, 9:30:34 AM10/26/20
to OMNeT++ Users
Hello everyone,

I am working on a highway scenario in which I have a straight road.
In my scenario, there is a straight road with one vehicle and one RSU. 
RSU is deployed at the center of the road, while the vehicle will move from one point of the highway towards the ending point of the highway. 
I want that when a vehicle reaches the coverage of RSU, both RSU and vehicle should be able to exchange messages with each other. 

I have generated this topology in Netedit and SUMO. 
Then I edited the example in Veins and set it to my generated topology in SUMO. 
Although it is working but the problem is that the vehicle starts moving from the origin of OMNeT++. I want to change the starting point of vehicle and set it somewhere in the middle. 
Similarly, I also tried to update the position of RSU in .ned file, but every time, the RSU appears at the same location. 

Can anyone suggest me how to fix this issue (i.e., i) how can I specify the starting position of a node in OMNeT++ so that it passes near the RSU, and ii) how to update the position of RSU)? Many thanks. 

I have provided the screenshots of both my OMNet++ simulation and network topology in SUMO in attachment. 

PS: If anyone has example code of my mentioned example scenario, I would really be very grateful and appreciate it a lot. Many thanks. 

Best Regards,
Yasir Saleem
Screen Shot 2020-10-26 at 2.15.42 PM.PNG
Screen Shot 2020-10-26 at 2.17.11 PM.png

Pablo

unread,
Apr 3, 2021, 12:26:42 PM4/3/21
to OMNeT++ Users
Hi Yasir,

1) You can specify the route of vehicles in the .rou.xml file. A list of edges.

2) For placing the RSUs in a exact position, you can specify the exact coordinates in the omnetpp.ini file. The RSU can be defined with an object "BaseMobility mobility", and then, in the omnetpp.ini you can specify its position, for example (100,200):

*.rsu[0].mobility.speed = 0mps
*.rsu[0].mobility.acceleration = 0
*.rsu[0].mobility.x = 100
*.rsu[0].mobility.y = 200

However, SUMO and OMNeT++ use different coordinate systems.You can try the GatcomSUMO application for computing the proper coordinates, generating routes, etc.

Regards
Pablo
Reply all
Reply to author
Forward
0 new messages