https://github.com/knowgoio/knowgo-vehicle-simulator
An interactive multi-platform Connected Car simulator for generating and streaming realistic vehicle telemetry.
https://github.com/knowgoio/knowgo-vehicle-simulator
connected-car digital-twin flutter-app flutter-desktop flutter-mac flutter-web flutter-windows iso20078 knowgo sae-j3016 simulation-model vehicle-dynamics vehicle-simulator
Last synced: 8 months ago
JSON representation
An interactive multi-platform Connected Car simulator for generating and streaming realistic vehicle telemetry.
- Host: GitHub
- URL: https://github.com/knowgoio/knowgo-vehicle-simulator
- Owner: knowgoio
- License: mit
- Created: 2020-06-23T09:54:20.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T08:19:35.000Z (about 4 years ago)
- Last Synced: 2025-04-12T19:07:44.231Z (about 1 year ago)
- Topics: connected-car, digital-twin, flutter-app, flutter-desktop, flutter-mac, flutter-web, flutter-windows, iso20078, knowgo, sae-j3016, simulation-model, vehicle-dynamics, vehicle-simulator
- Language: Dart
- Homepage: https://knowgoio.github.io/knowgo-vehicle-simulator/docs
- Size: 18.6 MB
- Stars: 35
- Watchers: 3
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README

# knowgo-vehicle-simulator
[](https://travis-ci.com/knowgoio/knowgo-vehicle-simulator)



[](https://snapcraft.io/knowgo-vehicle-simulator)
[](https://zenodo.org/badge/latestdoi/274369996)
An interactive multi-platform Connected Car simulator for generating
and streaming realistic vehicle telemetry.
## Overview
``knowgo-vehicle-simulator`` has been developed to aid in the
development and validation of data-driven Connected Car services and
models that require easy access to realistic synthetic driving data,
both for static and streaming applications. It was originally designed
for generating event records for the [KnowGo Car] platform, but has
been generalized so that it may be useful both to Connected Car service
developers and researchers.
The vehicle simulator generates a single unique vehicle, which can
be controlled either directly through the UI or through an optional
[REST API]. This may be further interfaced with OEM-specific external
data sources and models in order to permit the simulation state to act
as an automotive digital twin. For fleet simulation workloads, multiple
instances of the simulator may be run in parallel, with each generated
vehicle being manually joined to a specified fleet.
### Live Demo
A live demonstration of the Simulator is available [here][live-demo].
[live-demo]: https://knowgoio.github.io/knowgo-vehicle-simulator
### Installation
Installation from a binary release is recommended. Regular releases are
made to various app stores, please refer to the one appropriate for
your platform:
[](https://snapcraft.io/knowgo-vehicle-simulator)
[
](https://www.microsoft.com/store/apps/9N70DBN4ZX3W?ocid=badge)

Releases can also be obtained directly from [GitHub][releases].
[releases]: https://github.com/knowgoio/knowgo-vehicle-simulator/releases
### Deployment
For deployment of a self-contained web-based instance of the simulator,
a number of deployment options have been provided:
#### Docker
Multi-arch images are provided under [knowgo/knowgo-vehicle-simulator].
The image can be run directly as:
```
$ docker run -p 8086:8086 knowgo/knowgo-vehicle-simulator
```
[knowgo/knowgo-vehicle-simulator]: https://hub.docker.com/repository/docker/knowgo/knowgo-vehicle-simulator
#### Kubernetes
To create a Kubernetes `Deployment` including a single instance of the
simulator:
```
$ kubectl apply -f https://raw.githubusercontent.com/knowgoio/knowgo-vehicle-simulator/simulator-deployment.yaml
```
An optional `Service` exposing the simulator port on the cluster can
also be applied:
```
$ kubectl apply -f https://raw.githubusercontent.com/knowgoio/knowgo-vehicle-simulator/simulator-service.yaml
```
### Simulator UI

## Documentation
For additional documentation and tutorials, please refer to the [documentation].
[documentation]: https://knowgoio.github.io/knowgo-vehicle-simulator/docs
### Postman Collection for Simulator REST API
A Postman Collection and pre-configured environment for interacting
with the Simulator [REST API] in a local simulation environment is
available [here][postman-collections].
[postman-collections]: https://github.com/knowgoio/knowgo-postman-collections
## Architecture
The Simulator itself consists of several different components:
- The Vehicle Simulation model
- An `Event loop` for generating vehicle events, run as either
an Isolate or Web Worker depending upon the target platform.
- An optional `HTTP Server isolate` for exposing a REST API with basic
vehicle controls - starting/stopping the vehicle, updating the
vehicle state, handling vehicle notifications, and querying vehicle
events.
As the simulation state can not be shared directly across the isolates,
the simulation model in the main isolate acts as the source of truth
across the system:
- Updates from the `Event loop` are applied to the simulation model
periodically, in line with the event generation frequency: once
per second by default.
- The `HTTP Server isolate` maintains its own cached copy of the
simulation state, which is updated with changes from the Event
isolate, UI interaction, and the REST API. Changes received through
the REST API are cached in the `HTTP Server isolate` and proxied back
to the simulation model directly.
- The UI in the `main isolate` is redrawn based on changes to the
simulation model, triggered by UI interaction and updates from the
`Event loop` or `HTTP Server isolate`.
An overview of the overall interactivity patterns for the different
target platforms is provided in the table below:
Flutter Web | Other Target Platforms
:--------------------------------:|:----------------------------------:
 | 
## Implementation Status
- [x] Linux desktop
- [x] Windows desktop
- [x] macOS desktop
- [x] Web
- [x] Android
- [x] iOS
## Event Publication
By default, generated events are only logged in the console. Events can
be published to a custom notification endpoint, a KnowGo API backend,
as well as MQTT and Kafka brokers (as well as any combination thereof).
The specific configuration for each is outlined below.
## Configuration
Configuration of the simulator can be tuned through a `config.yaml`
file, which will be parsed and updated by configuration changes within
the UI. The format of the file is:
```yaml
sessionLogging: true
eventLogging: true
# Allow unauthenticated requests to REST API
allowUnauthenticated: true
# Optional endpoint to post generated events to
notificationUrl: http://myserver.com/endpoint
# Optional KnowGo Backend Configuration
knowgo:
server:
apiKey:
# Optional Kafka Broker Configuration
kafka:
broker:
topic:
# Optional MQTT Broker Configuration
mqtt:
broker:
topic:
```
A number of environment variables can also be set:
Environment Variable | Description | Default value
:-------------------|:-----------|:-------------
*KNOWGO_VEHICLE_SIMULATOR_CONFIG* | Path to config file | `/knowgo_vehicle_simulator/config.yaml`
*KNOWGO_VEHICLE_SIMULATOR_LOGS* | Path to log directory | `/knowgo_vehicle_simulator/logs`
*KNOWGO_VEHICLE_SIMULATOR_IP* | IP address to bind for REST API | 0.0.0.0
*KNOWGO_VEHICLE_SIMULATOR_PORT* | HTTP port to bind for REST API | 8086
*KNOWGO_SIGNING_KEY* | Signing and validation secret for API keys | secret-key
## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/knowgoio/knowgo-vehicle-simulator/issues
## License
Licensed under the terms of the MIT license, the full version of which
can be found in the [LICENSE][license] file included in the distribution.
[KnowGo Car]: https://knowgo.io
[REST API]: https://knowgoio.github.io/knowgo-vehicle-simulator/docs/rest-api/
[license]: https://raw.githubusercontent.com/knowgoio/knowgo-vehicle-simulator/master/LICENSE