robot_msgs

ServoState

position[i] (rad or m), velocity[i], effort[i] (N·m or N) belong to servo name[i].

Full docstring
`header.stamp` is when the sample was taken (s): every timing metric (sensor-to-command latency,
period jitter, stalls) is measured from it, so a driver must set it. `seq` counts samples from
one driver, so a dropped or repeated sample shows as a gap or a repeat.
`temperature` is °C (as ROS sensor_msgs/Temperature), `voltage` V, `fault` the board's integer
fault code per servo with 0 = no fault. Unmeasured fields are `None`.
Import
from robot_msgs.control import ServoState
ROS 2no ROS equivalent

Fields

NameTypeDefault
nametuple[str, ...]required
positionArrayrequired
velocityArray | NoneNone
effortArray | NoneNone
temperatureArray | NoneNone
voltageArray | NoneNone
faultArray | NoneNone
seqint0
headerHeaderHeader()

Example

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

ServoState(name=('j1', 'j2', 'j3'), position=[0.1, 0.2, 0.3], velocity=[0. , 0.1, 0. ], effort=[ 0.5, -0.2,  0. ], temperature=[31. , 30.5, 29. ], voltage=[24.1, 24. , 24.1], fault=[0, 0, 0], seq=812, header=Header(stamp=1761600000.25, frame_id='camera_color_optical_frame'))
to_dict() as JSON
{
  "_type": "control/ServoState",
  "name": ["j1", "j2", "j3"],
  "position": {
    "dtype": "<f8",
    "shape": [3],
    "data": [0.1, 0.2, 0.3]
  },
  "velocity": {
    "dtype": "<f8",
    "shape": [3],
    "data": [0.0, 0.1, 0.0]
  },
  "effort": {
    "dtype": "<f8",
    "shape": [3],
    "data": [0.5, -0.2, 0.0]
  },
  "temperature": {
    "dtype": "<f8",
    "shape": [3],
    "data": [31.0, 30.5, 29.0]
  },
  "voltage": {
    "dtype": "<f8",
    "shape": [3],
    "data": [24.1, 24.0, 24.1]
  },
  "fault": {
    "dtype": "<i8",
    "shape": [3],
    "data": [0, 0, 0]
  },
  "seq": 812,
  "header": {
    "_type": "std/Header",
    "stamp": 1761600000.25,
    "frame_id": "camera_color_optical_frame",
    "meta": {}
  }
}

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

Functions

Constructors

Classmethods and staticmethods: ways to build one.

from_dict

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

No docstring.

Properties

Read-only views computed from the fields.

faulted: bool

True when any servo reports a non-zero fault code.

Methods

Return new values; messages are never mutated.

joint_state() -> JointState

The kinematic part, as the rest of the stack reads joints.

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.

__len__() -> int

No docstring.

Uses

Types its fields refer to.

Header

robot_msgs 0.2.0 @ 22ec67fGitHub · MIT license · generated from the package, not written per type