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#

check_matrix(R[, tolerance, strict_check])

Input validation of a rotation matrix.

matrix_requires_renormalization(R[, tolerance])

Check if a rotation matrix needs renormalization.

norm_matrix(R)

Orthonormalize rotation matrix.

plot_basis([ax, R, p, s, ax_s, strict_check])

Plot basis of a rotation matrix.

assert_rotation_matrix(R, *args, **kwargs)

Raise an assertion if a matrix is not a rotation matrix.

passive_matrix_from_angle(basis, angle)

Compute passive rotation matrix from rotation about basis vector.

active_matrix_from_angle(basis, angle)

Compute active rotation matrix from rotation about basis vector.

matrix_from_two_vectors(a, b)

Compute rotation matrix from two vectors.

matrix_from_euler(e, i, j, k, extrinsic)

General method to compute active rotation matrix from any Euler angles.

matrix_from_axis_angle(a)

Compute rotation matrix from axis-angle.

matrix_from_compact_axis_angle(a)

Compute rotation matrix from compact axis-angle.

matrix_from_quaternion(q)

Compute rotation matrix from quaternion.

matrix_from_rotor(rotor)

Compute rotation matrix from rotor.

Euler Angles#

euler_near_gimbal_lock(e, i, j, k[, tolerance])

Check if Euler angles are close to gimbal lock.

norm_euler(e, i, j, k)

Normalize Euler angle range.

assert_euler_equal(e1, e2, i, j, k, *args, ...)

Raise an assertion if two Euler angles are not approximately equal.

euler_from_quaternion(q, i, j, k, extrinsic)

General method to extract any Euler angles from quaternions.

euler_from_matrix(R, i, j, k, extrinsic[, ...])

General method to extract any Euler angles from active rotation matrix.

Axis-Angle#

check_axis_angle(a)

Input validation of axis-angle representation.

check_compact_axis_angle(a)

Input validation of compact axis-angle representation.

compact_axis_angle_near_pi(a[, tolerance])

Check if angle of compact axis-angle representation is near pi.

norm_axis_angle(a)

Normalize axis-angle representation.

norm_compact_axis_angle(a)

Normalize compact axis-angle representation.

random_axis_angle([rng])

Generate random axis-angle.

random_compact_axis_angle([rng])

Generate random compact axis-angle.

plot_axis_angle([ax, a, p, s, ax_s])

Plot rotation axis and angle.

assert_axis_angle_equal(a1, a2, *args, **kwargs)

Raise an assertion if two axis-angle are not approximately equal.

assert_compact_axis_angle_equal(a1, a2, ...)

Raise an assertion if two axis-angle are not approximately equal.

axis_angle_slerp(start, end, t)

Spherical linear interpolation.

axis_angle_from_two_directions(a, b)

Compute axis-angle representation from two direction vectors.

axis_angle_from_matrix(R[, strict_check, check])

Compute axis-angle from rotation matrix.

axis_angle_from_quaternion(q)

Compute axis-angle from quaternion.

axis_angle_from_compact_axis_angle(a)

Compute axis-angle from compact axis-angle representation.

axis_angle_from_mrp(mrp)

Compute axis-angle representation from modified Rodrigues parameters.

compact_axis_angle(a)

Compute 3-dimensional axis-angle from a 4-dimensional one.

compact_axis_angle_from_matrix(R[, check])

Compute compact axis-angle from rotation matrix.

compact_axis_angle_from_quaternion(q)

Compute compact axis-angle from quaternion (logarithmic map).

Logarithm of Rotation#

check_rot_log(V[, tolerance, strict_check])

Input validation of a skew-symmetric matrix.

check_skew_symmetric_matrix(V[, tolerance, ...])

Input validation of a skew-symmetric matrix.

rot_log_from_compact_axis_angle(v)

Generate the cross-product matrix of a vector.

cross_product_matrix(v)

Generate the cross-product matrix of a vector.

Quaternion#

check_quaternion(q[, unit])

Input validation of quaternion representation.

