0

I've run SUMO 0.30.0 , with Veins 5.0 and omnetpp 4.7 I was editing in the file veins-5.0\src\veins\modules\application\ieee80211p\DemoBaseAppLayer.cc

void DemoBaseApplLayer::handleLowerMsg(cMessage* msg)
{
    
    BaseFrame1609_4* wsm = dynamic_cast<BaseFrame1609_4*>(msg);
    ASSERT(wsm);
double myspeed = mobility->getSpeed(); 
if (myspeed < 16 ) {
    if (DemoSafetyMessage* bsm = dynamic_cast<DemoSafetyMessage*>(wsm)) {
        receivedBSMs++;
        onBSM(bsm);
    }
    else if (DemoServiceAdvertisment* wsa = dynamic_cast<DemoServiceAdvertisment*>(wsm)) {
        receivedWSAs++;
        onWSA(wsa);
    }
    else {
        receivedWSMs++;
        onWSM(wsm);
    }
}
    delete (msg);
}

to get Vehicles speeds, but it back with an error. Any Suggestions ?

ELMasry
  • 11
  • 1

1 Answers1

0

As you did not include what error you are seeing and when you are seeing this error, I am guessing that your simulation builds fine, but crashes when run.

I would further guess that mobility is set to a nullptr because your code runs on a node that is not mobile (e.g., a Road Side Unit, RSU).

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