'Running Python Script in Veins

I already have SUMO, OMNET++ and Veins running on my machine, but I am new to Veins. I would like to run Python scripts using Veins framework.

Let us say in the Python script we are given two objects object_A and object_B that contain data about the corresponding cars car_A and car_B. I would like to enable some exchange of information between the object_A and object_B based on the scenario happening in Veins. Could somebody explain to me, how can I accomplish my goal or point me to the corresponding literature?

I found this repository where Python and Veins are combined, but I cannot make sense of it.

Thank you!



Solution 1:[1]

Veins_Python (as of Dec 2021) is no more than a simple illustration of how to call python code from Veins and vice versa. The project can serve as inspiration for how to write such code yourself - it is not in a state where you can just download and use it without adapting it to your specific needs.

Solution 2:[2]

How to use pybind11 in omnet++ projects like veins

You can try using pybind11 as done in the above link if you are running veins in Linux environment.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Christoph Sommer
Solution 2 Pasha M.