Skip to main content

OdomState

Represents robot odometry pose and velocity.

Properties:

Property

Type

Description

header

Header

Odometry metadata header

Read-only properties:

Property

Type

Description

position

np.ndarray

Position [x, y, z], unit m

orientation

np.ndarray

Quaternion [x, y, z, w]

linear_velocity

np.ndarray | None

Linear velocity [x, y, z], unit m/s

angular_velocity

np.ndarray | None

Angular velocity [x, y, z], unit rad/s

timestamp

float

Second-precision timestamp, equivalent to header.timestamp

frame_id

str

Reference frame, equivalent to header.frame_id

child_frame_id

str

Child frame

rpy

np.ndarray

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

pose_2d

np.ndarray

Planar pose [x, y, yaw]

OdomState​

Signature:

OdomState(
child_frame_id: str,
position: np.ndarray,
orientation: np.ndarray,
linear_velocity: np.ndarray | None = None,
angular_velocity: np.ndarray | None = None,
pose_covariance: np.ndarray | None = None,
twist_covariance: np.ndarray | None = None,
header: Header | None = None,
)

Description:

Construct an OdomState instance.

Parameters:

Parameter

Type

Required

Description

child_frame_id

str

Yes

Child frame

position

np.ndarray

Yes

Position [x, y, z], unit m

orientation

np.ndarray

Yes

Quaternion [x, y, z, w]

linear_velocity

np.ndarray | None

No

Linear velocity [x, y, z], unit m/s

angular_velocity

np.ndarray | None

No

Angular velocity [x, y, z], unit rad/s

pose_covariance

np.ndarray | None

No

Pose 6x6 covariance matrix

twist_covariance

np.ndarray | None

No

Velocity 6x6 covariance matrix

header

Header | None

No

Odometry metadata header; when not provided or set to None, uses default Header

Returns:

OdomState instance.

Raises:

None.

to_numpy​

Signature:

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

Description:

Returns a dictionary of all available vectors and covariance matrices. Includes position / orientation / rpy; optional fields linear_velocity / angular_velocity / pose_covariance / twist_covariance are included when not empty.

Parameters:

No parameters.

Returns:

dict[str, np.ndarray].

Raises:

None.