0

Thank you for reading the question. I have a simple query that when vehicles are broadcasting a message then the event happened and re-routing of vehicles are being done. But if I want to store the information of a vehicle such as nodeId, Speed, Direction, distance in RSU and other neighboring vehicles What is the correct way to do that?

I understand all the files of tic toc and veins itself. i found Passedmsg is there cArray, cparlist and so many things. but I really want to achieve this thing in a correct way.

Please Help me. i know it may be silly question but I have no clue where to make cchanges for storage of the message content.

Ravneet_Kaur
  • 33
  • 1
  • 8
  • Your question does not seem to be related to Veins or OMNeT++, but rather vector math. Have you considered asking over at https://math.stackexchange.com? – Horstinator Oct 16 '19 at 16:55

1 Answers1

1

As you saw in the answer to the question you quoted, getAngleRad() returns the vehicle's heading in Radians, not degrees.

Note that, as of Veins 5.0, the same functionality is achieved by calling getHeading() and then calling getRad() on the result.

If you want to know whether the two angles are from vectors pointing into the same or opposite directions, you could check whether their difference is bigger than 0.5 Pi radians (90 degrees).

See an answer on for how to calculate the smallest difference between angles for possible ways to achieve that.

Christoph Sommer
  • 6,413
  • 1
  • 14
  • 34
  • I made a small, but important correction: check for any angle above 90 degrees to also consider vehicles driving in “almost” opposite direction. – Christoph Sommer Oct 18 '19 at 07:00
  • Can you please tell me in the files when one msg is passing from vehicle in traceidemo11p and received by RSU in traceidemorsu11p. Where I can check where it is stored in RSU and vehicles. I have no words about ur help Christopher. Thank you – Ravneet_Kaur Oct 18 '19 at 08:41
  • This seems to be a different topic. In the interest of keeping topics organized on StackOverflow, may I ask you to open a new question for this? – Christoph Sommer Oct 18 '19 at 17:20
  • Sure, sorry. I did that. Please guide on the link. Thank you – Ravneet_Kaur Oct 19 '19 at 02:53