riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
204 stars 132 forks source link

Implement Shared Knowledge Between Vehicles #349

Open Rom-1T opened 2 weeks ago

Rom-1T commented 2 weeks ago

Hello,

For my research, I want to implement a form of "shared knowledge" between vehicles. As a first step, I aim to create shared knowledge that represents ground truth information, including position, speed, detected objects, etc., for each vehicle.

After reviewing the code, I thought that using the GlobalEnvironmentModel might be a potential solution. However, I'm having trouble determining the best approach. My questions are:

What is the easiest way to retrieve information from all vehicles? Is using the GlobalEnvironmentModel a good approach for this purpose? Thank you!

riebl commented 2 weeks ago

Hi @Rom-1T,

I think the GlobalEnvironmentModel is a good starting point for the global state of physical properties. By design, the overall state of OMNeT++ simulations is spread among its modules, i.e. the sum of all module entities builds up the simulation state at a particular time. Thus, you may need to traverse the module tree to collect more or other data.

If you don't need the ground truth at runtime, you can also do the analysis afterwards. For example, each vehicle may contribute its "real" positions over time to an OMNeT++ result vector. If you also log the "assumed" positions derived by others, you can calculate the error margin in a post-processing step.

Rom-1T commented 2 weeks ago

Hello,

After running some simulations, I understand that vehicle modules are appended to the network, which can make it difficult to collect data. I considered using the GlobalEnvironmentModel to access the vehicle modules, like a pointer, but it doesn't seem to align with the architecture of OMNeT++. However, in a fork of Artery, I saw a modification of the EnvironmentModelObject that included a VehicleDataProvider variable, enabling the collection of dynamic data via the GlobalEnvironmentModel. But I don't find that solution very efficient.

On the other hand, I thought of relying on a module inside each vehicle to update the "shared knowledge" based on their LocalEnvironmentModel, which may better match a real-world implementation. However, pedestrians and non-connected vehicles would not update the shared knowledge, making it difficult to evaluate the efficiency of this shared knowledge in Collective Perception.

I'll continue searching for a proper solution. Thank you for your response.

riebl commented 2 weeks ago

If the tracked EnvironmentModelObject is a TraCI vehicle, you can cast its pointer to TraCIEnvironmentModelObject. This class gives you access to the object's VehicleDataProvider.