Skip to main content

MPlib2: a Lightweight Motion Planning Library

PyPI GitHub Release CI Python License Upstream MPlib

MPlib2 is an actively maintained standalone fork of MPlib — a lightweight Python motion planning library decoupled from ROS. It brings modern dependency compatibility (Python 3.10–3.14, NumPy 2, Pinocchio 3, Boost 1.88+, modern pybind11) and stability fixes while remaining a drop-in import mplib replacement for existing ManiSkill, SAPIEN, and MPlib codebases.

MPlib vs MPlib2

Upstream mplib (haosulab/MPlib) mplib2 (dd114/MPlib2)
PyPI package / import mplib / import mplib mplib2 / import mplib
Python & NumPy Python >= 3.8, legacy NumPy 1.x wheels Python >= 3.10, NumPy 1.26 & 2.x
C++ dependency stack Pinocchio 2, older Boost / vendored pybind11 Pinocchio 3 (>=3,<4), Boost 1.88+, pybind11 >= 2.13
Prebuilt wheels manylinux2014 (x86_64) manylinux_2_28 (x86_64, CPython 3.10–3.14)
Notable fixes — Read-only Pose.q, base-pose AttachedBody, OMPL/planner/IK/FCL fixes, scaled SAPIEN meshes

See CHANGELOG.md for the full list of behavior changes and fixes when migrating from upstream mplib.

Installation

Standard Pip Installation

The PyPI distribution name is mplib2, while the Python import module remains mplib:

pip install mplib2

Supported platforms: Prebuilt wheels are published for Linux x86_64 (manylinux_2_28, Python 3.10–3.14). On other platforms or Python versions, build from source using the instructions below.

Note (migrating from upstream mplib): Because mplib2 provides the mplib Python module as a drop-in replacement, it cannot coexist with upstream mplib in the same environment. Uninstall upstream mplib first to avoid package shadowing:

pip uninstall -y mplib && pip install mplib2

Building from Source & Editable Installation

Prerequisites

Building MPlib2 from source requires Python >= 3.10, a C++17 compiler (g++ or clang++), CMake (>= 3.12), Ninja, pybind11 (>= 2.13, required for NumPy 2 compatibility), and C++ dependency libraries:

  • Eigen3 (>= 3.4.0)
  • Pinocchio (>= 3.0, < 4.0)
  • FCL / Coal
  • OMPL (>= 1.5)
  • Boost (>= 1.70: filesystem; system linked conditionally if present)
  • Orocos-KDL
  • URDFDOM
  • Assimp

Pixi automatically installs required C++ libraries and Python toolchains (Python >= 3.10, < 3.15):

# Clone the repository
git clone https://github.com/dd114/MPlib2.git
cd MPlib2

# Install development environment and execute test suite
pixi run pytest tests

Option B: Editable Installation via Pip (Python 3.10–3.14)

Within an existing Conda or system environment providing the prerequisite C++ libraries:

# Install runtime Python dependencies
pip install "numpy>=1.26" "toppra>=0.6.3" "transforms3d>=0.3.1"

# Build C++ pybind11 extension in-place and install editable package
pip install -e . --no-build-isolation

Quickstart

This self-contained snippet works out of the box after pip install mplib2 using a minimal primitive-geometry 6-DoF arm URDF (no external mesh files required):

import tempfile
from pathlib import Path
import numpy as np
import mplib

# Minimal 6-DoF arm URDF + adjacent-link SRDF (primitive geometries only)
axes = ["0 0 1", "0 1 0", "0 1 0", "1 0 0", "0 1 0", "1 0 0"]
origins = ["0 0 0.1", "0 0 0.2", "0 0 0.3", "0 0 0.25", "0 0 0.15", "0 0 0.1"]
links = ['<link name="base_link"/>']
joints, srdf_pairs = [], []
for i, (origin, axis) in enumerate(zip(origins, axes), start=1):
    parent = "base_link" if i == 1 else f"link_{i - 1}"
    child = f"link_{i}"
    links.append(
        f'<link name="{child}"><collision><origin xyz="0 0 0.05"/>'
        f'<geometry><cylinder radius="0.03" length="0.1"/></geometry></collision></link>'
    )
    joints.append(
        f'<joint name="joint_{i}" type="revolute">'
        f'<parent link="{parent}"/><child link="{child}"/>'
        f'<origin xyz="{origin}"/><axis xyz="{axis}"/>'
        f'<limit lower="-3.14" upper="3.14" effort="100" velocity="2"/></joint>'
    )
    srdf_pairs.append(
        f'<disable_collisions link1="{parent}" link2="{child}" reason="Adjacent"/>'
    )

