Skip to main content

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)

Metadata

Release files for r2-transformations 0.1.0

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

Source distribution (sdist)

Source distribution for r2-transformations 0.1.0
File Size Uploaded
r2_transformations-0.1.0.tar.gz 38.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for r2-transformations 0.1.0
File Interpreter ABI Platform
r2_transformations-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.4 kB

Release files / r2_transformations-0.1.0.tar.gz

Download URL r2_transformations-0.1.0.tar.gz
Size 38.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e98e2b3cce2b30ec0ce939a02d0502a82623c4779e59d644181faa7e0273740e
BLAKE2b-256 checksum
How to use checksums
7405531b1eb646f6c28f569e4222a46db3d79faf38b110d9d811a1e38b07af90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release files / r2_transformations-0.1.0-py3-none-any.whl

Download URL r2_transformations-0.1.0-py3-none-any.whl
Size 44.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23041526ac99f0507e9f60a005f0764ca1fac5f9534368179a0e4e7852b06afe
BLAKE2b-256 checksum
How to use checksums
527ea2df9cbc526875083abeddf1dace2b361e38c3d9725739a80571506b6ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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