robot_msgs

Twist

Linear and angular velocity of a body, both in the frame the header names.

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

Fields

NameTypeDefault
linearVector3Vector3()
angularVector3Vector3()

Example

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

Twist(linear=Vector3(x=0.1, y=0.0, z=0.0), angular=Vector3(x=0.0, y=0.0, z=0.5))
to_dict() as JSON
{
  "_type": "geometry/Twist",
  "linear": {
    "_type": "geometry/Vector3",
    "x": 0.1,
    "y": 0.0,
    "z": 0.0
  },
  "angular": {
    "_type": "geometry/Vector3",
    "x": 0.0,
    "y": 0.0,
    "z": 0.5
  }
}

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

Functions

Constructors

Classmethods and staticmethods: ways to build one.

from_array(array: Any) -> Twist

No docstring.

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

(6,) = linear xyz then angular xyz.

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.

Operators

Python operators and protocols the type supports.

__add__(other: object) -> Twist

No docstring.

__mul__(scalar: object) -> Twist

No docstring.

__rmul__(scalar: object) -> Twist

No docstring.

__sub__(other: object) -> Twist

No docstring.

Uses

Types its fields refer to.

Vector3

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