Skip to main content

Python utilities for estimating and transforming rigid body motion.

Project description

https://img.shields.io/travis/com/phausamann/rigid-body-motion.svg Documentation Status https://img.shields.io/pypi/v/rigid-body-motion.svg https://img.shields.io/badge/code%20style-black-000000.svg

rigid-body-motion

Python utilities for estimating and transforming rigid body motion.

Documentation: https://rigid-body-motion.readthedocs.io

Overview

This package provides a high-level interface for transforming arrays describing motion of rigid bodies between different coordinate systems and reference frames. The core of the reference frame handling is a fast re-implementation of ROS’s tf2 library using numpy and numpy-quaternion. The package also provides first-class support for xarray data types.

Installation

rigid-body-motion can be installed via pip:

$ pip install rigid-body-motion

or via conda:

$ conda install -c phausamann -c conda-forge rigid-body-motion

Examples

Transform numpy arrays between coordinate systems:

import numpy as np
import rigid_body_motion as rbm

arr_cart = np.ones((10, 2))
arr_polar = rbm.transform_coordinates(arr_cart, outof="cartesian", into="polar")

Transform numpy arrays across a tree of reference frames:

import numpy as np
import rigid_body_motion as rbm

rbm.register_frame("world")
rbm.register_frame("child", parent="world", translation=(1., 0., 0.))
rbm.register_frame("child2", parent="world", translation=(-1., 0., 0.))

arr_child = np.ones((10, 3))
arr_child2 = rbm.transform_points(arr_child, outof="child", into="child2")

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.4.0 (February 11th, 2021)

New features

  • New lookup_linear_velocity and lookup_angular_velocity top-level methods.

  • New render_tree top-level method for printing out a graphical representation of a reference frame tree.

  • lookup_twist now accepts a mode parameter to specify the mode for angular velocity calculation.

Bug fixes & improvements

  • Fixed a bug where estimated angular velocity was all NaN when orientation contained NaNs.

0.3.0 (December 8th, 2020)

New features

  • Reference frames with timestamps now accept the discrete parameter, allowing for transformations to be fixed from their timestamp into the future.

  • rbm accessor for DataArrays implementing qinterp and qinv methods.

  • New best_fit_rotation and qinterp top-level methods.

Bug fixes & improvements

  • Refactor of internal timestamp matching mechanism defining a clear priority for target timestamps. This can result in slight changes of timestamps and arrays returned by transformations but will generally produce more accurate results.

  • Added mode and outlier_thresh arguments to estimate_angular_velocity.

  • Fixed issues with iterative_closest_point.

0.2.0 (October 22nd, 2020)

New features

  • New estimate_linear_velocity and estimate_angular_velocity top-level methods.

  • New qmul top-level method for multiplying quaternions.

0.1.2 (October 7th, 2020)

Improvements

  • Use SQUAD instead of linear interpolation for quaternions.

0.1.1 (September 17th, 2020)

Bug fixes

  • Fix transformations failing for DataArrays with non-numeric coords.

0.1.0 (September 17th, 2020)

  • First release

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

rigid-body-motion-0.4.0.tar.gz (3.9 MB view hashes)

Uploaded Source

Supported by

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