check_quaternions(Q[, unit])

Input validation of quaternion representation.

quaternion_requires_renormalization(q[, ...])

Check if a unit quaternion requires renormalization.

quaternion_double(q)

Create another quaternion that represents the same orientation.

pick_closest_quaternion(quaternion, ...)

Resolve quaternion ambiguity and pick the closest one to the target.

random_quaternion([rng])

Generate random quaternion.

assert_quaternion_equal(q1, q2, *args, **kwargs)

Raise an assertion if two quaternions are not approximately equal.

concatenate_quaternions(q1, q2)

Concatenate two quaternions.

q_prod_vector(q, v)

Apply rotation represented by a quaternion to a vector.

q_conj(q)

Conjugate of quaternion.

quaternion_slerp(start, end, t[, shortest_path])

Spherical linear interpolation.

quaternion_dist(q1, q2)

Compute distance between two quaternions.

quaternion_diff(q1, q2)

Compute the rotation in angle-axis format that rotates q2 into q1.

quaternion_gradient(Q[, dt])

Time-derivatives of a sequence of quaternions.

quaternion_integrate(Qd[, q0, dt])

Integrate angular velocities to quaternions.

quaternion_from_angle(basis, angle)

Compute quaternion from rotation about basis vector.

quaternion_from_euler(e, i, j, k, extrinsic)

General conversion to quaternion from any Euler angles.

quaternion_from_matrix(R[, strict_check])

Compute quaternion from rotation matrix.

quaternion_from_axis_angle(a)

Compute quaternion from axis-angle.

quaternion_from_compact_axis_angle(a)

Compute quaternion from compact axis-angle (exponential map).

quaternion_from_mrp(mrp)

Compute quaternion from modified Rodrigues parameters.

quaternion_xyzw_from_wxyz(q_wxyz)

Converts from w, x, y, z to x, y, z, w convention.

quaternion_wxyz_from_xyzw(q_xyzw)

Converts from x, y, z, w to w, x, y, z convention.

Rotor#

check_rotor(rotor)

Input validation of rotor.

plot_bivector([ax, a, b, ax_s])

Plot bivector from wedge product of two vectors a and b.

wedge(a, b)

Outer product of two vectors (also exterior or wedge product).

plane_normal_from_bivector(B)

Convert bivector to normal vector of a plane.

geometric_product(a, b)

Geometric product of two vectors.

concatenate_rotors(rotor1, rotor2)

Concatenate rotors.

rotor_reverse(rotor)

Invert rotor.

rotor_apply(rotor, v)

Apply rotor to vector.

rotor_slerp(start, end, t[, shortest_path])

Spherical linear interpolation.

rotor_from_two_directions(v_from, v_to)

Construct the rotor that rotates one vector to another.

rotor_from_plane_angle(B, angle)

Compute rotor from plane bivector and angle.

Modified Rodrigues Parameters#

check_mrp(mrp)

Input validation of modified Rodrigues parameters.

mrp_near_singularity(mrp[, tolerance])

Check if modified Rodrigues parameters are close to singularity.

norm_mrp(mrp)

Normalize angle of modified Rodrigues parameters to range [-pi, pi].

assert_mrp_equal(mrp1, mrp2, *args, **kwargs)

Raise an assertion if two MRPs are not approximately equal.

mrp_double(mrp)

Other modified Rodrigues parameters representing the same orientation.

concatenate_mrp(mrp1, mrp2)

Concatenate two rotations defined by modified Rodrigues parameters.

mrp_prod_vector(mrp, v)

Apply rotation represented by MRPs to a vector.

mrp_from_axis_angle(a)

Compute modified Rodrigues parameters from axis-angle representation.

mrp_from_quaternion(q)

Compute modified Rodrigues parameters from quaternion.

Jacobians#

left_jacobian_SO3(omega)

Left Jacobian of SO(3) at theta (angle of rotation).

left_jacobian_SO3_series(omega, n_terms)

Left Jacobian of SO(3) at theta from Taylor series.

left_jacobian_SO3_inv(omega)

