1

i have been doing modification to TraCIDemo11p.cc file and i want to get the position , speed and angle for a certain node" node[8]". i know how to use getCurrentPosition() ,getCurrentSpeed() & getAngleRad() but i don't know how to refer (point) to the node . i already checked the following question and answer and i could get the position only

How to get RSU coordinate from TraCIDem11p.cc?

i think i don't know how to use getParentModule() and getSubmodule() . iam using veins 4.4 , sumo 0.25 , omnet 4.5

Dalia Adly
  • 53
  • 6

1 Answers1

1

Using OMNeT++, you can get a cModule* that refers to any named node. As you already know that each of your cars will have a mobility module of a well-known name, this part is straightforward. From there, it's just an issue of casting the returned pointer to the right type (TraCIMobility).

Christoph Sommer
  • 6,893
  • 1
  • 17
  • 35
  • An actual code example would have been nice you know ... – Sebi Dec 11 '20 at 21:27
  • @Sebi good idea! Do feel free to edit this Post to provide one – Christoph Sommer Dec 13 '20 at 12:39
  • This post's two years old now/198 views ... The point was that no one is giving any usable examples when it comes to omnet, or any minimal working ones for that matter. It's insanely frustratinghaving to wade through doxygen style docs. The official manual isn't of great help either. I did manage my way through the component manager but given the negative experiences on SO, I've decided not to post my code. Cheers! – Sebi Dec 13 '20 at 12:46