0

I'm trying to create a routing protocol in omnetpp and veins. My problems is that I'm not sure if the omnetpp.ini file under the WaveAppLayer (which is the routing or moving the vehicles or so I think it is) when declaring the file (Thesis.node[*].applType it also shows unused symbol) that does the routing does not seems to log any statements. I'm not sure if it's even working or not at all. My guess is it's not working at all and I been trying to figure out how to get it work for almost a 2 weeks and I'm completely lost.

I did try to follow veins example and some other projects, but that does not seems to help at all. Because, it just runs the veins tutorial and not mine. I guess I'm looking for some type of feedback from the program, but I get none. That is not the case with RSU, I can see the messaging been received in RSU class and initialization does happen. But in terms of vehicles I don't see that at all.

omnetpp.ini

[General]
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 1s
**.cmdenv-log-level = info

ned-path = .
image-path = ../../images

network = globcomm.simulation.Thesis

##########################################################
#            Simulation parameters                       #
##########################################################
debug-on-errors = true
print-undisposed = true

sim-time-limit = 500s

**.scalar-recording = true
**.vector-recording = true

**.debug = false
**.coreDebug = false

*.playgroundSizeX = 5000m
*.playgroundSizeY = 5000m
*.playgroundSizeZ = 500m


##########################################################
# Annotation parameters                                  #
##########################################################
*.annotations.draw = true

##########################################################
# Obstacle parameters                                    #
##########################################################
#*.obstacles.debug = false
#*.obstacles.obstacles = xmldoc("config.xml", "//AnalogueModel[@type='SimpleObstacleShadowing']/obstacles")

##########################################################
#            TraCIScenarioManager parameters             #
##########################################################
*.manager.updateInterval = 1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.autoShutdown = true
*.manager.launchConfig = xmldoc("erlangen.launchd.xml")

##########################################################
#                       RSU SETTINGS                     #
#                                                        #
#                                                        #
##########################################################
Thesis.numberRSU = 1

Thesis.rsu[0].applType = "globcomm.src.RSU11p" # this works
Thesis.rsu[0].appl.headerLength = 80 bit
Thesis.rsu[0].appl.sendBeacons = false
Thesis.rsu[0].appl.dataOnSch = false
Thesis.rsu[0].appl.beaconInterval = 1s
Thesis.rsu[0].appl.beaconUserPriority = 7
Thesis.rsu[0].appl.dataUserPriority = 5
Thesis.rsu[0].appl.dataROI = 500m
Thesis.rsu[0].appl.minDistance = 0m
Thesis.rsu[0].appl.maxDistance = 500m

Thesis.rsu[0].mobility.x = 2000
Thesis.rsu[0].mobility.y = 2000
Thesis.rsu[0].mobility.z = 3


##########################################################
#            11p specific parameters                     #
#                                                        #
#                    NIC-Settings                        #
##########################################################
*.connectionManager.sendDirect = true
*.connectionManager.maxInterfDist = 2600m
*.connectionManager.drawMaxIntfDist = false

*.**.nic.mac1609_4.useServiceChannel = false

*.**.nic.mac1609_4.txPower = 20mW
*.**.nic.mac1609_4.bitrate = 6Mbps
*.**.nic.phy80211p.sensitivity = -89dBm

*.**.nic.phy80211p.useThermalNoise = true
*.**.nic.phy80211p.thermalNoise = -110dBm

*.**.nic.phy80211p.decider = xmldoc("config.xml")
*.**.nic.phy80211p.analogueModels = xmldoc("config.xml")
*.**.nic.phy80211p.usePropagationDelay = true

*.**.nic.phy80211p.antenna = xmldoc("antenna.xml", "/root/Antenna[@id='monopole']")

##########################################################
#                    WaveAppLayer                        #
##########################################################

Thesis.node[*].applType = "globcomm.src.MyThesisApp" # This does not work (not sure why?)
# Thesis.node[*].applType = "globcomm.src.MyThesisApp"
*.node[*].appl.headerLength = 80 bit
*.node[*].appl.avgCommRange = 250m
Thesis.node[*].appl.estimatedOneHopDelay = 60ms
*.node[*].appl.sendBeacons = false
*.node[*].appl.dataOnSch = false
*.node[*].appl.beaconInterval = 1s

##########################################################
#                      Mobility                          #
##########################################################
*.node[*].veinsmobilityType.debug = true
*.node[*].veinsmobility.x = 0
*.node[*].veinsmobility.y = 0
*.node[*].veinsmobility.z = 1.895
*.node[*0].veinsmobility.accidentCount = 1
*.node[*0].veinsmobility.accidentStart = 75s
*.node[*0].veinsmobility.accidentDuration = 50s


##########################################################
#                      Vehicles                          #
##########################################################
Thesis.manager.numVehicles = 20
Thesis.host[*].appl.avgCommRange = 250mm
*.node[*].appl.avgCommRange = 250mm

MyThesisApp.cc (Routing class)

//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#include "MyThesisApp.h"

Define_Module(MyThesisApp);

void MyThesisApp::initialize(int stage)
{
    EV << "Initialize the stage1111?" << endl;
    BaseWaveApplLayer::initialize(stage);

    if (stage == 0) {
        // Read NED parameters
        EV << "Initialize the stage?" << endl;
        numberTimeSlots = par("numberTimeSlots");
        avgCommRange = par("avgCommRange");
        estimatedOneHopDelay = par("estimatedOneHopDelay");

        dataRateTimer = new cMessage("send data", SEND_DATA);

        averageDelay = 0.0;
    }
}

void MyThesisApp::finish()
{
    BaseWaveApplLayer::finish();
}

void MyThesisApp::handleSelfMsg(cMessage* msg)
{
    switch(msg->getKind()) {
        //Recived a beacon timeout. Send a beacon and schedule the next one
        case(SEND_BEACON_EVT): {
            WaveShortMessage* wsm = new WaveShortMessage();
            populateWSM(wsm, 0, -1);

            BeaconMsg* beaconMsg = new BeaconMsg("beacon");
            beaconMsg->setSenderDirection(traci->getAngleRad());



            wsm->encapsulate(beaconMsg);
            sendDown(wsm);
        }
    }

}

void MyThesisApp::onBeacon(BasicSafetyMessage* bsm)
{

    EV << "beacon messages? " << endl;
    BeaconMsg* beacon = dynamic_cast<BeaconMsg*>(bsm->decapsulate());

    // Received beacon from new neighbor
    inSCF1(bsm->getSenderPos(), beacon->getSenderDirection());


    insertEntry(bsm->getSenderAddress(), bsm->getSenderPos(), beacon->getSenderDirection());

    EV << "Table entry for beacon messages" << endl;




    delete beacon;
}

I excepting to see "Initialize the stage1111?" these type of print statements to be printed in the console and but they do not.

Any help is really greatly appreciated. Thank you :)

Abubakar Saad
  • 202
  • 1
  • 2
  • 13
  • 1
    You're saying that `globcomm.src.RSU11p` works as intended. Did you add the same `EV << "...` code to its `initialize` method to check? Did you try cleaning your project to see if this makes a difference? – Christoph Sommer Aug 14 '19 at 07:04
  • Cleaning the project did the trick. Thank you very much :) – Abubakar Saad Aug 14 '19 at 09:54

0 Answers0