Skip to main content

The Open Motion Planning Library

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ompl-2.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ompl-2.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

ompl-2.0.1-cp313-cp313-macosx_15_0_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

ompl-2.0.1-cp313-cp313-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

ompl-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ompl-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

ompl-2.0.1-cp312-cp312-macosx_15_0_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

ompl-2.0.1-cp312-cp312-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

ompl-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ompl-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

ompl-2.0.1-cp311-cp311-macosx_15_0_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

ompl-2.0.1-cp311-cp311-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

ompl-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ompl-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

ompl-2.0.1-cp310-cp310-macosx_15_0_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

ompl-2.0.1-cp310-cp310-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file ompl-2.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a740777f1959f3ae858d397ed1557b5a01729219f8261b0455654664f9161cd8
MD5 41a2fa7e1524e9b540f603ee43b754b8
BLAKE2b-256 28dba9ce66a982b22f597077cef79de41e2ef5107500e3860035a8e903d02147

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 90d417436d91b139022f068d11bdd2e874dbb8467778b6c007bb4f0282b049ee
MD5 6719b39701450727c2eb46a11e689956
BLAKE2b-256 28ede9f8ac1b0be200946af715e0d4a6bb076a82ff89177588934117346d99cf

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 2b457ae068fd505ff990cc363a0e0d2739ed5aa1d3dc0c553b7b24ab0b1b4ff1
MD5 138588e9e56ac06195419306072d5555
BLAKE2b-256 b84a786f85bdc33d9ea8bfae79e9d387bf9bba787c70575f98fb49c89544e470

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 953662c5b109d25c05a44d7fa3ebaf51f34be4545b77c378c76d8b80d9a54ce2
MD5 6146006020d706564a1ef69e538d0850
BLAKE2b-256 1e2762aababae4b5c16f735997cff15425e8e368948aa2159d7285f82c372e42

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3792acfda54e2c5a9462d92272863823c1ef6e781258341a470a198a186e5d47
MD5 44897b07997fb68d7f080e7a9abf75be
BLAKE2b-256 ae6ecfbe93750730a2e3268bfec9214cf7b6ce4488c306c6591fd6afecf0c027

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 23a0df9b698cfc310b99e06a37fca42e28d9ffb4be0a99acde5dc2968f0235d0
MD5 181a524d88350f0ad6d44a4238d758b9
BLAKE2b-256 eec08115e7c09adfed6fac18f05746c603b38a76a69fee7421b70c9a568b37d8

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f0a885358e37f3e34b06584ea9e83cdb000cbf3de889a0c456ad234e5e70c0c4
MD5 9d39e9e44c6364ececef45dac3292d2a
BLAKE2b-256 cb164d9449532f03532b1b0b12756ff690518e3171ae6a8cbc36c26e46e59e5c

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ccfc22cb870986b4720c9f722dadc03c9532ed40655662e8ca02fb6afc1991cb
MD5 53dda28bf041cc6c274e8812c35058f2
BLAKE2b-256 18313a26c1371b5de82778914ca05ff1dbd24e5b38cbd110decb9c7dbb4d0958

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89ed2a4b317089480916722690d2055a9fe8489f384e7c89e671ab54dd4240f5
MD5 e5387729d94a6205b93b9f001fb1b892
BLAKE2b-256 d3d4308e600af375b4120544ec8fdb7fb3a4e77bca1101b4fb97982d5182fe71

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 52f44b44a6a3f1015813aa83f9de45d8bfe1988e55e1c807b8661a32ae8177c4
MD5 dd8a1ed1e90816d399076ffbc3fad62c
BLAKE2b-256 5709829fce3c265b1905bc4b11e747a39cf600f994ffcca019bb1e686f403112

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 63d7ebae49f64743e0d4326fd92a833205a57159d492d7b49ef49ea6e1d02847
MD5 fb40b0e7049d19118876d9c86dc8e7d2
BLAKE2b-256 81d38822e72b23ee33192bef245a0c7b716e4ccd26212fc4ebea68a7cd22e893

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0d13a62b0b45cd2c60c70b7ecd6b45c23432f404ec44b2dc99ff0fb3386ef9c7
MD5 6f65dbbbf60c057a6fcc0b21714a30bb
BLAKE2b-256 b9a29c08e4699fd69bd24d4838d0000c51a0efaa1b44be8a7b347bd9a85b092e

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 346665d130ef5c2bbd80686aed3fbbd9a4d1097d0f0fd92924aafbdc0497742d
MD5 b5218fcb685164c00a63e98365551011
BLAKE2b-256 39c579e0f7b9b558c2402ff6b7bd86386f8341ab4e760fc990287fc921923701

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 980aa5db9d1a05514b9bdd5f65eafa98ed16c84e4528ab943427efe324a42e94
MD5 57fa9de1ee90a2ea20a29919ac06dd5f
BLAKE2b-256 5aa848291fe5dd3f3c56929b447d42410019bb3beca1d9bbe238ad8a95b8508f

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 52a4157b94a5480fe2d85b2b8bbe7b23812b1c4aa53e26068a46bf70d38f5aaa
MD5 cd144a9c55d864971901d62be65c28e8
BLAKE2b-256 b24a69bc9e652a2d0d5fe80dccbed3025448b5953891d8efcb43b8dc5ecc3bc1

See more details on using hashes here.

File details

Details for the file ompl-2.0.1-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for ompl-2.0.1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7a4a85dce6233e067756e6dfcddf85780e25823dca556a34a5b24b5818c67fb7
MD5 8fa75aae14f7b7a97409b79e8c2a8d86
BLAKE2b-256 a09c9438d7f00ef8d0d529c11cba3d42af4176e72a9ec0df77a97c400625b817

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page