Inverse left Jacobian of SO(3) at theta (angle of rotation).

left_jacobian_SO3_inv_series(omega, n_terms)

Inverse left Jacobian of SO(3) at theta from Taylor series.

Utility Functions#

norm_angle(a)

Normalize angle to (-pi, pi].

norm_vector(v)

Normalize vector.

perpendicular_to_vectors(a, b)

Compute perpendicular vector to two other vectors.

angle_between_vectors(a, b[, fast])

Compute angle between two vectors.

vector_projection(a, b)

Orthogonal projection of vector a on vector b.

plane_basis_from_normal(plane_normal)

Compute two basis vectors of a plane from the plane's normal vector.

random_vector([rng, n])

Generate an nd vector with normally distributed components.

Deprecated Functions#

quaternion_from_extrinsic_euler_xyz(e)

Compute quaternion from extrinsic xyz Euler angles.

active_matrix_from_intrinsic_euler_xzx(e)

Compute active rotation matrix from intrinsic xzx Euler angles.

active_matrix_from_extrinsic_euler_xzx(e)

Compute active rotation matrix from extrinsic xzx Euler angles.

active_matrix_from_intrinsic_euler_xyx(e)

Compute active rotation matrix from intrinsic xyx Euler angles.

active_matrix_from_extrinsic_euler_xyx(e)

Compute active rotation matrix from extrinsic xyx Euler angles.

active_matrix_from_intrinsic_euler_yxy(e)

Compute active rotation matrix from intrinsic yxy Euler angles.

active_matrix_from_extrinsic_euler_yxy(e)

Compute active rotation matrix from extrinsic yxy Euler angles.

active_matrix_from_intrinsic_euler_yzy(e)

Compute active rotation matrix from intrinsic yzy Euler angles.

active_matrix_from_extrinsic_euler_yzy(e)

Compute active rotation matrix from extrinsic yzy Euler angles.

active_matrix_from_intrinsic_euler_zyz(e)

Compute active rotation matrix from intrinsic zyz Euler angles.

active_matrix_from_extrinsic_euler_zyz(e)

Compute active rotation matrix from extrinsic zyz Euler angles.

active_matrix_from_intrinsic_euler_zxz(e)

Compute active rotation matrix from intrinsic zxz Euler angles.

active_matrix_from_extrinsic_euler_zxz(e)

Compute active rotation matrix from extrinsic zxz Euler angles.

active_matrix_from_intrinsic_euler_xzy(e)

Compute active rotation matrix from intrinsic xzy Cardan angles.

active_matrix_from_extrinsic_euler_xzy(e)

Compute active rotation matrix from extrinsic xzy Cardan angles.

active_matrix_from_intrinsic_euler_xyz(e)

Compute active rotation matrix from intrinsic xyz Cardan angles.

active_matrix_from_extrinsic_euler_xyz(e)

Compute active rotation matrix from extrinsic xyz Cardan angles.

active_matrix_from_intrinsic_euler_yxz(e)

Compute active rotation matrix from intrinsic yxz Cardan angles.

active_matrix_from_extrinsic_euler_yxz(e)

Compute active rotation matrix from extrinsic yxz Cardan angles.

active_matrix_from_intrinsic_euler_yzx(e)

Compute active rotation matrix from intrinsic yzx Cardan angles.

active_matrix_from_extrinsic_euler_yzx(e)

Compute active rotation matrix from extrinsic yzx Cardan angles.

active_matrix_from_intrinsic_euler_zyx(e)

Compute active rotation matrix from intrinsic zyx Cardan angles.

active_matrix_from_extrinsic_euler_zyx(e)

Compute active rotation matrix from extrinsic zyx Cardan angles.

active_matrix_from_intrinsic_euler_zxy(e)

Compute active rotation matrix from intrinsic zxy Cardan angles.

active_matrix_from_extrinsic_euler_zxy(e)

Compute active rotation matrix from extrinsic zxy Cardan angles.

active_matrix_from_extrinsic_roll_pitch_yaw(rpy)

