Closed hezhongyi closed 1 year ago
Hi @hezhongyi.
You can use /veins_inet/VeinsInetSampleApplication.cc
as the basis for your implementation. This application already has the necessary (/veins_inet/VeinsInetMobility
) for what you want to do.
In summary, you can adapt the /veins_inet/VeinsInetSampleApplication.cc
to work similarly to the AlertSender/AlertReceiver.cc
application used in the NR/cars examples.
You can consult an adaptation of AlertSender/Receiver for SimuLTE (which can be easily ported to Simu5G) in this repository: veins_hetvnet.
Best regards.
if you use any of inet's mobility modules then:
IMobility* mobility = check_and_cast<IMobility*>(getContainingNode(this)->getSubmodule("mobility"));
Coord pos = mobility->getCurrentPosition();
Coord vel = mobility->getCurrentVelocity();
// and so on, a full list of methods you could see in IMobility.h
if you use veins/veins_inet aka TraCI vehicles mobility then:
auto* traciVeh = veins::VeinsInetMobilityAccess().get(getParentModule())->getVehicleCommandInterface();
double speed = traciVeh->getSpeed();
// and so on, a full list of methods you could see in TraCICommandInterface.h
Hello,@gehirndienst Thanks for the answer. I have solved the problem according to the method you gave me。 Thanks for your help, Best regards, hezhongyi.
Hello,@Joahannes Thanks for the answer. I solved the problem in the way @gehirndienst gave me. Thanks for your help, Best regards, hezhongyi.
Hi Dear All, Is there any way to run NR/cars in simu5G1.2.1 to obtain vehicle information (such as speed, position, direction angle)