source_frame into target_frame.
Direction: a transform is the pose of the source frame, measured in the target
frame. Name it <source>_wrt_<target>: camera_wrt_base is
Transform(..., source_frame="camera", target_frame="base"), the transform that
Camera.getExtrinsics() returns as a 4x4 matrix. Its translation is the
camera origin in base coordinates, and its rotation is the camera axes
relative to the base axes.
Math: a point p in the source frame maps to p' = R p + t in the target
frame, where R is rotation and t is translation; with the 4x4
matrix M = to_matrix(), p' = M p. A Pose’s orientation q becomes
q_T * q. inverse() has rotation R^-1 and translation -R^-1 t, and
swaps the frames. transform.T is the transpose of the 4x4 matrix, as in
NumPy, for points stored as rows:
points @ transform.T. The transpose is not the inverse; use inverse().
Order: A @ B composes in matrix order, so B applies first; read a chain
from right to left. At each @, the right side must map into the frame that
the left side maps from: A.source_frame == B.target_frame.
Frame checks: T @ pose needs pose.frame_id == T.source_frame and returns
a Pose with frame_id == T.target_frame. A @ B needs
A.source_frame == B.target_frame. from_pose needs the pose in
target_frame. A mismatch raises FrameMismatchError, a ValueError
whose message names both frames. A Pose without a frame_id is taken to be
in the source frame and is not checked. Frames are names that the caller
supplies; nothing is inferred.
Fields
Constructor
Signature
Properties
The transpose of the 4x4 matrix,
to_matrix().T, as in NumPy.Use it for points stored as rows: points @ transform.T maps an (N, 4)
array of homogeneous points. It is not the inverse; use inverse.Methods
apply()
Signature
source_frame into target_frame; the same as self @ pose.
A pose without a frame is taken to be in source_frame. The input pose does
not change.
Returns:
Pose: The pose in target_frame, with frame_id set to target_frame.
Raises:
FrameMismatchError: If the pose has a frame and it is not source_frame.
compose()
Signature
other first, then this transform; the same as self @ other.
Returns:
Transform: The transform from other.source_frame into self.target_frame.
Raises:
FrameMismatchError: If other.target_frame is not self.source_frame.
from_dict()
Signature
{"translation", "rotation", "source_frame", "target_frame"}
from_matrix()
Signature
from_pose()
Signature
pose.
Returns:
Transform: The transform from source_frame into target_frame.
Raises:
FrameMismatchError: If the pose has a frame and it is not target_frame.
identity()
Signature
frame onto itself and changes no coordinates.
Returns:
Transform: The identity transform in frame.
inverse()
Signature
target_frame into source_frame.
Returns:
Transform: The inverse transform, with the frames swapped.
to_dict()
Signature
{"translation", "rotation", "source_frame", "target_frame"}
to_matrix()
Signature