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.
Rotation Matrix#
|
Input validation of a rotation matrix. |
|
Check if a rotation matrix needs renormalization. |
|
Orthonormalize rotation matrix. |
|
Plot basis of a rotation matrix. |
|
Raise an assertion if a matrix is not a rotation matrix. |
|
Compute passive rotation matrix from rotation about basis vector. |
|
Compute active rotation matrix from rotation about basis vector. |
|
Compute rotation matrix from two vectors. |
|
General method to compute active rotation matrix from any Euler angles. |
Compute rotation matrix from axis-angle. |
|
Compute rotation matrix from compact axis-angle. |
|
Compute rotation matrix from quaternion. |
|
|
Compute rotation matrix from rotor. |
Euler Angles#
|
Check if Euler angles are close to gimbal lock. |
|
Normalize Euler angle range. |
|
Raise an assertion if two Euler angles are not approximately equal. |
|
General method to extract any Euler angles from quaternions. |
|
General method to extract any Euler angles from active rotation matrix. |
Axis-Angle#
Input validation of axis-angle representation. |
|
Input validation of compact axis-angle representation. |
|
|
Check if angle of compact axis-angle representation is near pi. |
Normalize axis-angle representation. |
|
Normalize compact axis-angle representation. |
|
|
Generate random axis-angle. |
|
Generate random compact axis-angle. |
|
Plot rotation axis and angle. |
|
Raise an assertion if two axis-angle are not approximately equal. |
|
Raise an assertion if two axis-angle are not approximately equal. |
|
Spherical linear interpolation. |
Compute axis-angle representation from two direction vectors. |
|
|
Compute axis-angle from rotation matrix. |
Compute axis-angle from quaternion. |
|
Compute axis-angle from compact axis-angle representation. |
|
|
Compute axis-angle representation from modified Rodrigues parameters. |
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). |
Logarithm of Rotation#
|
Input validation of a skew-symmetric matrix. |
|
Input validation of a skew-symmetric matrix. |
Generate the cross-product matrix of a vector. |
|
Generate the cross-product matrix of a vector. |
Quaternion#
|
Input validation of quaternion representation. |
|
Input validation of quaternion representation. |
|
Check if a unit quaternion requires renormalization. |
Create another quaternion that represents the same orientation. |
|
|
Resolve quaternion ambiguity and pick the closest one to the target. |
|
Generate random quaternion. |
|
Raise an assertion if two quaternions are not approximately equal. |
|
Concatenate two quaternions. |
|
Apply rotation represented by a quaternion to a vector. |
|
Conjugate of quaternion. |
|
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. |
|
Compute quaternion from rotation about basis vector. |
|
General conversion to quaternion from any Euler angles. |
|
Compute quaternion from rotation matrix. |
Compute quaternion from axis-angle. |
|
Compute quaternion from compact axis-angle (exponential map). |
|
|
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. |
Rotor#
|
Input validation of rotor. |
|
Plot bivector from wedge product of two vectors a and b. |
|
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. |
|
Construct the rotor that rotates one vector to another. |
|
Compute rotor from plane bivector and angle. |
Modified Rodrigues Parameters#
|
Input validation of modified Rodrigues parameters. |
|
Check if modified Rodrigues parameters are close to singularity. |
|
Normalize angle of modified Rodrigues parameters to range [-pi, pi]. |
|
Raise an assertion if two MRPs are not approximately equal. |
|
Other modified Rodrigues parameters representing the same orientation. |
|
Concatenate two rotations defined by modified Rodrigues parameters. |
|
Apply rotation represented by MRPs to a vector. |
Compute modified Rodrigues parameters from axis-angle representation. |
|
Compute modified Rodrigues parameters from 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#
|
Normalize angle to (-pi, pi]. |
|
Normalize vector. |
|
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 an nd vector with normally distributed components. |
Deprecated Functions#
Compute quaternion from extrinsic xyz Euler angles. |
|
Compute active rotation matrix from intrinsic xzx Euler angles. |
|
Compute active rotation matrix from extrinsic xzx Euler angles. |
|
Compute active rotation matrix from intrinsic xyx Euler angles. |
|
Compute active rotation matrix from extrinsic xyx Euler angles. |
|
Compute active rotation matrix from intrinsic yxy Euler angles. |
|
Compute active rotation matrix from extrinsic yxy Euler angles. |
|
Compute active rotation matrix from intrinsic yzy Euler angles. |
|
Compute active rotation matrix from extrinsic yzy Euler angles. |
|
Compute active rotation matrix from intrinsic zyz Euler angles. |
|
Compute active rotation matrix from extrinsic zyz Euler angles. |
|
Compute active rotation matrix from intrinsic zxz Euler angles. |
|
Compute active rotation matrix from extrinsic zxz Euler angles. |
|
Compute active rotation matrix from intrinsic xzy Cardan angles. |
|
Compute active rotation matrix from extrinsic xzy Cardan angles. |
|
Compute active rotation matrix from intrinsic xyz Cardan angles. |
|
Compute active rotation matrix from extrinsic xyz Cardan angles. |
|
Compute active rotation matrix from intrinsic yxz Cardan angles. |
|
Compute active rotation matrix from extrinsic yxz Cardan angles. |
|
Compute active rotation matrix from intrinsic yzx Cardan angles. |
|
Compute active rotation matrix from extrinsic yzx Cardan angles. |
|
Compute active rotation matrix from intrinsic zyx Cardan angles. |
|
Compute active rotation matrix from extrinsic zyx Cardan angles. |
|
Compute active rotation matrix from intrinsic zxy Cardan angles. |
|
Compute active rotation matrix from extrinsic zxy Cardan angles. |
|
Compute active rotation matrix from extrinsic roll, pitch, and yaw. |
|
|
Compute intrinsic xzx Euler angles from active rotation matrix. |
|
Compute extrinsic xzx Euler angles from active rotation matrix. |
|
Compute intrinsic xyx Euler angles from active rotation matrix. |
|
Compute extrinsic xyx Euler angles from active rotation matrix. |
|
Compute intrinsic yxy Euler angles from active rotation matrix. |
|
Compute extrinsic yxy Euler angles from active rotation matrix. |
|
Compute intrinsic yzy Euler angles from active rotation matrix. |
|
Compute extrinsic yzy Euler angles from active rotation matrix. |
|
Compute intrinsic zyz Euler angles from active rotation matrix. |
|
Compute extrinsic zyz Euler angles from active rotation matrix. |
|
Compute intrinsic zxz Euler angles from active rotation matrix. |
|
Compute extrinsic zxz Euler angles from active rotation matrix. |
|
Compute intrinsic xzy Cardan angles from active rotation matrix. |
|
Compute extrinsic xzy Cardan angles from active rotation matrix. |
|
Compute intrinsic xyz Cardan angles from active rotation matrix. |
|
Compute extrinsic xyz Cardan angles from active rotation matrix. |
|
Compute intrinsic yxz Cardan angles from active rotation matrix. |
|
Compute extrinsic yxz Cardan angles from active rotation matrix. |
|
Compute intrinsic yzx Cardan angles from active rotation matrix. |
|
Compute extrinsic yzx Cardan angles from active rotation matrix. |
|
Compute intrinsic zyx Cardan angles from active rotation matrix. |
|
Compute extrinsic zyx Cardan angles from active rotation matrix. |
|
Compute intrinsic zxy Cardan angles from active rotation matrix. |
|
Compute extrinsic zxy Cardan angles from active rotation matrix. |
pytransform3d.transformations
#
Transformations in three dimensions - SE(3).
See SE(3): 3D Transformations for more information.
Transformation Matrix#
|
Input validation of transform. |
|
Check if transformation matrix requires renormalization. |
|
Generate random transform. |
|
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. |
|
|
Compute adjoint representation of a transformation matrix. |
|
Plot transform. |
|
Raise an assertion if the transform is not a homogeneous 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. |
Position and Quaternion#
|
Input validation for position and orientation quaternion. |
|
Spherical linear interpolation of position and quaternion. |
|
Compute position and quaternion from transformation matrix. |
Compute position and quaternion from dual quaternion. |
Screw Parameters#
|
Input validation of screw parameters. |
|
Plot transformation about and along screw axis. |
|
Raise an assertion if two sets of screw parameters are not similar. |
|
Compute screw parameters from screw axis. |
Compute screw parameters from dual quaternion. |
Screw Axis#
|
Input validation of screw axis. |
|
Generate random screw axis. |
|
Compute screw axis representation from screw parameters. |
Compute screw axis and theta from exponential coordinates. |
|
|
Compute screw axis from screw matrix. |
Exponential Coordinates#
|
Input validation for exponential coordinates of transformation. |
|
Normalize exponential coordinates of transformation. |
|
Generate random exponential coordinates. |
Raise an assertion if exp. |
|
Compute exponential coordinates from transformation matrix. |
|
Compute exponential coordinates from screw axis and theta. |
|
Compute exponential coordinates from logarithm of transformation. |
Screw Matrix#
|
Input validation for screw matrix. |
|
Compute screw matrix from screw axis. |
|
Compute screw matrix from logarithm of transformation. |
Logarithm of Transformation#
|
Input validation for logarithm of transformation. |
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. |
Dual Quaternion#
|
Input validation of dual quaternion representation. |
Check if dual quaternion requires renormalization. |
|
|
Raise an assertion if the dual quaternion does not have unit norm. |
|
Raise an assertion if unit dual quaternions are not approximately equal. |
Create another dual quaternion that represents the same transformation. |
|
|
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. |
Compute dual quaternion from transformation matrix. |
|
Compute dual quaternion from position and quaternion. |
|
Compute dual quaternion from screw parameters. |
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. |
Deprecated Functions#
|
Scale a transform from A to reference frame B. |
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.
Rotation Matrices#
|
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 rotation matrices from quaternions. |
Axis-Angle Representation#
Normalize axis-angle representation. |
|
|
Compute compact axis-angle representations from rotation matrices. |
Compute axis-angle from quaternion. |
|
Generate the cross-product matrices of vectors. |
Quaternions#
|
Concatenate two batches of quaternions. |
|
Conjugate of quaternions. |
|
Spherical linear interpolation for a batch of steps. |
|
Smooth quaternion trajectory. |
|
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. |
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.
Transformation Matrices#
|
Invert transforms. |
|
Concatenate transformation A2B with multiple transformations B2C. |
|
Concatenate multiple transformations A2B with transformation B2C. |
|
Concatenate multiple transformations A2B with transformation B2C. |
|
Concatenate multiple transformations A2B,B2C with different shapes. |
|
Get sequence of homogeneous matrices from positions and quaternions. |
Compute transformations from exponential coordinates. |
|
Get transformations from dual quaternions. |
Positions and Quaternions#
|
Plot pose trajectory. |
|
Get sequence of positions and quaternions from homogeneous matrices. |
Get positions and quaternions from dual quaternions. |
Screw Parameters#
Compute screw parameters from dual quaternions. |
Exponential Coordinates#
|
Switch to the other representation of the same transformation. |
Compute exponential coordinates from transformations. |
Dual Quaternions#
|
Conjugate of dual quaternions. |
|
Quaternion conjugate of dual quaternions. |
|
Concatenate dual quaternions. |
|
Apply transforms represented by a dual quaternions to vectors. |
Get dual quaternions from positions and quaternions. |
|
|
Compute power of unit dual quaternions with respect to scalar. |
|
Screw linear interpolation (ScLERP) for array of dual quaternions. |
Compute dual quaternions from arrays of screw parameters. |
pytransform3d.uncertainty
#
Operations related to uncertain transformations.
See Uncertainty in Transformations for more information.
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 Organizing Transformations in a Graph 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 Organizing Transformations in a Graph 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. |
|
A Matplotlib artist that displays a camera. |
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. |