No project description provided
Project description
Connected Car Simulation
Connected Car Simulation is a Python-based simulator for experimenting with vehicle movement, route-following, and traffic-light interaction. It ships with:
- a live OpenLayers web UI
- a WebSocket stream for realtime simulation updates
- an HTTP API for controlling the simulation and reading state
- Swagger-based API documentation
Features
- Realtime vehicle simulation on a GPX-based route
- Configurable traffic-light timings and vehicle parameters
- Browser UI for map visualization and simulation control
- HTTP endpoints for control and inspection
- OpenAPI/Swagger documentation at
/api/docs - PyInstaller build support
Project Layout
connected_car_simulation/
├── connected_car_simulation/
│ ├── main.py
│ ├── simulation_environment.py
│ ├── webserver.py
│ ├── websocket.py
│ └── resources/
│ ├── config.xml
│ └── ui/
├── resources/
│ └── images/
├── examples/
├── pyinstaller.spec
└── tox.ini
Requirements
- Python 3.9+
- A virtual environment is recommended
Development Setup
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
Running the Simulator
Start the application with:
python -m connected_car_simulation
Once started, open:
- UI:
http://localhost:8080/static/index.html - Swagger docs:
http://localhost:8080/api/docs
The simulator writes logs to stdout and to connected_car_simulation.log in the current working directory.
The simulator also exposes a WebSocket endpoint on:
ws://localhost:8081
Python client examples are available in examples/python, with one simple_example over HTTP and one over WebSocket.
HTTP API
The simulator provides these main HTTP endpoints:
GET /api/actions/set_vehicle_outputGET /api/actions/set_vehicle_positionGET /api/actions/get_simulation_stateGET /api/actions/get_model_ui_resourcesGET /api/actions/get_route_informationGET /api/actions/get_vehicle_input_adhocGET /api/actions/get_vehicle_input_infrastructureGET /api/openapi.jsonGET /api/docs
For parameter and schema details, use the Swagger UI.
Configuration
The simulator reads its runtime configuration from:
This file controls vehicle parameters, speed limits, and traffic-light definitions.
Packaging with PyInstaller
Build the standalone executable with:
tox -e pyinstaller
The PyInstaller spec bundles:
connected_car_simulation/resources/config.xml- the web UI assets
- example files
Notes
- In PyInstaller
--onefilemode, bundled resources are extracted into a temporary_MEI...directory at startup. - The project resolves bundled resource paths at runtime so the same code works in development and in the packaged executable.
License
GPL 3.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file connected_car_simulation-0.1.0.tar.gz.
File metadata
- Download URL: connected_car_simulation-0.1.0.tar.gz
- Upload date:
- Size: 67.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a47a6476238d9953b9c6a2a7b22f1a949e84d6de13ce23dd5ad9a7b6b21623e
|
|
| MD5 |
dcf8a9e6d32ed06421f82e17d992798c
|
|
| BLAKE2b-256 |
9650a301000f26f04fe3b62051ca2ce1fd2a3caa281b63814ae7d246efda0d62
|
File details
Details for the file connected_car_simulation-0.1.0-py3-none-any.whl.
File metadata
- Download URL: connected_car_simulation-0.1.0-py3-none-any.whl
- Upload date:
- Size: 56.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe8092d48c07205e3a6b07ee7d396ff45031c20184054b65ff31c21777737b2c
|
|
| MD5 |
c799a3440be8773092e4d9b98bc6f05c
|
|
| BLAKE2b-256 |
055f5f63bda2a0d1c22dfaa72a8872c93b7efe89aa50467327be01afcb618f46
|