0

I want to to get vehicle speed by defining a function like getSpeedById(Std::string vid) which will give me the current speed of that vehicle. it doesnot matter the vehicle is receiving/transmitting any message. I am using TraciDemo11p example file. In that example, i know that I can get current speed only when the message is sent/ received. But I want to get speed of a particular vehicle all the simulation time which will not transmit any signal at all.

Md Abu Sayed
  • 37
  • 1
  • 4

1 Answers1

2

See answer https://stackoverflow.com/a/49973662/4707703 for how to iterate over all currently simulated vehicles in OMNeT++ and how to get a pointer to their mobility simulation module. From there, it should be as easy as calling getCurrentSpeed (instead of getCurrentPosition, which is done in the linked answer)

Christoph Sommer
  • 6,893
  • 1
  • 17
  • 35