Compute active rotation matrix from extrinsic roll, pitch, and yaw.

intrinsic_euler_xzx_from_active_matrix(R[, ...])

Compute intrinsic xzx Euler angles from active rotation matrix.

extrinsic_euler_xzx_from_active_matrix(R[, ...])

Compute extrinsic xzx Euler angles from active rotation matrix.

intrinsic_euler_xyx_from_active_matrix(R[, ...])

Compute intrinsic xyx Euler angles from active rotation matrix.

extrinsic_euler_xyx_from_active_matrix(R[, ...])

Compute extrinsic xyx Euler angles from active rotation matrix.

intrinsic_euler_yxy_from_active_matrix(R[, ...])

Compute intrinsic yxy Euler angles from active rotation matrix.

extrinsic_euler_yxy_from_active_matrix(R[, ...])

Compute extrinsic yxy Euler angles from active rotation matrix.

intrinsic_euler_yzy_from_active_matrix(R[, ...])

Compute intrinsic yzy Euler angles from active rotation matrix.

extrinsic_euler_yzy_from_active_matrix(R[, ...])

Compute extrinsic yzy Euler angles from active rotation matrix.

intrinsic_euler_zyz_from_active_matrix(R[, ...])

Compute intrinsic zyz Euler angles from active rotation matrix.

extrinsic_euler_zyz_from_active_matrix(R[, ...])

Compute extrinsic zyz Euler angles from active rotation matrix.

intrinsic_euler_zxz_from_active_matrix(R[, ...])

Compute intrinsic zxz Euler angles from active rotation matrix.

extrinsic_euler_zxz_from_active_matrix(R[, ...])

Compute extrinsic zxz Euler angles from active rotation matrix.

intrinsic_euler_xzy_from_active_matrix(R[, ...])

Compute intrinsic xzy Cardan angles from active rotation matrix.

extrinsic_euler_xzy_from_active_matrix(R[, ...])

Compute extrinsic xzy Cardan angles from active rotation matrix.

intrinsic_euler_xyz_from_active_matrix(R[, ...])

Compute intrinsic xyz Cardan angles from active rotation matrix.

extrinsic_euler_xyz_from_active_matrix(R[, ...])

Compute extrinsic xyz Cardan angles from active rotation matrix.

intrinsic_euler_yxz_from_active_matrix(R[, ...])

Compute intrinsic yxz Cardan angles from active rotation matrix.

extrinsic_euler_yxz_from_active_matrix(R[, ...])

Compute extrinsic yxz Cardan angles from active rotation matrix.

intrinsic_euler_yzx_from_active_matrix(R[, ...])

Compute intrinsic yzx Cardan angles from active rotation matrix.

extrinsic_euler_yzx_from_active_matrix(R[, ...])

Compute extrinsic yzx Cardan angles from active rotation matrix.

intrinsic_euler_zyx_from_active_matrix(R[, ...])

Compute intrinsic zyx Cardan angles from active rotation matrix.

extrinsic_euler_zyx_from_active_matrix(R[, ...])

Compute extrinsic zyx Cardan angles from active rotation matrix.

intrinsic_euler_zxy_from_active_matrix(R[, ...])

Compute intrinsic zxy Cardan angles from active rotation matrix.

extrinsic_euler_zxy_from_active_matrix(R[, ...])

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#

check_transform(A2B[, strict_check])

Input validation of transform.

transform_requires_renormalization(A2B[, ...])

Check if transformation matrix requires renormalization.

random_transform([rng, mean, cov])

Generate random transform.

concat(A2B, B2C[, strict_check, check])

Concatenate transformations.

invert_transform(A2B[, strict_check, check])

Invert transform.

transform(A2B, PA[, strict_check])

Transform point or list of points or directions.

vector_to_point(v)

Convert 3D vector to position.

vectors_to_points(V)

Convert 3D vectors to positions.

vector_to_direction(v)

Convert 3D vector to direction.

vectors_to_directions(V)

Convert 3D vectors to directions.

