Skip to main content

Transform

Represents a 3D pose transformation between two coordinate frames.

Properties:

Property

Type

Description

header

Header

Transform metadata header

Read-only properties:

Property

Type

Description

translation

np.ndarray

Translation [x, y, z], unit m

rotation

np.ndarray

Quaternion [x, y, z, w]

timestamp

float

Second-precision timestamp, equivalent to header.timestamp

source_frame

str

Source frame, equivalent to header.frame_id

target_frame

str

Target frame, equivalent to constructor parameter child_frame_id

rpy

np.ndarray

Euler angles [roll, pitch, yaw], unit rad; computed from rotation

Transform​

Signature:

Transform(
translation: np.ndarray,
rotation: np.ndarray,
child_frame_id: str,
header: Header | None = None,
)

Description:

Construct a Transform instance.

Parameters:

Parameter

Type

Required

Description

translation

np.ndarray

Yes

Translation [x, y, z], unit: m

rotation

np.ndarray

Yes

Quaternion [x, y, z, w]

child_frame_id

str

Yes

Target coordinate frame

header

Header | None

No

Transform metadata header; uses default Header when omitted or None

Returns:

Transform instance.

Raises:

None.

inverse​

Signature:

Transform.inverse() -> Transform

Description:

Returns the inverse transform; source and target coordinate frames are swapped.

Parameters:

No parameters.

Returns:

Transform, a new inverse transform object.

Raises:

None.

to_matrix​

Signature:

Transform.to_matrix() -> np.ndarray

Description:

Returns a 4x4 homogeneous transformation matrix.

Parameters:

No parameters.

Returns:

np.ndarray, shape (4, 4).

Raises:

None.

to_numpy​

Signature:

Transform.to_numpy() -> dict[str, np.ndarray]

Description:

Returns a dict containing translation / rotation / rpy / matrix.

Parameters:

No parameters.

Returns:

dict[str, np.ndarray].

Raises:

None.