IMUState
Represents IMU linear acceleration, angular velocity, and orientation data.
Properties:
Property | Type | Description |
|---|---|---|
|
| IMU metadata header |
Read-only properties:
Property | Type | Description |
|---|---|---|
|
| Linear acceleration |
|
| Angular velocity |
|
| Quaternion |
|
| Timestamp in seconds, equivalent to |
|
| Coordinate frame ID, equivalent to |
|
| Euler angles |
IMUState
Signature:
IMUState(
linear_acceleration: np.ndarray,
angular_velocity: np.ndarray,
orientation: np.ndarray | None = None,
header: Header | None = None,
)
Description:
Construct an IMUState instance.
Parameters:
Parameter | Type | Required | Description |
|---|---|---|---|
|
| Yes | Linear acceleration |
|
| Yes | Angular velocity |
|
| No | Quaternion |
|
| No | IMU metadata header; uses default |
Returns:
IMUState instance.
Raises:
None.
Example:
imu = robot.get_imu()
print(imu.timestamp, imu.frame_id)
# Example output: 1781086228.3448012
print(imu.linear_acceleration)
# Example output: [-0.44691575 0.10313473 9.79927158]
print(imu.rpy)
# Example output: [ 0.01052435 0.04557293 -1.38284385]
to_numpy
Signature:
IMUState.to_numpy() -> dict[str, np.ndarray]
Description:
Returns a dictionary containing available vectors. linear_acceleration and angular_velocity are always present; when orientation is not empty, orientation and rpy are also included.
Parameters:
No parameters.
Returns:
dict[str, np.ndarray].
Raises:
None.