Search code examples
omnet++veinssumo

Change the color of the vehicle after reception of a beacon from RSU?


I am very new to Omnet++, SUMO and Veins. I am trying to make a simulation where, I transmit beacon from RSU every 10s and after the reception of the beacon the color of the car should change. I have generated beacons by making changes in omnetpp.ini file as follows:

enter image description here

In Wave App Layer in omnetpp.ini file I have choosen MyVeinsApp: enter image description here

In MyVeinsApp.cc file I have made following Changes:

void MyVeinsApp::onBSM(BasicSafetyMessage* bsm)
{
    traciVehicle->setColor(TraCIColor(255,0,0,0));
}

But yet I am not able to change the color of the vehicles after the reception of beacons?


Solution

  • Try using findHost()->getDisplayString().setTagArg("i", 1, "green");