0

I am trying to learn how to use Veins and Omnet++, so forgive any glaringly obvious oversights. I was able to successfully run the example program, and I managed to create a custom SUMO vehicle simulation, but I cannot figure out how to incorporate messages between cars and/or the RSU. Basically, I want to just create a simple network between a couple of vehicles and an RSU that can send/receive messages. Nothing fancy.

I am using omnet++ 5.5.1, sumo 0.32.0, and veins 4.7.1. I already worked through the Tic-Toc tutorial and ran the example scenario provided with Veins. Over the past week, I have spent hours digging through online forums and youtube tutorials, but I have yet to find a single clear example of how to establish a simple connection and send messages between a couple of vehicles and/or an RSU. Digging through the example code is confusing, because I cannot find anywhere where messages are actually sent. I did look at car.ned and RSU.ned, but I don't see any sendMessage() or recieveMessage() functions. Any advice would be greatly appreciated.

  • The example scenario already does exactly what you want to do. Have a look at its implementation, in particular `TraCIDemo11p` and `TraCIDemoRSU11p` and you'll find out how to send and receive messages. – Horstinator Sep 21 '19 at 13:41
  • Ok, so I looked at those files, and I see the methods for handling messages. But is there another file that handles the logic behind the messages in the example scenario? For example, how does the program decide which car crashes? How does it decide how many messages are sent? – NinjaMaster Sep 21 '19 at 21:18
  • I think I'm just having trouble understanding how all the different files tie together. But if that is something I just have to figure out, I understand that also. Just thought I would ask some advice before pouring more hours into it. – NinjaMaster Sep 21 '19 at 21:19
  • 1
    The logic for crashing the car is configured in the `omnetpp.ini`. Near the bottom of the file you will find the accident related parameters, e.g., `accidentCount`. Note the use of the wildcard to select what vehicles this configuration applies to. The logic for generating the message is in the applications. The initial message is generated in `handlePositionUpdate`, in `onWSM` and `handleSelfMsg` it is relayed. – Horstinator Sep 22 '19 at 12:35
  • 1
    Thanks, I appreciate the help! – NinjaMaster Sep 23 '19 at 15:14

0 Answers0