Git Product home page Git Product logo

Comments (9)

riebl avatar riebl commented on June 17, 2024 1

CAM reception signals are emitted by the CaService, i.e. if your non-police cars are not equipped with this service, your implementation will not get triggered.
However, you may receive CAMs in your custom ClearLaneService if it is assigned the same port (2001) as the CaService run by police cars. You will need to handle message reception on your own, though, i.e. by ClearLaneService::indicate.

from artery.

MartinaBarbiFivecomm avatar MartinaBarbiFivecomm commented on June 17, 2024

Ok Thanks.

And how can I define for example inside the CaService.cc that the police car is an emergency vehicle through the field EmergencyContainer_t ?

from artery.

riebl avatar riebl commented on June 17, 2024

I suggest adding a NED parameter to the CaService such as isEmergencyVehicle or similar. If this parameter is set, your customized CaService fills the EmergencyContainer_t when preparing the CAM. You can configure NED parameters in the omnetpp.ini then. Alternatively, you can modify the CaService by checking the SUMO vehicle name. The vehicle name is accessible through the VehicleController, see getFacilities() how to access this object.

from artery.

MartinaBarbiFivecomm avatar MartinaBarbiFivecomm commented on June 17, 2024

In the CaService.cc there is no bool like isEmergencyVehicle neither the definition of specialVehcileContainer, so where is this field supposed to be filled if it is not retrieved in the service?

also trying retrieving it using like the other methods:

SpecialVehicleContainer_t& svc = cam.camParameters.specialVehicleContainer; // ADDED
SpecialVehicleContainer& svc = svc.choice.emergencyContainer;

it gives me errors. And How am I supposed to fill it?

from artery.

awillecke avatar awillecke commented on June 17, 2024

This parameter and the container are not implemented. The suggestion only hinted at how the emergency container could be implemented and enabled via a parameter (or based on the vehicle type).

from artery.

MartinaBarbiFivecomm avatar MartinaBarbiFivecomm commented on June 17, 2024

I did manage to put some of the fields of SpecialVehicleContainer in the function createCooperativeAwarenessMessage as:
if (header.stationID == 226)
{
cam.camParameters.specialVehicleContainer->present == SpecialVehicleContainer_PR_emergencyContainer;
EmergencyContainer_t& ec = cam.camParameters.specialVehicleContainer->choice.emergencyContainer;
ec.incidentIndication->causeCode = 95;
}
It does not give me building errors but when running the scenario it just crashes.
If I remove this code it works. Do I have to add this container somewhere else besides in this function?

from artery.

fysch avatar fysch commented on June 17, 2024

I suspect you forgot to allocate the SpecialVehicleContainer. Take a look at the LowFrequencyContainer implementation in the CaService. A good rule of thumb is to use vanetza::asn1::allocate() whenever a parameter is marked as optional.

from artery.

MartinaBarbiFivecomm avatar MartinaBarbiFivecomm commented on June 17, 2024

I have added the container as per the LowFrequency one :
void addSpecialVehicleContainer(vanetza::asn1::Cam& message, const VehicleDataProvider& vdp)
{
if (vdp.station_id() == 226)
{
SpecialVehicleContainer*& svc = message->cam.camParameters.specialVehicleContainer;
svc = vanetza::asn1::allocate();
svc->present = SpecialVehicleContainer_PR_emergencyContainer;
EmergencyContainer& ec = svc->choice.emergencyContainer;
ec.incidentIndication-> causeCode = 95;
ec.lightBarSirenInUse.buf = static_cast<uint8_t*>(vanetza::asn1::allocate(1));
ec.lightBarSirenInUse.size = 1;
ec.lightBarSirenInUse.buf[0] = 0;
ec.emergencyPriority-> buf = static_cast<uint8_t*>(vanetza::asn1::allocate(1));
//ec.emergencyPriority.size = 1;
ec.emergencyPriority->buf[0] = 0;
}

}

As soon as it gets triggered the sim crashes. I don't actually know what I am doing wrong. Is there any other place where I have to declare this special container?

from artery.

riebl avatar riebl commented on June 17, 2024

Unfortunately, "sim crashes" is a rather fuzzy problem description. I suggest running Artery with a debugger attached. Every run_X target has an accompanying debug_X target if CMAKE_BUILD_TYPE is set to Debug. Then, the debugger usually stops at the point where the simulation crash occurs. That should help you with analyzing the problematic code section.

from artery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.