Skip to main content

OMPL Python Bindings

How to use Python binding

The Python bindings mirror OMPL’s C++ API. For detailed usage, refer to:

How is Nanobind organized?

We use Nanobind to generate Python bindings for OMPL. For every OMPL header, there is a corresponding binding file in the bindings/ directory, organized into subfolders that mirror OMPL’s module structure. For example, all bindings for ompl::base live under bindings/base. The Nanobind documentation provides a comprehensive guide to writing bindings. The one thing to watch out for is overriding C++ virtual methods in Python. You need a trampoline class to forward calls correctly.

How to contribute to the bindings

Adding new bindings

General Instructions

The bindings/ directory mimics the layout of the src/ompl/ directory. If there is a new header file in src/ompl/ in the future release, you can add a new binding file in the corresponding subdirectory under bindings/. The binding file should have the same name as the header file, with a .cpp extension. If you add a new header file src/ompl/MODULE/SUBFOLERPATH/NEWFEATURE.h, you should create a binding file bindings/MODULE/SUBFOLERPATH/NEWFEATURE.cpp. Here are some examples:

src/ompl/base/StateSpace.h -> bindings/base/StateSpace.cpp
src/ompl/geometric/planners/rrt/RRT.h -> bindings/geometric/planners/rrt/RRT.cpp
src/ompl/control/spaces/RealVectorControlSpace.h -> bindings/control/spaces/RealVectorControlSpace.cpp

Then, in the bindings/MODULE/SUBFOLERPATH/NEWFEATURE.cpp, you should include the header file and use Nanobind to create the bindings. Here is a minimal example:

Step 1: In the bindings/MODULE/SUBFOLERPATH/NEWFEATURE.cpp, include the necessary headers and namespaces:

#include <nanobind/nanobind.h>
#include "ompl/MODULE/SUBFOLERPATH/NEWFEATURE.h"
#include "init.h" // or "../init.h", depending on the SUBFOLDERPATH

namespace nb = nanobind;

// Necessary namespaces
// namespace ob = ompl::base;
// namespace og = ompl::geometric;
// namespace oc = ompl::control;

Step 2: Continue in the bindings/MODULE/SUBFOLERPATH/NEWFEATURE.cpp, define the binding function. The function name should follow the pattern void ompl::binding::MODEULE::initSUBFOLERPATH_NEWFEATURE(nb::module_ &m). For example:

// In bindings/base/StateSpace.cpp:
void ompl::binding::base::init_StateSpace(nb::module_& m){...}

// In bindings/geometric/planners/rrt/RRT.cpp:
void ompl::binding::geometric::initPlannersRrt_RRT(nb::module_ &m){...}

// In bindings/control/spaces/RealVectorControlSpace.cpp:
void ompl::binding::control::initSpaces_RealVectorControlSpace(nb::module_ &m){...}

Step 3: Continue in the bindings/MODULE/SUBFOLERPATH/NEWFEATURE.cpp, implement the binding functions.

Step 4: In the bindings/MODULE/init.h, register the new binding function. Then, in bindings/python.cpp include the binding function. If the MODULE is base, leave the function under nb::module_ base = m.def_submodule("base");. Notice that the nanobind compile function in sequencial order, so if you new binding function depends on other binding functions, make sure to include your new binding function after the dependent binding functions. Otherwise you will get the example error Critical nanobind error: nanobind::detail::nb_type_new("EIRMstar"): base type "ompl::geometric::EITstar" not known to nanobind!.

Binding "OMPL::Magic" constants

bindings/base/spaces/constraint/AtlasStateSpace.cpp

