dart
Research-focused C++23 physics engine for robotics, animation, and machine learning, with Python bindings
Top Related Projects
Quick Overview
DART (Dynamic Animation and Robotics Toolkit) is an open-source library for developing robotics and physically-based simulation applications. It provides a comprehensive set of tools for modeling, simulation, and control of articulated rigid body systems, with a focus on robotics and biomechanics.
Pros
- Highly flexible and extensible architecture
- Efficient dynamics algorithms for real-time simulation
- Comprehensive set of collision detection algorithms
- Strong support for various types of joints and actuators
Cons
- Steeper learning curve compared to some other robotics libraries
- Documentation could be more comprehensive for advanced features
- Limited built-in visualization tools (relies on external libraries)
- Smaller community compared to some other robotics frameworks
Code Examples
- Creating a simple pendulum:
#include <dart/dart.hpp>
int main() {
auto world = std::make_shared<dart::simulation::World>();
auto skeleton = dart::dynamics::Skeleton::create("pendulum");
auto joint = skeleton->createJointAndBodyNodePair<dart::dynamics::RevoluteJoint>().first;
joint->setAxis(Eigen::Vector3d::UnitY());
auto body = joint->getChildBodyNode();
auto shape = std::make_shared<dart::dynamics::BoxShape>(Eigen::Vector3d(0.1, 0.1, 1.0));
body->createShapeNodeWith<dart::dynamics::VisualAspect, dart::dynamics::CollisionAspect>(shape);
world->addSkeleton(skeleton);
return 0;
}
- Applying force to a body:
auto body = skeleton->getBodyNode("body_name");
Eigen::Vector3d force(0.0, 0.0, 10.0);
Eigen::Vector3d offset(0.1, 0.0, 0.0);
body->addExtForce(force, offset);
- Setting up a collision detector:
auto collisionDetector = dart::collision::FCLCollisionDetector::create();
world->getConstraintSolver()->setCollisionDetector(collisionDetector);
Getting Started
-
Install DART dependencies:
sudo apt-get install libeigen3-dev libassimp-dev libccd-dev libfcl-dev libboost-all-dev libopenscenegraph-dev -
Clone and build DART:
git clone https://github.com/dartsim/dart.git cd dart mkdir build && cd build cmake .. make -j4 sudo make install -
Include DART in your project's CMakeLists.txt:
find_package(DART REQUIRED) target_link_libraries(your_target dart)
Competitor Comparisons
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Pros of Bullet3
- Widely adopted in game development and robotics simulations
- Extensive documentation and community support
- Highly optimized for performance, especially in real-time applications
Cons of Bullet3
- Less focus on accuracy compared to DART
- More complex API, steeper learning curve for beginners
- Limited built-in support for articulated rigid body dynamics
Code Comparison
DART example (inverse kinematics):
InverseKinematics* ik = new InverseKinematics(bodyNode);
ik->addTargetTranslationalConstraint(bodyNode, desiredPosition);
ik->solve();
Bullet3 example (rigid body creation):
btCollisionShape* shape = new btSphereShape(1.0);
btDefaultMotionState* motionState = new btDefaultMotionState();
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, motionState, shape);
btRigidBody* body = new btRigidBody(rbInfo);
Both DART and Bullet3 are powerful physics engines, but they cater to different needs. DART excels in accuracy and articulated body simulations, while Bullet3 shines in performance-critical applications and game development. The choice between them depends on the specific requirements of your project.
Flexible Collision Library
Pros of FCL
- Specialized in collision detection and distance computation
- Supports a wide range of geometric primitives and collision algorithms
- Lightweight and can be easily integrated into other projects
Cons of FCL
- Limited to collision detection and distance computation
- Lacks built-in dynamics simulation capabilities
- May require additional libraries for complete robotics simulations
Code Comparison
FCL (collision detection):
fcl::CollisionObject<double> obj1(shape1);
fcl::CollisionObject<double> obj2(shape2);
fcl::CollisionRequest<double> request;
fcl::CollisionResult<double> result;
fcl::collide(&obj1, &obj2, request, result);
DART (physics simulation):
dart::dynamics::SkeletonPtr robot = dart::dynamics::Skeleton::create("robot");
dart::simulation::WorldPtr world = dart::simulation::World::create();
world->addSkeleton(robot);
world->step();
Summary
FCL is a specialized library for collision detection and distance computation, while DART is a more comprehensive dynamics and simulation toolkit. FCL excels in its focused functionality and can be easily integrated into other projects. DART, on the other hand, provides a full-featured environment for robotics simulation, including physics, kinematics, and collision detection. The choice between the two depends on the specific requirements of your project and whether you need a complete simulation framework or just collision detection capabilities.
Model-based design and verification for robotics.
Pros of Drake
- More comprehensive toolset for robotics simulation and control
- Stronger integration with optimization and planning algorithms
- Better support for multi-body dynamics and contact mechanics
Cons of Drake
- Steeper learning curve due to its complexity
- Heavier computational requirements for some simulations
- Less flexible for real-time applications compared to DART
Code Comparison
Drake example (Python):
import pydrake.all as drake
builder = drake.systems.DiagramBuilder()
plant, scene_graph = drake.multibody.plant.AddMultibodyPlantSceneGraph(builder, time_step=0.0)
parser = drake.multibody.parsing.Parser(plant)
parser.AddModelFromFile("model.urdf")
plant.Finalize()
DART example (C++):
#include <dart/dart.hpp>
auto world = std::make_shared<dart::simulation::World>();
auto skeleton = dart::dynamics::Skeleton::create("robot");
dart::utils::DartLoader loader;
skeleton = loader.parseSkeleton("model.urdf");
world->addSkeleton(skeleton);
Both libraries provide powerful tools for robotics simulation, but Drake offers a more comprehensive ecosystem for advanced robotics applications, while DART focuses on real-time performance and flexibility. Drake's integration with optimization tools makes it suitable for complex planning tasks, whereas DART's lightweight design allows for faster simulations in certain scenarios.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
DART
DART (Dynamic Animation and Robotics Toolkit) is an open-source, research-focused physics engine for robotics, animation, and machine learning. It provides transparent kinematics, dynamics, collision, and constraint-solving foundations for users who need more than a black-box simulator. DART uses generalized coordinates for articulated rigid body systems and Featherstone's Articulated Body Algorithm for accurate, stable motion dynamics.
[!IMPORTANT] Which DART is this? This
mainbranch tracks DART 7, an in-progress redesign that is not yet recommended for production use. Its documentation is thelatestsite.For a stable release, use DART 6 LTS: documentation ·
release-6.20branch.
Why DART?
- Research-grade dynamics â Featherstone algorithms, generalized coordinates, and direct access to dynamics quantities
- Easy to start â Python and C++ packages through common package managers, plus reproducible source builds with pixi
- Extensible foundations â Math, native collision, constraints, model loading, benchmarks, and tests that support new algorithms and baseline comparisons
- Unified model loading â Load URDF, SDF, and MJCF models through a single API
- Scalable compute roadmap â Cross-platform CPU support today, with roadmap work for multi-core, SIMD, and accelerator backends
- Battle-tested ecosystem â Powers Gazebo, research labs, and production systems worldwide, with best-effort support for production use
Quick Start
Python
import dartpy as dart
import numpy as np
world = dart.World(time_step=1.0 / 1000.0)
# Add a 1 kg rigid body one metre above the origin.
options = dart.RigidBodyOptions()
options.mass = 1.0
options.position = np.array([0.0, 0.0, 1.0])
box = world.add_rigid_body("box", options)
# Lock topology, then simulate 100 steps.
world.enter_simulation_mode()
for _ in range(100):
world.step()
print(f"t = {world.time:.3f} s, box z = {float(box.translation[2]):.3f} m")
C++
The DART 7 C++ simulation facade is available in source builds while the final
public header transaction is still in progress. Use the C++ API shape recorded
in docs/design/simulation_cpp_api.md
for current source-checkout examples; DART 6 C++ snippets remain on the
release-6.* branches for compatibility-line users.
Installation
The quick-start snippets above target the current main branch and DART 7 API.
The tracked DART 7 wheel lane builds CPython 3.14 wheels on Linux, macOS, and
Windows, but PyPI currently serves the stable DART 6 line as the latest
non-yanked dartpy package. Use the source checkout path for the DART 7 Python
facade until a non-yanked DART 7 wheel is published.
Python (Recommended)
| Method | Command |
|---|---|
| source checkout (DART 7 today) | pixi run build from this repository |
| uv/pip (DART 7 after wheel publish) | uv add dartpy --prerelease allow / pip install --pre dartpy |
| pixi (DART 6 stable today) | pixi add dartpy |
| conda (DART 6 stable today) | conda install -c conda-forge dartpy |
C++
| Platform | Command |
|---|---|
| Cross-platform (recommended) | pixi add dartsim-cpp or conda install -c conda-forge dartsim-cpp |
| Ubuntu | sudo apt install libdart-all-dev |
| Arch Linux | yay -S libdart |
| FreeBSD | pkg install dartsim |
| macOS | brew install dartsim |
| Windows | vcpkg install dartsim:x64-windows |
Current DART 7 Smoke Checks
These snippets create a tiny model in code, so they do not depend on sample data
files being present. The Python snippet targets a DART 7 source build; if
dart.World or add_rigid_body is missing, the environment resolved a stable
DART 6 package and should use the stable documentation.
Python source build
Run this after pixi run build from a source checkout:
PYTHONPATH=build/default/cpp/Release/python pixi run python - <<'PY'
import dartpy as dart
world = dart.World()
body = world.add_rigid_body("box", dart.RigidBodyOptions())
world.enter_simulation_mode()
world.step()
print(f"t = {world.time:.4f} s, box position = {body.translation}")
PY
C++ package
The published C++ package smoke for the compatibility line is maintained on
release-6.*. DART 7 C++ package smoke checks move through
check-dart7-artifacts and the local source-checkout promotion gates until
DART 7 C++ artifacts are published.
Source checkout
pixi install
# Smoke the Python-first DART 7 rigid-body demo surface.
pixi run py-demos -- --scene rigid_body --headless --frames 1
# Open the curated rigid-body GUI verifier.
pixi run py-demos
pixi run py-demos -- --scene rigid_solver_compare
# Capture docked visual evidence for the solver comparison.
pixi run py-demo-capture -- --scene rigid_solver_compare --frames 24 --width 960 --height 540 --show-ui
# Optional C++ World-only companion smoke.
pixi run demos -- --scene rigid_body --headless --frames 1
The full 36-row rigid-body visual verification workflow, Rigid Workflow
search terms, and capture commands are in the
Python demos README.
Documentation
- Static Docs: English | íêµì´
- AI Docs (experimental): DeepWiki for quick codebase Q&A | NotebookLM (Google account required)
- Questions: Ask in GitHub Discussions when you want maintainer or community input.
Developer Resources
- Developer Onboarding Guide â Architecture, components, and workflows
- Contributing Guide â Style guide and contribution process
- Project Direction â Research-focused north star and priorities
- Living Plans â Active and proposed roadmap items
- Background Theory â Dynamics, contact solving, and mathematical foundations
- Gazebo Integration â gz-physics integration workflow
- Release Roadmap â Compatibility, deprecations, and future plans
Branches
mainâ Active development targeting DART 7 (not yet production-ready)release-6.20â Maintenance branch for DART 6 LTS (critical fixes only); see the DART 6 documentation
Citation
If you use DART in an academic publication, please consider citing this JOSS Paper:
@article{Lee2018,
doi = {10.21105/joss.00500},
url = {https://doi.org/10.21105/joss.00500},
year = {2018},
publisher = {The Open Journal},
volume = {3},
number = {22},
pages = {500},
author = {Jeongseok Lee and Michael X. Grey and Sehoon Ha and Tobias Kunz and Sumit Jain and Yuting Ye and Siddhartha S. Srinivasa and Mike Stilman and C. Karen Liu},
title = {DART: Dynamic Animation and Robotics Toolkit},
journal = {Journal of Open Source Software}
}
License
DART is licensed under the BSD 2-Clause License.
Star History
Top Related Projects
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot