API Documentation¶
This is the detailed documentation of all public classes and functions. You can also search for specific modules, classes, or functions in the Index.
pytransform3d.rotations
¶
Rotations in three dimensions - SO(3).
See SO(3): 3D Rotations for more information.
Input Validation Functions¶
|
Input validation of a rotation matrix. |
|
Input validation of a skew-symmetric matrix. |
Input validation of axis-angle representation. |
|
Input validation of compact axis-angle representation. |
|
|
Input validation of quaternion representation. |
|
Input validation of quaternion representation. |
|
Input validation of rotor. |
|
Input validation of modified Rodrigues parameters. |
Conversions¶
Conversions to Rotation Matrix¶
See also Euler Angles for conversions from and to Euler angles that have been omitted here for the sake of brevity.
|
Compute passive rotation matrix from rotation about basis vector. |
|
Compute active rotation matrix from rotation about basis vector. |
|
General method to compute active rotation matrix from any Euler angles. |
|
Compute rotation matrix from two vectors. |
Compute rotation matrix from axis-angle. |
|
Compute rotation matrix from compact axis-angle. |
|
Compute rotation matrix from quaternion. |
|
|
Compute rotation matrix from rotor. |
Conversions to Axis-Angle¶
|
Compute axis-angle from rotation matrix. |
Compute axis-angle from quaternion. |
|
Compute axis-angle from compact axis-angle representation. |
|
Compute 3-dimensional axis-angle from a 4-dimensional one. |
|
|
Compute compact axis-angle from rotation matrix. |
Compute compact axis-angle from quaternion (logarithmic map). |
Conversions to Quaternion¶
|
Compute quaternion from rotation about basis vector. |
|
Compute quaternion from rotation matrix. |
Compute quaternion from axis-angle. |
|
Compute quaternion from compact axis-angle (exponential map). |
|
|
General conversion to quaternion from any Euler angles. |
|
Compute quaternion from modified Rodrigues parameters. |
|
Converts from w, x, y, z to x, y, z, w convention. |
|
Converts from x, y, z, w to w, x, y, z convention. |
Conversions to Rotor¶
|
Construct the rotor that rotates one vector to another. |
|
Compute rotor from plane bivector and angle. |
Conversions to Modified Rodrigues Parameters¶
Compute modified Rodrigues parameters from quaternion. |
Quaternion and Axis-Angle Operations¶
Compute axis-angle representation from two direction vectors. |
|
|
Spherical linear interpolation. |
|
Concatenate two quaternions. |
|
Apply rotation represented by a quaternion to a vector. |
|
Conjugate of quaternion. |
|
Resolve quaternion ambiguity and pick the closest one to the target. |
|
Spherical linear interpolation. |
|
Compute distance between two quaternions. |
|
Compute the rotation in angle-axis format that rotates q2 into q1. |
|
Time-derivatives of a sequence of quaternions. |
|
Integrate angular velocities to quaternions. |
Rotors¶
|
Outer product of two vectors (also exterior or wedge product). |
Convert bivector to normal vector of a plane. |
|
|
Geometric product of two vectors. |
|
Concatenate rotors. |
|
Invert rotor. |
|
Apply rotor to vector. |
|
Spherical linear interpolation. |
Plotting¶
|
Plot basis of a rotation matrix. |
|
Plot rotation axis and angle. |
|
Plot bivector from wedge product of two vectors a and b. |
Testing¶
|
Raise an assertion if two axis-angle are not approximately equal. |
|
Raise an assertion if two axis-angle are not approximately equal. |
|
Raise an assertion if two quaternions are not approximately equal. |
|
Raise an assertion if a matrix is not a rotation matrix. |
Normalization¶
|
Normalize vector. |
|
Orthonormalize rotation matrix. |
|
Normalize angle to (-pi, pi]. |
Normalize axis-angle representation. |
|
Normalize compact axis-angle representation. |
Random Sampling¶
|
Generate an nd vector with normally distributed components. |
|
Generate random axis-angle. |
|
Generate random compact axis-angle. |
|
Generate random quaternion. |
Jacobians¶
|
Left Jacobian of SO(3) at theta (angle of rotation). |
|
Left Jacobian of SO(3) at theta from Taylor series. |
|
Inverse left Jacobian of SO(3) at theta (angle of rotation). |
|
Inverse left Jacobian of SO(3) at theta from Taylor series. |
Utility Functions¶
|
Compute perpendicular vector to two other vectors. |
|
Compute angle between two vectors. |
|
Orthogonal projection of vector a on vector b. |
|
Compute two basis vectors of a plane from the plane's normal vector. |
Generate the cross-product matrix of a vector. |
Deprecated Functions¶
Compute quaternion from extrinsic xyz Euler angles. |
pytransform3d.transformations
¶
Transformations in three dimensions - SE(3).
See SE(3): 3D Transformations for more information.
Input Validation Functions¶
|
Input validation of transform. |
|
Input validation for position and orientation quaternion. |
|
Input validation of screw parameters. |
|
Input validation of screw axis. |
|
Input validation for exponential coordinates of transformation. |
|
Input validation for screw matrix. |
|
Input validation for logarithm of transformation. |
|
Input validation of dual quaternion representation. |
Conversions¶
Conversions to Transformation Matrix¶
|
Make transformation from rotation matrix and translation. |
|
Sets the translation of a transform. |
|
Sets the rotation of a transform. |
Compute transformation matrix from position and quaternion. |
|
Compute transformation matrix from exponential coordinates. |
|
|
Compute transformation from matrix logarithm of transformation. |
Compute transformation matrix from dual quaternion. |
Conversions to Position and Quaternion¶
|
Compute position and quaternion from transformation matrix. |
Compute position and quaternion from dual quaternion. |
Conversions to Screw Parameters¶
|
Compute screw parameters from screw axis. |
Compute screw parameters from dual quaternion. |
Conversions to Screw Axis¶
|
Compute screw axis representation from screw parameters. |
Compute screw axis and theta from exponential coordinates. |
|
|
Compute screw axis from screw matrix. |
Conversions to Exponential Coordinates¶
Compute exponential coordinates from transformation matrix. |
|
Compute exponential coordinates from screw axis and theta. |
|
Compute exponential coordinates from logarithm of transformation. |
Conversions to Screw Matrix¶
|
Compute screw matrix from screw axis. |
|
Compute screw matrix from logarithm of transformation. |
Conversions to Matrix Logarithm¶
Compute matrix logarithm of transformation from exponential coordinates. |
|
Compute matrix logarithm of transformation from screw matrix and theta. |
|
|
Compute matrix logarithm of transformation from transformation. |
Conversions to Dual Quaternions¶
Compute dual quaternion from transformation matrix. |
|
Compute dual quaternion from position and quaternion. |
|
Compute dual quaternion from screw parameters. |
Apply Transformations¶
|
Concatenate transformations. |
|
Invert transform. |
|
Transform point or list of points or directions. |
Convert 3D vector to position. |
|
Convert 3D vectors to positions. |
|
Convert 3D vector to direction. |
|
Convert 3D vectors to directions. |
|
|
Scale a transform from A to reference frame B. |
|
Compute adjoint representation of a transformation matrix. |
Position+Quaternion Operations¶
|
Spherical linear interpolation of position and quaternion. |
Dual Quaternion Operations¶
|
Conjugate of dual quaternion. |
|
Quaternion conjugate of dual quaternion. |
|
Concatenate dual quaternions. |
|
Apply transform represented by a dual quaternion to a vector. |
|
Compute power of unit dual quaternion with respect to scalar. |
|
Screw linear interpolation (ScLERP) for dual quaternions. |
Plotting¶
|
Plot transform. |
|
Plot transformation about and along screw axis. |
Testing¶
|
Raise an assertion if the transform is not a homogeneous matrix. |
|
Raise an assertion if the dual quaternion does not have unit norm. |
|
Raise an assertion if unit dual quaternions are not approximately equal. |
|
Raise an assertion if two sets of screw parameters are not similar. |
Random Sampling¶
|
Generate random transform. |
|
Generate random screw axis. |
|
Generate random exponential coordinates. |
Normalization¶
|
Normalize exponential coordinates of transformation. |
Jacobians¶
|
Left Jacobian of SE(3). |
|
Left Jacobian of SE(3) at theta from Taylor series. |
|
Left inverse Jacobian of SE(3). |
|
Left inverse Jacobian of SE(3) at theta from Taylor series. |
pytransform3d.batch_rotations
¶
Batch operations on rotations in three dimensions - SO(3).
Conversions from this module operate on batches of orientations or rotations and can be orders of magnitude faster than a loop of individual conversions.
All functions operate on nd arrays, where the last dimension (vectors) or the last two dimensions (matrices) contain individual rotations.
Conversions¶
|
Compute active rotation matrices from rotation about basis vectors. |
Compute active rotation matrices from intrinsic Euler angles. |
|
Compute active rotation matrices from extrinsic Euler angles. |
|
|
Compute rotation matrices from compact axis-angle representations. |
|
Compute compact axis-angle representations from rotation matrices. |
Generate the cross-product matrices of vectors. |
|
|
Compute rotation matrices from quaternions. |
|
Compute quaternions from rotation matrices. |
|
Converts from x, y, z, w to w, x, y, z convention. |
|
Converts from w, x, y, z to x, y, z, w convention. |
Operations¶
|
Conjugate of quaternions. |
|
Concatenate two batches of quaternions. |
|
Spherical linear interpolation for a batch of steps. |
|
Smooth quaternion trajectory. |
Utility Functions¶
|
Normalize vectors. |
|
Compute angle between two vectors. |
pytransform3d.trajectories
¶
Trajectories in three dimensions - SE(3).
Conversions from this module operate on batches of poses or transformations and can be 400 to 1000 times faster than a loop of individual conversions.
Conversions¶
|
Get sequence of homogeneous matrices from positions and quaternions. |
Compute transformations from exponential coordinates. |
|
Get transformations from dual quaternions. |
|
|
Get sequence of positions and quaternions from homogeneous matrices. |
Get positions and quaternions from dual quaternions. |
|
Compute exponential coordinates from transformations. |
|
Get dual quaternions from positions and quaternions. |
Operations and Utility Functions¶
|
Invert transforms. |
|
Concatenate transformation A2B with multiple transformations B2C. |
|
Concatenate multiple transformations A2B with transformation B2C. |
|
Conjugate of dual quaternions. |
|
Concatenate dual quaternions. |
|
Apply transforms represented by a dual quaternions to vectors. |
|
Plot pose trajectory. |
|
Switch to the other representation of the same transformation. |
pytransform3d.uncertainty
¶
Operations related to uncertain transformations.
Estimate Gaussian distribution over transformations from samples. |
|
|
Invert uncertain transform. |
Concatenate two independent globally uncertain transformations. |
|
Concatenate two independent locally uncertain transformations. |
|
|
Fuse Gaussian distributions of multiple poses. |
|
Compute error ellipsoid. |
|
Compute projected error ellipsoid. |
|
Plots projected equiprobable ellipsoid in 3D. |
pytransform3d.coordinates
¶
Conversions between coordinate systems to represent positions.
Convert cylindrical coordinates to Cartesian coordinates. |
|
Convert spherical coordinates to Cartesian coordinates. |
|
Convert Cartesian coordinates to cylindrical coordinates. |
|
Convert spherical coordinates to cylindrical coordinates. |
|
Convert Cartesian coordinates to spherical coordinates. |
|
Convert cylindrical coordinates to spherical coordinates. |
pytransform3d.transform_manager
¶
Manage complex chains of transformations.
See Managing Transformations for more information.
|
Base class for all graphs of rigid transformations. |
|
Manage transformations between frames. |
|
Manage time-varying transformations. |
Time-varying rigid transformation. |
|
|
Transformation, which does not change over time. |
|
Transformation sequence, represented in a numpy array. |
pytransform3d.editor
¶
Modify transformations visually.
|
GUI to edit transformations. |
pytransform3d.urdf
¶
Load transformations from URDF files.
See Managing Transformations for more information.
|
Transformation manager that can load URDF files. |
|
Link from URDF file. |
|
Joint from URDF file. |
|
Geometrical object. |
|
Geometrical object: box. |
|
Geometrical object: sphere. |
|
Geometrical object: cylinder. |
|
Geometrical object: mesh. |
|
Parse information from URDF file. |
|
Initializes transform manager from previously parsed URDF data. |
pytransform3d.camera
¶
Transformations related to cameras.
See Camera for more information.
|
Generate grid in world coordinate frame. |
|
Generate line in world coordinate frame. |
|
Project points from 3D camera coordinate system to sensor plane. |
|
Project points from 2D sensor plane to image coordinate system. |
|
Project points from 3D world coordinate system to 2D image. |
|
Plot camera in world coordinates. |
pytransform3d.plot_utils
¶
Utilities for plotting.
|
Generate new 3D axis. |
|
Remove axis and scale bbox. |
|
Plot Vector. |
|
Plot length with text at its center. |
|
Plot box. |
|
Plot sphere. |
|
Plot multiple spheres. |
|
Plot cylinder. |
|
Plot mesh. |
|
Plot ellipsoid. |
|
Plot capsule. |
|
Plot cone. |
|
A Matplotlib patch that represents an arrow in 3D. |
|
A Matplotlib artist that displays a frame represented by its basis. |
|
Displays a frame represented by its basis with axis labels. |
|
A Matplotlib artist that displays a trajectory. |
pytransform3d.visualizer
¶
Optional 3D renderer based on Open3D’s visualizer.
|
Create a new figure. |
|
The top level container for all the plot elements. |
|
Abstract base class for objects that can be rendered. |
|
A line. |
|
Collection of points. |
|
A vector. |
|
Coordinate frame. |
|
Trajectory of poses. |
|
Sphere. |
|
Box. |
|
Cylinder. |
|
Mesh. |
|
Ellipsoid. |
|
Capsule. |
|
Cone. |
|
Plane. |
|
Graph of connected frames. |
|
Camera. |