I want to transmit a given car's vehicular data such as it's vType
, instantaneous speed
and position
to a RSU in a scenario in Veins.
How can I obtain the data from SUMO and send it through MiXiM methods to an RSU node?
I want to transmit a given car's vehicular data such as it's vType
, instantaneous speed
and position
to a RSU in a scenario in Veins.
How can I obtain the data from SUMO and send it through MiXiM methods to an RSU node?
To achieve your goal you have to use the
TraCIMobility
component ofVeins
.You can do that by first getting a pointer to that component in the
initialize()
method of your nodeOnce you have the
mobility
component you can query it for various data.The type of data that it can provide can be found in
TraCIMobility.h
For example in your case you could do:
Then you can attach this data to your message and send it to the RSU of your choice.
If this exact solution does not work for you that could be due to me using a different Veins version than yours.
However you will certainly find what you need in
TraCIDemo11p.cc
orTraCIDemoRSU.cc
of your Veins project.Also,
TraCICommandInterface
is something you should have a look at.In the official Veins website under the Documentation section it is said:
A potentially related question/answer here: https://stackoverflow.com/a/29918148/4786271