0

I am trying to build a simple Veins scenario where vehicles send there information to a RSU that serves a specific junction. I am not sure how to determine the RSU location.

In the omnetpp.ini, I specified the RSU location as the Omnetpp junction location (traci->junction("J1").getPosition()):

*.rsu[0].mobility.x = 102.59
*.rsu[0].mobility.y = 58.85
*.rsu[0].mobility.z = 3

However this location is not reflected in the simulation kernel and the coordination of the RSU (i.e., this->curPosition.info()) is still (0,0,0). Note, the SUMO Junction location is (-27.84,11.34).

If the RSU location set by the Omnet Junction location (traci->junction("J1").getPosition()), the rsu in the simulation GUI is far from the Vehicle that are traveling the junctions as shown in the following image:

see image here

Also, Is there a way to determine the RSU location automatically?

Hamzah
  • 120
  • 6
  • Have a look at https://stackoverflow.com/a/46884045/6077193 – Julian Heinovski Jun 06 '18 at 21:33
  • getPostion() returns the omnet coord by default in the current release. – Hamzah Jun 06 '18 at 22:41
  • I am guessing you are reading the curPosition attribute of your application. This is updated whenever a host moves. Because an RSU never moves, I guess it is never updated and remains uninitialized (at 0,0,0). Can you check? – Christoph Sommer Jun 07 '18 at 22:44
  • Yes, for the (0,0,0) is based on the curPostion in the BaseWaveAppl class. – Hamzah Jun 07 '18 at 23:24
  • @Hamzah did you manage to place RSUs automatically? I need to do the same. I have been reading the source code but I can't get a starting point. If you did it successfully, It would be great if you state the steps in abstract. – Rehab11 Jan 06 '19 at 23:50
  • @RehabShaheenEl-Qady no I did not mange to place them automatically. But, you can just write a simple script to print out their junctions' positions in veins and then copy & paste it in the .ini file. – Hamzah Jan 15 '19 at 00:14
  • @Hamzah I have already did that. I wrote a script and used the equations in the traci2omnet function. There is a parameter in the equation named "margin" which I didn't know its value. But after some invistigation I found that it is configured in each scenario and its default value is set to 25. – Rehab11 Jan 15 '19 at 23:33
  • @RehabShaheenEl-Qady I did not need to use traci2omnet. my code was something similar to this: `Coord tlLoc = traci->junction(anid).getPosition(); std::cout<<"*." + moduleName +"["<< idx << "].mobility.x = " << tlLoc.x << std::endl;` – Hamzah Jan 16 '19 at 00:48

0 Answers0