m.attr("ATLAS_STATE_SPACE_SAMPLES") = nb::cast(ompl::magic::ATLAS_STATE_SPACE_SAMPLES);
m.attr("ATLAS_STATE_SPACE_EPSILON") = nb::cast(0.05);
m.attr("ATLAS_STATE_SPACE_RHO_MULTIPLIER") = nb::cast(5);
m.attr("ATLAS_STATE_SPACE_ALPHA") = nb::cast(boost::math::constants::pi<double>() / 8.0);
m.attr("ATLAS_STATE_SPACE_EXPLORATION") = nb::cast(0.75);
m.attr("ATLAS_STATE_SPACE_MAX_CHARTS_PER_EXTENSION") = nb::cast(200);
m.attr("ATLAS_STATE_SPACE_BACKOFF") = nb::cast(0.75);

Note on ARM platforms

Generating bindings on ARM platforms (e.g., Apple M-series) can sometimes fail due to compiler/linker incompatibilities. To work around this:

  • Use gcc when building the OMPL bindings.
  • If you run into Boost-related linker errors, download and build Boost from source with gcc as well.

Metadata

Release files for ompl 2.0.1

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

Built distributions (wheels)

Table of built distributions (wheels) for ompl 2.0.1
File
ompl-2.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
ompl-2.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
ompl-2.0.1-cp313-cp313-macosx_15_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 15.0+ x86-64 Details
ompl-2.0.1-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details
ompl-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
ompl-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
ompl-2.0.1-cp312-cp312-macosx_15_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 15.0+ x86-64 Details
ompl-2.0.1-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details
ompl-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
ompl-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
ompl-2.0.1-cp311-cp311-macosx_15_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 15.0+ x86-64 Details
ompl-2.0.1-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details
ompl-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
ompl-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details
ompl-2.0.1-cp310-cp310-macosx_15_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 15.0+ x86-64 Details
ompl-2.0.1-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details

Total release size: 57.3 MB

Release files / ompl-2.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ompl-2.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.6 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a740777f1959f3ae858d397ed1557b5a01729219f8261b0455654664f9161cd8
BLAKE2b-256 checksum
How to use checksums
28dba9ce66a982b22f597077cef79de41e2ef5107500e3860035a8e903d02147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ompl-2.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.4 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
90d417436d91b139022f068d11bdd2e874dbb8467778b6c007bb4f0282b049ee
BLAKE2b-256 checksum
How to use checksums
28ede9f8ac1b0be200946af715e0d4a6bb076a82ff89177588934117346d99cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp313-cp313-macosx_15_0_x86_64.whl

Download URL ompl-2.0.1-cp313-cp313-macosx_15_0_x86_64.whl
Size 3.1 MB
Tags CPython 3.13 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
2b457ae068fd505ff990cc363a0e0d2739ed5aa1d3dc0c553b7b24ab0b1b4ff1
BLAKE2b-256 checksum
How to use checksums
b84a786f85bdc33d9ea8bfae79e9d387bf9bba787c70575f98fb49c89544e470
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp313-cp313-macosx_15_0_arm64.whl

Download URL ompl-2.0.1-cp313-cp313-macosx_15_0_arm64.whl
Size 2.3 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
953662c5b109d25c05a44d7fa3ebaf51f34be4545b77c378c76d8b80d9a54ce2
BLAKE2b-256 checksum
How to use checksums
1e2762aababae4b5c16f735997cff15425e8e368948aa2159d7285f82c372e42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ompl-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.6 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3792acfda54e2c5a9462d92272863823c1ef6e781258341a470a198a186e5d47
BLAKE2b-256 checksum
How to use checksums
ae6ecfbe93750730a2e3268bfec9214cf7b6ce4488c306c6591fd6afecf0c027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ompl-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.4 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
23a0df9b698cfc310b99e06a37fca42e28d9ffb4be0a99acde5dc2968f0235d0
BLAKE2b-256 checksum
How to use checksums
eec08115e7c09adfed6fac18f05746c603b38a76a69fee7421b70c9a568b37d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp312-cp312-macosx_15_0_x86_64.whl

