Skip to main content

Library for creating smooth cubic splines

Project description

NDCurves

Pipeline status Coverage report PyPI version Code style: black Ruff pre-commit.ci status

A template-based Library for creating curves of arbitrary order and dimension, eventually subject to derivative constraints. The main use of the library is the creation of end-effector trajectories for legged robots.

To do so, tools are provided to:

  • create exact splines of arbitrary order (that pass exactly by an arbitrary number waypoints)
  • constrain initial / end velocities and acceleration for the spline.
  • constrain take-off and landing phases to follow a straight line along a given normal (to avoid undesired collisions between the effector and the contact surface)
  • automatically handle 3d rotation of the effector.
  • create curves in SO3
  • support partial symbolic differentiation of curves. You can represent control points as linear variables, and integrate / differentiate those variable curves. You can also compute the cross product of two curves, which is relevant for centroidal dynamics.

Several type of formulation are provided:

  • Polynomials
  • Bezier
  • Hermite (only cubic hermite for now)

The library is template-based, thus generic: the curves can be of any dimension, and can be implemented in double or float and can work with kind variables like Vector, Transform, Matrix, ...

Installation

Installation through robotpkg

You can install this package through robotpkg. robotpkg is a package manager tailored for robotics softwares. It greatly simplifies the release of new versions along with the management of their dependencies. You just need to add the robotpkg apt repository to your sources.list and then use sudo apt install robotpkg-py3\*-ndcurves.

If you have never added robotpkg as a softwares repository, please follow first the instructions from 1 to 3; otherwise, go directly to instruction 4. Those instructions are similar to the installation procedures presented in http://robotpkg.openrobots.org/debian.html.

  1. Add robotpkg as source repository to apt:
sudo tee /etc/apt/sources.list.d/robotpkg.list <<EOF
deb [arch=amd64] http://robotpkg.openrobots.org/wip/packages/debian/pub $(lsb_release -sc) robotpkg
deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg
EOF
  1. Register the authentication certificate of robotpkg:
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
  1. You need to run at least once apt update to fetch the package descriptions:
sudo apt-get update
  1. The installation of nd-curves:
sudo apt install robotpkg-py3\*-ndcurves # for Python 3

sudo apt install robotpkg-py27-ndcurves # for Python 2

Finally you will need to configure your environment variables, e.g.:

export PATH=/opt/openrobots/bin:$PATH
export PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/opt/openrobots/lib/python2.7/site-packages:$PYTHONPATH

Installation from source

Dependencies

Additional dependencies for python bindings

To handle this with cmake, use the recursive option to clone the repository. For instance, using http:

git clone --recursive https://github.com/loco-3d/ndcurves $NDCURVES_DIR

Where $NDCURVES_DIR is to be replaced to your selected source folder. The library is header only, so the build only serves to build the tests and python bindings:

cd $NDCURVES_DIR && mkdir build && cd build
cmake -DBUILD_PYTHON_INTERFACE=ON .. && make && make test

Switch the BUILD_PYTHON argument to OFF if you don't want to use the python bindings of the package.

If everything went fine you should obtain the following output:

100% tests passed, 0 tests failed out of 3

Optional: Python bindings installation

To install the Python bindings first enable the BUILD_PYTHON_INTERFACE option:

cmake -DBUILD_PYTHON_INTERFACE=ON ..

Then rebuild the library:

cd ${NDCURVES_DIR}/build
make && make test

To see example of use, you can refer to the test file which is rather self explanatory:

In spite of an exhaustive documentation, please refer to the C++ documentation, which mostly applies to python.

Documentation and tutorial

For the C++ / Python detailed documentation, you can consult this pdf available in the doc folder

For a python tutorial, you can refer to the jupyter notebook. The test file is more exhaustive and rather self explanatory.

Citation

If you wish to cite this work please use the bibtex below:

@software{ndcurves,
  author = {Tonneau, Steve and Chemin, Jason and Fernbach, Pierre and Saurel, Guilhem},
  title = {ndcurves},
  url = {https://github.com/loco-3d/ndcurves},
  year = {2013}
}

Project details


Download files

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

Source Distribution

libndcurves-2.1.0.tar.gz (7.3 MB view details)

Uploaded Source

Built Distributions

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

libndcurves-2.1.0-0-py3-none-manylinux_2_28_x86_64.whl (92.3 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

libndcurves-2.1.0-0-py3-none-manylinux_2_28_aarch64.whl (92.3 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

libndcurves-2.1.0-0-py3-none-macosx_11_0_arm64.whl (92.2 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

libndcurves-2.1.0-0-py3-none-macosx_10_9_x86_64.whl (92.2 kB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file libndcurves-2.1.0.tar.gz.

File metadata

  • Download URL: libndcurves-2.1.0.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for libndcurves-2.1.0.tar.gz
Algorithm Hash digest
SHA256 22f8f953dec5ec899b81b1adb006051a534bcac9a406aa6aa7e910dbf038106a
MD5 403d586e9339c4acb1df513a9ee4c53a
BLAKE2b-256 bac826f9eb3520e2c886fc017b5b6e6a41c5be4299a1b5eb53a10c412f21dd0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for libndcurves-2.1.0.tar.gz:

Publisher: release.yml on cmake-wheel/libndcurves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libndcurves-2.1.0-0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libndcurves-2.1.0-0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 623984990dffbf574cbf0d3b37d9659d04435bc72bb83468d26a5ea3644ca6cc
MD5 c2ff8214c0858a375f04641499cccf53
BLAKE2b-256 8fe5789220838ec4b556e7231d6da69043dca646a0934ce6587ad16b2ffb23b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for libndcurves-2.1.0-0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on cmake-wheel/libndcurves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libndcurves-2.1.0-0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for libndcurves-2.1.0-0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 675609716e4b6b9919743acb08d4174568a9acd9eddff1fdea0641491d5b14e6
MD5 7d1a8de90e3a700bd3bf2cb51bcf0edd
BLAKE2b-256 c1ea462543c48d431bb207c2d047afccbfdfbfded33236337a406ac7d54473e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for libndcurves-2.1.0-0-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on cmake-wheel/libndcurves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libndcurves-2.1.0-0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libndcurves-2.1.0-0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e87e863f06583a48b802f77557307360e65e5cffcc1a96e7f2ad458eb17a051f
MD5 642210ecf604a1488fcdd8d37a39947e
BLAKE2b-256 f627f2e83d5b81241df815beb0a1c95acf51c161fdd23acc750b5a071362f3a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for libndcurves-2.1.0-0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on cmake-wheel/libndcurves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libndcurves-2.1.0-0-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for libndcurves-2.1.0-0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 313e7fbda3487de9fbffad40db9e64ea6bccc21c73bd5329b4887e5cf659a0da
MD5 3a5c995c74e4e37c312d92b290eeae70
BLAKE2b-256 da7c9e45d19c425fcee821b999bead50adffb9ba17282cb986bc9e6bd7cd48b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for libndcurves-2.1.0-0-py3-none-macosx_10_9_x86_64.whl:

Publisher: release.yml on cmake-wheel/libndcurves

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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