{"id":48600405,"url":"https://github.com/TUMFTM/Open-Car-Dynamics","last_synced_at":"2026-04-24T15:01:10.803Z","repository":{"id":240200722,"uuid":"749388475","full_name":"TUMFTM/Open-Car-Dynamics","owner":"TUMFTM","description":"C++ Implementation of a Multibody Vehicle Dynamics Simulation","archived":false,"fork":false,"pushed_at":"2026-02-16T12:54:28.000Z","size":127,"stargazers_count":76,"open_issues_count":1,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-16T21:17:49.250Z","etag":null,"topics":["cpp","race-car-dynamics","racing","vehicle-dynamics"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TUMFTM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-28T12:51:40.000Z","updated_at":"2026-02-15T07:31:44.000Z","dependencies_parsed_at":"2025-04-14T10:07:53.306Z","dependency_job_id":"d7ce4fe3-d6bb-4b60-95ba-a806ae2c2e5e","html_url":"https://github.com/TUMFTM/Open-Car-Dynamics","commit_stats":null,"previous_names":["tumftm/open-car-dynamics"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/TUMFTM/Open-Car-Dynamics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2FOpen-Car-Dynamics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2FOpen-Car-Dynamics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2FOpen-Car-Dynamics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2FOpen-Car-Dynamics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TUMFTM","download_url":"https://codeload.github.com/TUMFTM/Open-Car-Dynamics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUMFTM%2FOpen-Car-Dynamics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32228437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","race-car-dynamics","racing","vehicle-dynamics"],"created_at":"2026-04-08T22:00:19.234Z","updated_at":"2026-04-24T15:01:10.796Z","avatar_url":"https://github.com/TUMFTM.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"doc/ocd_banner_gpt52_dark.png\" alt=\"ocd_logo\" width=\"100%\" style=\"margin-bottom: 30px;\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\" style=\"margin-bottom: 30px;\"\u003e\n\u003cp\u003e\nOpen Car Dynamics provides a comprehensive, modular, and highly efficient implementation of a vehicle's dynamic behavior. \nFollowing the philosophy of modeling vehicle behavior \"in as much detail as necessary, but as simply as possible,\" the library drastically simplifies parametrization and adaptation to custom requirements. \nWritten in modern \u003cb\u003eC++\u003c/b\u003e for maximum performance, the library offers seamless integrations for \u003cb\u003ePython\u003c/b\u003e and \u003cb\u003eROS 2\u003c/b\u003e. \nFurthermore, vehicle dynamics has been rigorously validated against data recorded with the AV21 autonomous racecar used in the \u003ca href=\"https://www.indyautonomouschallenge.com/\"\u003eIndy Autonomous Challenge\u003c/a\u003e to ensure simulation accuracy and reliability.\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\" style=\"margin-bottom: 30px;\"\u003e\n\n[![C++](https://img.shields.io/badge/C%2B%2B-20-1e6293?logo=c%2B%2B\u0026logoColor=white)](https://isocpp.org/)\n[![CMake](https://img.shields.io/badge/CMake-3.18-1e6293?logo=cmake\u0026logoColor=white)](https://cmake.org/)\n[![Docker](https://img.shields.io/badge/Container-docker-1e6293.svg?\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\n[![Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-1e6293.svg?\u0026logo=apache\u0026logoColor=white)](https://www.apache.org/licenses/LICENSE-2.0)\n[![DOI](https://img.shields.io/badge/DOI-10.1109%2FIV55156.2024.10588858-1e6293.svg?\u0026logo=doi\u0026logoColor=white)](https://doi.org/10.1109/IV55156.2024.10588858)\n\u003cbr\u003e\n\n[![Python](https://img.shields.io/badge/Python-3.12%20%7C%203.10-e3781f?logo=python\u0026logoColor=white)](https://www.python.org/)\n[![ROS 2](https://img.shields.io/badge/ROS_2-Humble%20%7C%20Jazzy-e3781f.svg?logo=ros\u0026logoColor=white)](https://docs.ros.org/en/humble/)\n![Ubuntu](https://img.shields.io/badge/Ubuntu-24.04%20%7C%2022.04-e3781f?logo=ubuntu\u0026logoColor=white)\n\u003c/div\u003e\n\n\n--- \n\n## Table of Contents\n- [1. How it works](#1-how-it-works)\n- [2. Compiling and Running the Model](#2-compiling-and-running-the-model)\n  - [2.1. Prerequisites](#21-prerequisites)\n  - [2.2. Clone Repository](#22-clone-repository)\n  - [2.3. Compile Using CMake](#23-compile-using-cmake)\n  - [2.4. Compile and Run the ROS 2 Nodes](#24-compile-and-run-the-ros-2-nodes)\n  - [2.5. Compile the Python Bindings](#25-compile-the-python-bindings)\n  - [2.6. Compile the Python Bindings without ROS 2 installed](#26-compile-the-python-bindings-without-ros-2-installed)\n- [3. Parameters](#3-parameters)\n- [4. Contributing](#4-contributing)\n- [5. Related Projects](#5-related-projects)\n- [6. References](#6-references)\n\n## 1. How it works\n\nThe model is designed to be an ordinary differential equation in state-space formulation. \nThis state space model is solved using the Dormand-Prince scheme with a constant integration step size to enable real-time execution.\n\nTo achieve modularity, each vehicle model consists of 3 different submodels:\n- Vehicle Dynamics\n- Drivetrain\n- Steering Actuator\n\nThe interfaces connecting the different models are shown in the following figure:\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"doc/Model_Composition.drawio.svg\" alt=\"model_composition\", width=\"80%\" style=\"margin-bottom: 30px;\"\u003e\n\u003c/div\u003e\n\n\nFurthermore, the vehicle dynamics models can incorporate submodels for modeling aerodynamics and tire behavior.\nHowever, these models are stateless, which distinguishes them from the 3 submodels mentioned above.\n\nAll of these 5 submodel components can be freely combined with each other, enabling a vast number of different vehicle implementations.\nWith this design, our library is able to model a lot of different vehicles without modifying the source code, also enabling rapid extension and collaboration. New variations of any submodel can be created by just inheriting and implementing the corresponding base class.\n\nThe submodels are automatically combined at compile time (hence the heavy templating in this library) by concatenating their\nstate vectors to form one big model.\nSince combination happens at compile time, the compiler is able to heavily optimize the model, making it highly efficient. \nEven the most complex model currently inside the repository achieves \na full simulation time step (using Dormand-Prince~ode4 integration) with an execution \ntime below 10 µs on our benchmark system (AMD Ryzen 9 7950X).\n\n\n## 2. Compiling and Running the Model\n\nThe model and its different bindings (ROS 2, Python) can be compiled in multiple ways from source.\nFirst, ensure you meet the prerequisites in section 2.1.\n\nAfterwards, refer to the respective subsection depending on how and what you want to compile.\n\n### 2.1. Prerequisites\n\nBefore building, ensure you have the following installed:\n- **OS:** Ubuntu 22.04 or 24.04\n- **Compiler:** A modern C++ compiler (GCC/Clang) supporting C++20\n- **Build Tools:** CMake (\u003e= 3.18), Make/Ninja\n- **Libraries:** Eigen3, Boost\n- *(Optional)* **ROS 2:** Humble or Jazzy (for ROS 2 nodes and Python bindings)\n- *(Optional)* **Docker:** If building Python bindings without a local ROS 2 installation\n\n### 2.2. Clone Repository\n\nFirst clone the repository using the command:\n\n```bash\ngit clone --recursive https://github.com/TUMFTM/Open-Car-Dynamics.git\n```\n\nThen install the required system dependencies:\n```bash\nsudo apt update\nsudo apt install libboost-dev libeigen3-dev build-essential cmake\n```\n\n### 2.3. Compile Using CMake\n\nOur build system is build on colcon and ament, the build tools of ROS2.\nHowever, for building the open car dynamics library without having `ros2`/`colcon`/`ament` installed, we provide an extra CMakeLists.txt in the \nfolder [cmake_build](./cmake_build/).\n\nTo build the project using cmake, just paste the following commands one after another into your terminal.\n\n```bash\ncd cmake_build\n```\n```bash\nmkdir build \u0026\u0026 cd build\n```\n```bash\ncmake ..\n```\n```bash\ncmake --build .\n```\n\nFor installing the library, run the following command inside the `\u003cRepoRoot\u003e/cmake_build/build` folder after building.\n```bash\ncmake --install . \n```\n\nThis creates a folder under `\u003cRepoRoot\u003e/cmake_build/install`. This folder acts as an overlay.\nTo use the library, just source the `\u003cRepoRoot\u003e/cmake_build/install/setup.sh` script in your shell.\nAfter sourcing, the library can be linked correctly.\n\nTo install the library correctly, just source the file in your `.bashrc` file by running this command in the **Root of your Repository**:\n```bash\necho \"source $PWD/cmake_build/install/setup.sh\" \u003e\u003e ~/.bashrc\n```\n\n### 2.4. Compile and Run the ROS 2 Nodes\n\nFor using the model in a ROS 2 environment, we provide a generic wrapper node which wraps \na certain vehicle model into a ROS 2 node. \n\nThe ROS 2 packages can be compiled by first installing the required dependencies for building with ROS 2 installed:\n```bash\nsudo apt install libboost-dev ros-${ROS_DISTRO}-can-msgs ros-${ROS_DISTRO}-ros2-socketcan ros-${ROS_DISTRO}-geographic-msgs\n```\n\nAfterwards, you can just compile the correct packages using:\n```bash\ncolcon build --packages-up-to ocd_vehicle_nodes_cpp --cmake-args -DCMAKE_BUILD_TYPE=Release\n```\n\nAfterwards, just source your compiled install folder and check the available `rclcpp components` by using the command\n```bash\nros2 component types ocd_vehicle_nodes_cpp\n```\n \nAlternatively, you can directly run the nodes by starting their executable. \nFinding the executables can be done using the command\n```bash\nros2 pkg executables ocd_vehicle_nodes_cpp\n```\n\n### 2.5. Compile the Python Bindings\n\nSince we use colcon and ament as build systems, compiling the Python bindings is simplest\nwhen having an active ROS 2 installation.\n\nWith ROS 2 and the required dependencies installed, compiling the bindings is as simple as\n```bash\ncolcon build --packages-up-to ocd_vehicle_models_py --cmake-args -DCMAKE_BUILD_TYPE=Release\n```\n\nAfter sourcing the install folder, the different vehicle models can be created using a \n`VehicleFactory`. For a small example on how to use the models from Python, please refer to [our Python usage example](python3/ocd_vehicle_models_py/example/example.py)\n\n\n### 2.6. Compile the Python Bindings without ROS 2 installed\n\nFor users who do not have an active ROS 2 installation, we provide the following workaround\nto still be able to use the library without having to install ROS 2.\n\nFor this to work, please make sure you install docker and all dependencies from section 2.1.\nNote: For the following commands, it is assumed you can run docker commands without sudo (your user should be in the docker group)\nIf not prepend sudo for any docker command.\n\nFirst compile the bindings in the docker container using the following command in the root of this repository.\n\n```bash\ndocker run  \\\n    --rm \\\n    -v \"$PWD\":\"$PWD\" \\\n    -w \"$PWD\" \\\n    -it \\\n    ros:$(if [ \"$(lsb_release -rs)\" = \"22.04\" ]; then echo humble; elif [ \"$(lsb_release -rs)\" = \"24.04\" ]; then echo jazzy; fi) \\\n    bash -c \"   \\\n        source /opt/ros/${ROS_DISTRO}/setup.bash \u0026\u0026 \\\n        apt update \u0026\u0026 \\\n        apt install -y libboost-dev ros-${ROS_DISTRO}-can-msgs ros-${ROS_DISTRO}-ros2-socketcan ros-${ROS_DISTRO}-geographic-msgs \u0026\u0026 \\\n        colcon build --merge-install --packages-up-to ocd_vehicle_models_py\"\n```\n\nThis creates a new folder `\u003cRepository Root\u003e/install`.\n\nTo use the compiled packages, just source the file `\u003cRepository Root\u003e/install/local_setup.sh` inside your `.bashrc` file.\nYou can do this quickly by running the following command in the root of this repo.\n\n```bash\necho \"source $PWD/install/local_setup.sh\" \u003e\u003e ~/.bashrc\n```\n\nBe sure to create a new shell after modifying your `.bashrc` file.\n\nAfter sourcing the install folder, the different vehicle models can be created using a \n`VehicleFactory`. For a small example on how to use the models from Python, please refer to [our Python usage example](python3/ocd_vehicle_models_py/example/example.py)\n\n\n## 3. Parameters\n\nFor setting parameters, all models have a [Parameter Management Interface](https://github.com/TUMFTM/TAM__param_management/blob/main/param_management_cpp/include/param_management_cpp/base.hpp) defined.\nThis allows to get and set every parameter of the respective model.\n\nAll parameters are modifiable during the runtime of the model.\n\nManaging parameters for the provided ROS 2 Nodes is simplest when using ROS 2 parameter files.\nThese can be created for a specific vehicle node using the command:\n```bash\nros2 param dump /simulation/VehicleModel\n```\n\nSetting and getting parameters from Python is done using Python dictionaries.\nFor details see [our Python usage example](python3/ocd_vehicle_models_py/example/example.py).\nWe also provide the default parameters for each model as json file under [python3/ocd_vehicle_models_py/config](./python3/ocd_vehicle_models_py/config).\n\nUnfortunately, we cannot provide meaningful parameter sets for the models.\nThis is because significant parts of the parametrization resembling the AV21 racecar are confidential.\nTherefore, we can only provide a parametrization that resembles a generic single-seater race car equipped with a conventional on-road tire.\n\nFor tire parameters, we provide a set of MF52 parameters taken from https://github.com/TUMFTM/sim_vehicle_dynamics as default.\nThis parameter set resembles a sport focused road tire.\n\n## 4. Contributing\n\nWe welcome contributions to Open Car Dynamics! Contributing is as simple as implementing a new submodel by inheriting and implementing a respective base class and creating a new package. Because of the modular design, your new submodel can then be seamlessly combined with existing components.\n\n## 5. Related Projects\n\nWhen building this vehicle model, we initially took inspiration from the [CommonRoad Vehicle Models](https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models) Project. \nHowever, we needed a real-time capable, modularized model for an autonomous race-car which is why this project was started.\n\n\n## 6. References\n\nIf you use Open Car Dynamics in your work please consider citing our paper [Analyzing the Impact of Simulation Fidelity on the Evaluation of Autonomous Driving Motion Control](https://ieeexplore.ieee.org/document/10588858/).\n```\n@INPROCEEDINGS{10588858,\n  author={Sagmeister, Simon and Kounatidis, Panagiotis and Goblirsch, Sven and Lienkamp, Markus},\n  booktitle={2024 IEEE Intelligent Vehicles Symposium (IV)}, \n  title={Analyzing the Impact of Simulation Fidelity on the Evaluation of Autonomous Driving Motion Control}, \n  year={2024},\n  volume={},\n  number={},\n  pages={230-237},\n  keywords={Measurement;Analytical models;Heuristic algorithms;Software algorithms;Approximation algorithms;Data models;Vehicle dynamics},\n  doi={10.1109/IV55156.2024.10588858}}\n\n```\n\n### 6.1 Core Developers\n - [Simon Sagmeister](mailto:simon.sagmeister@tum.de)\n - Simon Hoffmann | Implementation of parts of the ROS2 and some of the dependency functions\n - Georg Jank | Implementation of parts of the template structure of this repo.\n\n### 6.2 Acknowledgments\n\nSeveral students contributed to the success of the project during their Bachelor's, Master's or Project Thesis.\n - Panagiotis Kounatidis | *Development of an initial version of this model as well as implementation of the tire model.*\n\n\nSpecial thanks to my colleagues for the regular technical feedback and talks during the development phase of this model:\n- Sven Goblirsch\n- Frederik Werner\n\n\nWe gratefully acknowledge financial support by:\n - Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) | Project Number - 469341384\n\n","funding_links":[],"categories":["Simulation Platforms"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTUMFTM%2FOpen-Car-Dynamics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTUMFTM%2FOpen-Car-Dynamics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTUMFTM%2FOpen-Car-Dynamics/lists"}