pytransform3d is a Python library for 3D transformations, offering tools to manipulate and visualize 3D poses, rotations (matrices, quaternions, axis-angle), translations, trajectories, and meshes. It emphasizes conventions that are common in robotics and computer vision. The current version is 3.15.0, and the project maintains an active release cadence with frequent updates and bug fixes.
pip install pytransform3dVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a 3D transformation (rotation + translation) using axis-angle representation and then visualize it using matplotlib utilities provided by pytransform3d. It shows a basic use of `transformations` and `plot_utils` modules.
Upgrade Python to 3.9 or a newer supported version.
Consult the official documentation for the updated import paths and function locations if you encounter `AttributeError` or `ImportError` after upgrading to 3.14.0 or later. For example, some functions previously available directly under `pytransform3d.rotations` might now be in `pytransform3d.transformations` or vice versa depending on their primary utility.
Upgrade `pytransform3d` to version 3.14.4 or newer to ensure robust URDF parsing. If you must use an older version, manually clean or simplify URDF files known to cause issues.
Install `pytransform3d` with the `[all]` extra (e.g., `pip install pytransform3d[all]`) or specifically for the visualization backend you intend to use (e.g., `pip install pytransform3d[open3d]`).
Check the official documentation or release notes for the current version to find the correct function name or its new location (e.g., it might have moved from `transformations` to `rotations` or vice-versa, or be in a new utility module).
Ensure that the input array is a `numpy.ndarray` of shape `(4, 4)`. You might need to convert a rotation matrix and translation vector using `pytransform3d.transformations.transform_from_Rt()` or a similar helper function.
Install `pytransform3d` with the necessary optional dependencies using `pip install pytransform3d[all]` or `pip install pytransform3d[open3d]` (replace `open3d` with the specific backend you need).
If working with rotation matrices that might have accumulated floating point errors, consider using `pytransform3d.rotations.robust_polar_decomposition` (available since 3.12.0) which provides a more stable way to orthonormalize a matrix. Ensure your input data is valid and as numerically stable as possible.