|
Mujoco KDL Wrapper
0.5.1
MuJoCo + KDL bridge for robot kinematics and dynamics
|
MuJoCo physics with Orocos KDL kinematics and dynamics, in C++ and Python.
![]() ex_gravity_comp — Single arm, KDL gravity compensation |
Ubuntu/Debian, CMake >= 3.16, a C++20 compiler and, for Python, Python >= 3.10. MuJoCo 3.14.0 is downloaded by the build; the secorolab Orocos KDL fork is built from source (mj_kdl_wrapper.repos) and the system KDL is never used.
main only advances at releases, so a plain clone is the latest release; --branch vX.Y.Z pins an older one. vcstool is also on PyPI; ROS apt sources name it python3-vcstool.
C++
Python
The wheel bundles the KDL fork, PyKDL, the MuJoCo plugins and the assets/ models; MuJoCo itself comes from the pinned mujoco pip package.
ROS 2 (colcon), Jazzy or Lyrical, with KDL as its own package so the overlay shares one liborocos-kdl:
The standalone and ROS 2 guides cover tests, editable Python installs, a custom MuJoCo or KDL, sharing one KDL across projects and every CMake option.
The bundled models ship in the repo and the wheel. C++ examples and tests load them from the source assets/ (mj_kdl_examples::asset(...)), Python from the installed package (mj_kdl_wrapper.ASSETS_DIR / "..."), and cmake --install copies them into ~/.cache/mj_kdl_wrapper/assets for programs that know neither.
| Path | Description |
|---|---|
| assets/kinova_gen3/gen3.xml | Kinova Gen3; MuJoCo Menagerie's model plus a base_link/shoulder_link contact exclusion and Kinova's joint armature |
| assets/robotiq_2f85/2f85.xml | Robotiq 2F-85; ctrl is the driver joint angle, 0 (open) to 0.82 rad (closed). Use tool_body = "g_base_mount" (with prefix g_): the mount carries mass too |
| assets/ft_sensor.xml | 6-axis force-torque sensor |
| assets/table.xml | Table with an authored table_top site |
| assets/mug.xml, assets/mug_table.xml | Pouring example |
| assets/cabinet/cabinet.xml | Three-drawer cabinet |
| assets/cube.xml | Free cube |
| assets/door_latch/door_latch.xml | Latched cupboard door (not used by the examples or tests) |
Any other MJCF, e.g. from MuJoCo Menagerie, loads through RobotSpec.path; a model that brings its own floor needs add_floor = false.
Each example exists in C++ (src/examples/) and Python (python/mj_kdl_wrapper/examples/) and ends by itself; the C++ ones open the viewer unless given --headless, the Python ones run headless unless given --gui. The catalog is in docs/examples.md.