Skip to main content

Library for rigid-body transformations, including velocities and forces.

Project description

Transformations

Forked version of the DeepMind Robotics transformations library which makes the JAX dependency optional, for lighterweight setups.

Transformations is a pure Python library for rigid-body transformations including velocities and forces.

The objectives for this library are simplicity and comprehensiveness across all canonical representations (euler, axis-angle, quaternion, homogeneous matrices).

Supported conversions

  • Quaternion to Rotation matrix, Axis-angle and Euler-angle
  • Axis-angle to Quaternion, Rotation matrix and Euler-angle
  • Rotation matrix to Quaternion, Axis-angle and Euler-angle
  • Euler-angle to Quaternion, Rotation matrix and Axis-angle

Quaternions

Quaternions are represented with the scalar part (w) first, e.g.

identity_quaternion = np.asarray([1, 0, 0, 0])  # w, i, j, k

Supported quaternion operations:

  • Difference
  • Distance
  • Multiplication
  • Inverse
  • Conjugate
  • Logarithm and Exponent
  • Slerp (spherical linear interpolation)
  • Rotation of a vector by a quaternion.

Euler-angles

All 24 from-euler orderings are supported. 7 of 24 to-euler orderings are supported.

Transforms

This library supports force and velocity transforms.

Usage Example

from dm_robotics.transformations import transformations as tr

# Convert a pose, euler angle into a homogeneous matrix (a 4x4 matrix):
hmat = tr.poseuler_to_hmat(
        np.array([x, y, z, rot_x, rot_y, rot_z]), 'XYZ')

# Convert the homogeneous matrix to a twist (a 6 vector):
twist = tr.hmat_to_twist(hmat)

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

r2_transformations-0.1.0.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

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

r2_transformations-0.1.0-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file r2_transformations-0.1.0.tar.gz.

File metadata

  • Download URL: r2_transformations-0.1.0.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for r2_transformations-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e98e2b3cce2b30ec0ce939a02d0502a82623c4779e59d644181faa7e0273740e
MD5 b06c88f96e05899931b6c0fc0a3c8de8
BLAKE2b-256 7405531b1eb646f6c28f569e4222a46db3d79faf38b110d9d811a1e38b07af90

See more details on using hashes here.

File details

Details for the file r2_transformations-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for r2_transformations-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23041526ac99f0507e9f60a005f0764ca1fac5f9534368179a0e4e7852b06afe
MD5 54007fe3e67b7227331988d80bdf7504
BLAKE2b-256 527ea2df9cbc526875083abeddf1dace2b361e38c3d9725739a80571506b6ee7

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