adjoint_from_transform(A2B[, strict_check, ...])

Compute adjoint representation of a transformation matrix.

plot_transform([ax, A2B, s, ax_s, name, ...])

Plot transform.

assert_transform(A2B, *args, **kwargs)

Raise an assertion if the transform is not a homogeneous matrix.

transform_from(R, p[, strict_check])

Make transformation from rotation matrix and translation.

translate_transform(A2B, p[, strict_check, ...])

Sets the translation of a transform.

rotate_transform(A2B, R[, strict_check, check])

Sets the rotation of a transform.

transform_from_pq(pq)

Compute transformation matrix from position and quaternion.

transform_from_exponential_coordinates(Stheta)

Compute transformation matrix from exponential coordinates.

transform_from_transform_log(transform_log)

Compute transformation from matrix logarithm of transformation.

transform_from_dual_quaternion(dq)

Compute transformation matrix from dual quaternion.

Position and Quaternion#

check_pq(pq)

Input validation for position and orientation quaternion.

pq_slerp(start, end, t)

Spherical linear interpolation of position and quaternion.

pq_from_transform(A2B[, strict_check])

Compute position and quaternion from transformation matrix.

pq_from_dual_quaternion(dq)

Compute position and quaternion from dual quaternion.

Screw Parameters#

check_screw_parameters(q, s_axis, h)

Input validation of screw parameters.

plot_screw([ax, q, s_axis, h, theta, A2B, ...])

Plot transformation about and along screw axis.

assert_screw_parameters_equal(q1, s_axis1, ...)

Raise an assertion if two sets of screw parameters are not similar.

screw_parameters_from_screw_axis(screw_axis)

Compute screw parameters from screw axis.

screw_parameters_from_dual_quaternion(dq)

Compute screw parameters from dual quaternion.

Screw Axis#

check_screw_axis(screw_axis)

Input validation of screw axis.

random_screw_axis([rng])

Generate random screw axis.

screw_axis_from_screw_parameters(q, s_axis, h)

Compute screw axis representation from screw parameters.

screw_axis_from_exponential_coordinates(Stheta)

Compute screw axis and theta from exponential coordinates.

screw_axis_from_screw_matrix(screw_matrix)

Compute screw axis from screw matrix.

Exponential Coordinates#

check_exponential_coordinates(Stheta)

Input validation for exponential coordinates of transformation.

norm_exponential_coordinates(Stheta)

Normalize exponential coordinates of transformation.

random_exponential_coordinates([rng, cov])

Generate random exponential coordinates.

assert_exponential_coordinates_equal(...)

Raise an assertion if exp.

exponential_coordinates_from_transform(A2B)

Compute exponential coordinates from transformation matrix.

exponential_coordinates_from_screw_axis(...)

Compute exponential coordinates from screw axis and theta.

exponential_coordinates_from_transform_log(...)

Compute exponential coordinates from logarithm of transformation.

Screw Matrix#

check_screw_matrix(screw_matrix[, ...])

Input validation for screw matrix.

screw_matrix_from_screw_axis(screw_axis)

Compute screw matrix from screw axis.

screw_matrix_from_transform_log(transform_log)

Compute screw matrix from logarithm of transformation.

Logarithm of Transformation#

check_transform_log(transform_log[, ...])

Input validation for logarithm of transformation.

transform_log_from_exponential_coordinates(Stheta)

Compute matrix logarithm of transformation from exponential coordinates.

transform_log_from_screw_matrix(...)

Compute matrix logarithm of transformation from screw matrix and theta.

transform_log_from_transform(A2B[, strict_check])

Compute matrix logarithm of transformation from transformation.

Dual Quaternion#

check_dual_quaternion(dq[, unit])

Input validation of dual quaternion representation.

dual_quaternion_requires_renormalization(dq)

Check if dual quaternion requires renormalization.

assert_unit_dual_quaternion(dq, *args, **kwargs)

Raise an assertion if the dual quaternion does not have unit norm.

assert_unit_dual_quaternion_equal(dq1, dq2, ...)

