robot_msgs

Inertia

Mass m (kg), centre of mass com (m) and the six independent tensor entries (kg·m²).

Import
from robot_msgs.geometry import Inertia
ROS 2geometry_msgs/msg/Inertia

Fields

NameTypeDefault
mfloat0.0
comVector3Vector3()
ixxfloat0.0
ixyfloat0.0
ixzfloat0.0
iyyfloat0.0
iyzfloat0.0
izzfloat0.0

Example

One instance from the package's own test catalog; the output is its real repr().

Inertia(m=0.75, com=Vector3(x=0.0, y=0.01, z=0.04), ixx=0.0012, ixy=1e-06, ixz=-2e-06, iyy=0.0011, iyz=3e-06, izz=0.0004)
to_dict() as JSON
{
  "_type": "geometry/Inertia",
  "m": 0.75,
  "com": {
    "_type": "geometry/Vector3",
    "x": 0.0,
    "y": 0.01,
    "z": 0.04
  },
  "ixx": 0.0012,
  "ixy": 1e-06,
  "ixz": -2e-06,
  "iyy": 0.0011,
  "iyz": 3e-06,
  "izz": 0.0004
}

Long arrays are cut after 16 values and say so with “…”.

Functions

Constructors

Classmethods and staticmethods: ways to build one.

from_array(array: Any) -> Inertia

No docstring.

from_matrix(m: float, com: Vector3, matrix: Any) -> Inertia

From a symmetric (3, 3) tensor; an asymmetric one is refused, never averaged.

from_dict

from Msg
from_dict(data: Mapping[str, Any]) -> M

No docstring.

Methods

Return new values; messages are never mutated.

as_array() -> np.ndarray

(10,) = m, com xyz, ixx ixy ixz iyy iyz izz.

is_physical() -> bool

Positive mass, a positive semi-definite tensor and the triangle inequality on its

rotated(rotation: Quaternion) -> Inertia

Re-expressed in a frame turned by rotation: I' = R·I·Rᵀ, com' = R·com.

to_matrix() -> np.ndarray

The symmetric (3, 3) tensor.

replace

from Msg
replace(**changes: Any) -> M

A copy with some fields changed. Validation runs again.

to_dict

from Msg
to_dict() -> dict[str, Any]

JSON-safe dict with a "_type" key; arrays keep their dtype and shape.

Uses

Types its fields refer to.

Vector3

robot_msgs 0.1.0 @ 2dc6666GitHub · MIT license · generated from the package, not written per type