Download URL ompl-2.0.1-cp312-cp312-macosx_15_0_x86_64.whl
Size 3.1 MB
Tags CPython 3.12 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
f0a885358e37f3e34b06584ea9e83cdb000cbf3de889a0c456ad234e5e70c0c4
BLAKE2b-256 checksum
How to use checksums
cb164d9449532f03532b1b0b12756ff690518e3171ae6a8cbc36c26e46e59e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp312-cp312-macosx_15_0_arm64.whl

Download URL ompl-2.0.1-cp312-cp312-macosx_15_0_arm64.whl
Size 2.3 MB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
ccfc22cb870986b4720c9f722dadc03c9532ed40655662e8ca02fb6afc1991cb
BLAKE2b-256 checksum
How to use checksums
18313a26c1371b5de82778914ca05ff1dbd24e5b38cbd110decb9c7dbb4d0958
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ompl-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
89ed2a4b317089480916722690d2055a9fe8489f384e7c89e671ab54dd4240f5
BLAKE2b-256 checksum
How to use checksums
d3d4308e600af375b4120544ec8fdb7fb3a4e77bca1101b4fb97982d5182fe71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ompl-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
52f44b44a6a3f1015813aa83f9de45d8bfe1988e55e1c807b8661a32ae8177c4
BLAKE2b-256 checksum
How to use checksums
5709829fce3c265b1905bc4b11e747a39cf600f994ffcca019bb1e686f403112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp311-cp311-macosx_15_0_x86_64.whl

Download URL ompl-2.0.1-cp311-cp311-macosx_15_0_x86_64.whl
Size 3.1 MB
Tags CPython 3.11 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
63d7ebae49f64743e0d4326fd92a833205a57159d492d7b49ef49ea6e1d02847
BLAKE2b-256 checksum
How to use checksums
81d38822e72b23ee33192bef245a0c7b716e4ccd26212fc4ebea68a7cd22e893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp311-cp311-macosx_15_0_arm64.whl

Download URL ompl-2.0.1-cp311-cp311-macosx_15_0_arm64.whl
Size 2.3 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
0d13a62b0b45cd2c60c70b7ecd6b45c23432f404ec44b2dc99ff0fb3386ef9c7
BLAKE2b-256 checksum
How to use checksums
b9a29c08e4699fd69bd24d4838d0000c51a0efaa1b44be8a7b347bd9a85b092e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ompl-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
346665d130ef5c2bbd80686aed3fbbd9a4d1097d0f0fd92924aafbdc0497742d
BLAKE2b-256 checksum
How to use checksums
39c579e0f7b9b558c2402ff6b7bd86386f8341ab4e760fc990287fc921923701
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ompl-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
980aa5db9d1a05514b9bdd5f65eafa98ed16c84e4528ab943427efe324a42e94
BLAKE2b-256 checksum
How to use checksums
5aa848291fe5dd3f3c56929b447d42410019bb3beca1d9bbe238ad8a95b8508f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp310-cp310-macosx_15_0_x86_64.whl

Download URL ompl-2.0.1-cp310-cp310-macosx_15_0_x86_64.whl
Size 3.1 MB
Tags CPython 3.10 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
52a4157b94a5480fe2d85b2b8bbe7b23812b1c4aa53e26068a46bf70d38f5aaa
BLAKE2b-256 checksum
How to use checksums
b24a69bc9e652a2d0d5fe80dccbed3025448b5953891d8efcb43b8dc5ecc3bc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / ompl-2.0.1-cp310-cp310-macosx_15_0_arm64.whl

Download URL ompl-2.0.1-cp310-cp310-macosx_15_0_arm64.whl
Size 2.3 MB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
7a4a85dce6233e067756e6dfcddf85780e25823dca556a34a5b24b5818c67fb7
BLAKE2b-256 checksum
How to use checksums
a09c9438d7f00ef8d0d529c11cba3d42af4176e72a9ec0df77a97c400625b817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

2.0.1 This release

16 release files

1.7.0

12 release files

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