Raise an assertion if unit dual quaternions are not approximately equal.

dual_quaternion_double(dq)

Create another dual quaternion that represents the same transformation.

dq_conj(dq)

Conjugate of dual quaternion.

dq_q_conj(dq)

Quaternion conjugate of dual quaternion.

concatenate_dual_quaternions(dq1, dq2)

Concatenate dual quaternions.

dq_prod_vector(dq, v)

Apply transform represented by a dual quaternion to a vector.

dual_quaternion_power(dq, t)

Compute power of unit dual quaternion with respect to scalar.

dual_quaternion_sclerp(start, end, t)

Screw linear interpolation (ScLERP) for dual quaternions.

dual_quaternion_from_transform(A2B)

Compute dual quaternion from transformation matrix.

dual_quaternion_from_pq(pq)

Compute dual quaternion from position and quaternion.

dual_quaternion_from_screw_parameters(q, ...)

Compute dual quaternion from screw parameters.

Jacobians#

left_jacobian_SE3(Stheta)

Left Jacobian of SE(3).

left_jacobian_SE3_series(Stheta, n_terms)

Left Jacobian of SE(3) at theta from Taylor series.

left_jacobian_SE3_inv(Stheta)

Left inverse Jacobian of SE(3).

left_jacobian_SE3_inv_series(Stheta, n_terms)

Left inverse Jacobian of SE(3) at theta from Taylor series.

Deprecated Functions#

scale_transform(A2B[, s_xr, s_yr, s_zr, ...])

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#

active_matrices_from_angles(basis, angles[, out])

Compute active rotation matrices from rotation about basis vectors.

active_matrices_from_intrinsic_euler_angles(...)

Compute active rotation matrices from intrinsic Euler angles.

active_matrices_from_extrinsic_euler_angles(...)

Compute active rotation matrices from extrinsic Euler angles.

matrices_from_compact_axis_angles([A, axes, ...])

Compute rotation matrices from compact axis-angle representations.

matrices_from_quaternions(Q[, ...])

Compute rotation matrices from quaternions.

Axis-Angle Representation#

norm_axis_angles(a)

Normalize axis-angle representation.

axis_angles_from_matrices(Rs[, traces, out])

Compute compact axis-angle representations from rotation matrices.

axis_angles_from_quaternions(qs)

Compute axis-angle from quaternion.

cross_product_matrices(V)

Generate the cross-product matrices of vectors.

Quaternions#

batch_concatenate_quaternions(Q1, Q2[, out])

Concatenate two batches of quaternions.

batch_q_conj(Q)

Conjugate of quaternions.

quaternion_slerp_batch(start, end, t[, ...])

Spherical linear interpolation for a batch of steps.

smooth_quaternion_trajectory(Q[, ...])

Smooth quaternion trajectory.

quaternions_from_matrices(Rs[, out])

Compute quaternions from rotation matrices.

batch_quaternion_wxyz_from_xyzw(Q_xyzw[, out])

Converts from x, y, z, w to w, x, y, z convention.

batch_quaternion_xyzw_from_wxyz(Q_wxyz[, out])

Converts from w, x, y, z to x, y, z, w convention.

Utility Functions#

norm_vectors(V[, out])

Normalize vectors.

angles_between_vectors(A, B)

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(A2Bs)

Invert transforms.

concat_one_to_many(A2B, B2Cs)

Concatenate transformation A2B with multiple transformations B2C.

concat_many_to_one(A2Bs, B2C)

Concatenate multiple transformations A2B with transformation B2C.

concat_many_to_many(A2B, B2C)

Concatenate multiple transformations A2B with transformation B2C.

concat_dynamic(A2B, B2C)

Concatenate multiple transformations A2B,B2C with different shapes.

transforms_from_pqs(P[, normalize_quaternions])

Get sequence of homogeneous matrices from positions and quaternions.

transforms_from_exponential_coordinates(Sthetas)

Compute transformations from exponential coordinates.

transforms_from_dual_quaternions(dqs)

