Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Connecting to Sumo server by TraCi HOT 9
- Artery build error HOT 6
- run into problems while trying `vagrant up` on my Ubuntu 22.04 machine HOT 6
- CAM and DENM messages HOT 2
- DEN use cases HOT 1
- connecting artery simulation scenario with the external v2x device HOT 3
- Traffic Lights management HOT 1
- Problem with adding new files to INET (<!> Error: Cannot load library) HOT 3
- adding RSU to simuLTE probleme cars veins HOT 5
- Difficulty Implementing External Service Message Transmission and Enabling Network Participants to Edit Messages in Artery HOT 6
- Integrating MQTT protocol with artery HOT 13
- Segementation fault (core dumps) in artery::FovSensor::refreshDisplay HOT 1
- ASSERT: Condition 'mController' does not hold in function 'getVehicleController' HOT 14
- Equip services to vehicles HOT 1
- Protobuff transmission using cPacket and request
- Problems running CAM Fixed and Dynamic with the same scenario HOT 5
- about a cmake error HOT 6
- UPER encoded DecentralizedEnvironmentalNotificationMessage(DENM) structure
- Regarding creating a new service to stationary nodes(rsu) HOT 3
- Creating messages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artery.