Python behavioral models


Run it
git clone https://github.com/remotivelabs/remotivelabs-remotive-car.git
cd remotivelabs-remotive-car
remotive topology build \
-f instances/hello_world/main.instance.yaml \
-f settings/can_over_udp.settings.instance.yaml \
build
docker compose -f build/remotive_car_hello_world/docker-compose.yml --profile jupyter up --build
Open http://localhost:8888 and use the notebook to press the buttons that the models react to.
Writing behavioral models in python is a very simple way of creating models for ECUs that don't yet exist. For more complex models it is also useful to create unit tests.
- Part of the RemotiveCar example
- Behavioral models: bcm and gwm
- Unit tests: tests
- Instance files: BCM/python and GWM/python
Notice:
- The platform is included in each instance, since the instance depends on the platform. However, in a larger platform it would probably make sense to only include the part of the platform describing each ECU.
- In this example the same Dockerfile is used for all python code in order to reuse the same base image. You can of course use separate Dockerfile for each container.
Running unit tests
Complex behavioral models should have unit tests. To run the unit tests for BCM:
cd models/bcm/python/bcm
uv sync
uv run poe test