Get transformations from dual quaternions.

Positions and Quaternions#

plot_trajectory([ax, P, ...])

Plot pose trajectory.

pqs_from_transforms(A2Bs)

Get sequence of positions and quaternions from homogeneous matrices.

pqs_from_dual_quaternions(dqs)

Get positions and quaternions from dual quaternions.

Screw Parameters#

screw_parameters_from_dual_quaternions(dqs)

Compute screw parameters from dual quaternions.

Exponential Coordinates#

mirror_screw_axis_direction(Sthetas)

Switch to the other representation of the same transformation.

exponential_coordinates_from_transforms(A2Bs)

Compute exponential coordinates from transformations.

Dual Quaternions#

batch_dq_conj(dqs)

Conjugate of dual quaternions.

batch_dq_q_conj(dqs)

Quaternion conjugate of dual quaternions.

batch_concatenate_dual_quaternions(dqs1, dqs2)

Concatenate dual quaternions.

batch_dq_prod_vector(dqs, V)

Apply transforms represented by a dual quaternions to vectors.

dual_quaternions_from_pqs(pqs)

Get dual quaternions from positions and quaternions.

dual_quaternions_power(dqs, ts)

Compute power of unit dual quaternions with respect to scalar.

dual_quaternions_sclerp(starts, ends, ts)

Screw linear interpolation (ScLERP) for array of dual quaternions.

dual_quaternions_from_screw_parameters(qs, ...)

Compute dual quaternions from arrays of screw parameters.

pytransform3d.uncertainty#

Operations related to uncertain transformations.

See Uncertainty in Transformations for more information.

estimate_gaussian_transform_from_samples(samples)

Estimate Gaussian distribution over transformations from samples.

invert_uncertain_transform(mean, cov)

Invert uncertain transform.

concat_globally_uncertain_transforms(...)

Concatenate two independent globally uncertain transformations.

concat_locally_uncertain_transforms(...)

Concatenate two independent locally uncertain transformations.

pose_fusion(means, covs)

Fuse Gaussian distributions of multiple poses.

to_ellipsoid(mean, cov)

Compute error ellipsoid.

to_projected_ellipsoid(mean, cov[, factor, ...])

Compute projected error ellipsoid.

plot_projected_ellipsoid(ax, mean, cov[, ...])

Plots projected equiprobable ellipsoid in 3D.

pytransform3d.coordinates#

Conversions between coordinate systems to represent positions.

cartesian_from_cylindrical(p)

Convert cylindrical coordinates to Cartesian coordinates.

cartesian_from_spherical(p)

Convert spherical coordinates to Cartesian coordinates.

cylindrical_from_cartesian(p)

Convert Cartesian coordinates to cylindrical coordinates.

cylindrical_from_spherical(p)

Convert spherical coordinates to cylindrical coordinates.

spherical_from_cartesian(p)

Convert Cartesian coordinates to spherical coordinates.

spherical_from_cylindrical(p)

Convert cylindrical coordinates to spherical coordinates.

pytransform3d.transform_manager#

Manage complex chains of transformations.

See Organizing Transformations in a Graph for more information.

TransformGraphBase([strict_check, check])

Base class for all graphs of rigid transformations.

TransformManager([strict_check, check])

Manage transformations between frames.

TemporalTransformManager([strict_check, check])

Manage time-varying transformations.

TimeVaryingTransform()

Time-varying rigid transformation.

StaticTransform(A2B)

Transformation, which does not change over time.

NumpyTimeseriesTransform(time, pqs[, ...])

Transformation sequence, represented in a numpy array.

pytransform3d.editor#

Modify transformations visually.

TransformEditor(transform_manager, base_frame)

GUI to edit transformations.

pytransform3d.urdf#

Load transformations from URDF files.

See Organizing Transformations in a Graph for more information.

UrdfTransformManager([strict_check, check])

Transformation manager that can load URDF files.

Link()

Link from URDF file.

Joint()

Joint from URDF file.

Geometry(frame, mesh_path, package_dir, color)