with tempfile.TemporaryDirectory() as tmp:
    urdf, srdf = Path(tmp) / "arm.urdf", Path(tmp) / "arm.srdf"
    urdf.write_text('<robot name="arm">' + "".join(links + joints) + "</robot>")
    srdf.write_text('<robot name="arm">' + "".join(srdf_pairs) + "</robot>")

    planner = mplib.Planner(urdf=urdf, srdf=srdf, move_group="link_6")

    # Forward Kinematics: compute current end-effector pose
    start_qpos = np.array([0.0, 0.4, -0.8, 0.0, 0.5, 0.0])
    planner.robot.set_qpos(start_qpos, full=True)
    planner.pinocchio_model.compute_forward_kinematics(start_qpos)
    target_pose = planner.pinocchio_model.get_link_pose(planner.link_name_2_idx["link_6"])

    # Inverse Kinematics & Motion Planning
    target_pose.p[0] += 0.1  # Translate 10 cm in X
    status, ik_qpos = planner.IK(target_pose, start_qpos, return_closest=True)
    result = planner.plan_pose(target_pose, start_qpos)

    print(f"IK: {status}, Plan: {result['status']}")
    if result["status"] == "Success":
        print(f"Duration: {result['duration']:.2f} s, Waypoints: {len(result['position'])}")

Example with a Full Robot Model (Franka Panda)

If you have cloned this repository (which includes the Franka Panda URDF, SRDF, and meshes under data/panda/ — not bundled in the PyPI wheel), you can load it directly:

import numpy as np
import mplib

# Initialize planner for Franka Emika Panda arm
planner = mplib.Planner(
    urdf="data/panda/panda.urdf",
    srdf="data/panda/panda.srdf",
    move_group="panda_hand",
)

# Set initial joint configuration (7 arm joints + 2 gripper fingers)
start_qpos = np.array([0.0, 0.2, 0.0, -2.6, 0.0, 2.9, 0.8, 0.02, 0.02])
planner.robot.set_qpos(start_qpos, full=True)

# Forward Kinematics: compute end-effector pose
planner.pinocchio_model.compute_forward_kinematics(start_qpos)
ee_idx = planner.link_name_2_idx["panda_hand"]
target_pose = planner.pinocchio_model.get_link_pose(ee_idx)

# Inverse Kinematics: solve for joint angles matching target pose
status, ik_qpos = planner.IK(target_pose, start_qpos, return_closest=True)
if status == "Success":
    print("IK Solution found:", ik_qpos[:7])

# Motion Planning: plan collision-free trajectory to target pose
target_pose.p[0] += 0.1  # Translate 10 cm in X
result = planner.plan_pose(target_pose, start_qpos)

if result["status"] == "Success":
    print(f"Planned trajectory duration: {result['duration']:.2f} s")
    print(f"Waypoints: {len(result['position'])}")

Documentation, Contributing & Attribution

Metadata

Release files for mplib2 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mplib2 0.3.1
File Size Uploaded Provenance Actions
mplib2-0.3.1.tar.gz 131.3 kB With provenance Details for mplib2-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mplib2 0.3.1
File Actions
mplib2-0.3.1-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for mplib2-0.3.1-cp314-cp314-manylinux_2_28_x86_64.whl
mplib2-0.3.1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for mplib2-0.3.1-cp313-cp313-manylinux_2_28_x86_64.whl
mplib2-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for mplib2-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl
mplib2-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for mplib2-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl
mplib2-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for mplib2-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl

Total release size: 74.7 MB

Release files / mplib2-0.3.1.tar.gz

Download URL mplib2-0.3.1.tar.gz
Size 131.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9000f3673b05dde4d1f49a9fde4301ab85ff2c97cfc0fd40c84d7b77c5eb6fea
BLAKE2b-256 checksum
How to use checksums
475c0939f42b36b90a87d46ff1e8c0cc0f61c07ced07f5f8b76ef9d786727364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mplib2-0.3.1-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL mplib2-0.3.1-cp314-cp314-manylinux_2_28_x86_64.whl
Size 14.9 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5cf569446f1e1a1c90a5f73c19b0d5f5f97665d58f68e394cbaa501261465247
BLAKE2b-256 checksum
How to use checksums
2b6c5f804ebd7bfb22bdcc96647d3c541d6e21523a10336929477e9655e11a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mplib2-0.3.1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL mplib2-0.3.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 14.9 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1de275f6ccbcea82b6eca42b4978f5db5bd0269ab62b550fdb5d2296e501a0e5
BLAKE2b-256 checksum
How to use checksums
1d2b51355899defb60340240be1947d5e6f6a64f4e2b5a15cc83a604e6f14591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mplib2-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL mplib2-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 14.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
04084e13f6a1fedfc9380baccbba79ce4d300234fd811d1ec7b5a471eb727db0
BLAKE2b-256 checksum
How to use checksums
087aa1413f8c5377f1675265dd8fe73245b08840edc5d514d80a81a803a1481c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mplib2-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL mplib2-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 14.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0984b89a11e0a29678fa6b35b4f433c67acbe0c72b24686049727f3893f066c2
BLAKE2b-256 checksum
How to use checksums
792f0144bf5526c1a2454d45480c408983fb3720b50fb52ecbbbfe95db915a45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / mplib2-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL mplib2-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 14.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6fb504000ec7073d793ed5dc92bd37cc42fa2a0386fcff7334864e731333db7f
BLAKE2b-256 checksum
How to use checksums
de654a3f513daf0775df4fdaec11921a280602e529f5e863bfeffc6c42e35570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for mplib2 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for mplib2-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page