In VEINS 4.4, one can access the current location of the vehicles at the application layer (e.g. TraCIDemo11p) via "Mobility" module which is defined through TraCIMobility.
I followed the same approach to access the Mobility module at the lower layer (MAC1609_4.cc), where I added following statement at the stage 0 of the initialize function:
TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
However, I am not getting any compilation error, but when OMNET throws errors when the simulation starts and it gives following error.
Error in Module (MAC1609_4) RSUExampleScenario.node[0].nic.mac1609_4(id=12) at event # 2, t = 0.1: Assert: condition traci false in function get, \veins/modules/mobility/traci/TraCIMobility.h line 193
I have searched around for different possible solutions, but, I am still unable to solve this problem.
Related posts are:
How to access TraCI command interface from TraCIDemoRSU11p in Veins Car2X simulator?
Transmission of vehicular status in Veins