Geometrical object.

Box(frame, mesh_path, package_dir, color)

Geometrical object: box.

Sphere(frame, mesh_path, package_dir, color)

Geometrical object: sphere.

Cylinder(frame, mesh_path, package_dir, color)

Geometrical object: cylinder.

Mesh(frame, mesh_path, package_dir, color)

Geometrical object: mesh.

parse_urdf(urdf_xml[, mesh_path, ...])

Parse information from URDF file.

initialize_urdf_transform_manager(tm, ...)

Initializes transform manager from previously parsed URDF data.

pytransform3d.camera#

Transformations related to cameras.

See Camera for more information.

make_world_grid([n_lines, ...])

Generate grid in world coordinate frame.

make_world_line(p1, p2, n_points)

Generate line in world coordinate frame.

cam2sensor(P_cam, focal_length[, kappa])

Project points from 3D camera coordinate system to sensor plane.

sensor2img(P_sensor, sensor_size, image_size)

Project points from 2D sensor plane to image coordinate system.

world2image(P_world, cam2world, sensor_size, ...)

Project points from 3D world coordinate system to 2D image.

plot_camera([ax, M, cam2world, ...])

Plot camera in world coordinates.

pytransform3d.plot_utils#

Utilities for plotting.

make_3d_axis(ax_s[, pos, unit, n_ticks])

Generate new 3D axis.

remove_frame(ax[, left, bottom, right, top])

Remove axis and scale bbox.

plot_vector([ax, start, direction, s, ...])

Plot Vector.

plot_length_variable([ax, start, end, name, ...])

Plot length with text at its center.

plot_box([ax, size, A2B, ax_s, wireframe, ...])

Plot box.

plot_sphere([ax, radius, p, ax_s, ...])

Plot sphere.

plot_spheres([ax, radius, p, ax_s, ...])

Plot multiple spheres.

plot_cylinder([ax, length, radius, ...])

Plot cylinder.

plot_mesh([ax, filename, A2B, s, ax_s, ...])

Plot mesh.

plot_ellipsoid([ax, radii, A2B, ax_s, ...])

Plot ellipsoid.

plot_capsule([ax, A2B, height, radius, ...])

Plot capsule.

plot_cone([ax, height, radius, A2B, ax_s, ...])

Plot cone.

Arrow3D(xs, ys, zs, *args, **kwargs)

A Matplotlib patch that represents an arrow in 3D.

Frame(A2B[, label, s])

A Matplotlib artist that displays a frame represented by its basis.

LabeledFrame(A2B[, label, s])

Displays a frame represented by its basis with axis labels.

Trajectory(H[, show_direction, n_frames, s])

A Matplotlib artist that displays a trajectory.

Camera(M, cam2world[, ...])

A Matplotlib artist that displays a camera.

pytransform3d.visualizer#

Optional 3D renderer based on Open3D’s visualizer.

figure([window_name, width, height, ...])

Create a new figure.

Figure([window_name, width, height, ...])

The top level container for all the plot elements.

Artist()

Abstract base class for objects that can be rendered.

Line3D(P[, c])

A line.

PointCollection3D(P[, s, c])

Collection of points.

Vector3D([start, direction, c])

A vector.

Frame(A2B[, label, s])

Coordinate frame.

Trajectory(H[, n_frames, s, c])

Trajectory of poses.

Sphere([radius, A2B, resolution, c])

Sphere.

Box([size, A2B, c])

Box.

Cylinder([length, radius, A2B, resolution, ...])

Cylinder.

Mesh(filename[, A2B, s, c, convex_hull])

Mesh.

Ellipsoid(radii[, A2B, resolution, c])

Ellipsoid.

Capsule([height, radius, A2B, resolution, c])

Capsule.

Cone([height, radius, A2B, resolution, c])

Cone.

Plane([normal, d, point_in_plane, s, c])

Plane.

Graph(tm, frame[, show_frames, ...])

Graph of connected frames.

Camera(M[, cam2world, ...])

Camera.