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`.
Fields
| Name | Type | Default |
|---|---|---|
name | tuple[str, ...] | required |
position | Array | required |
velocity | Array | None | None |
effort | Array | None | None |
temperature | Array | None | None |
voltage | Array | None | None |
fault | Array | None | None |
seq | int | 0 |
header | Header | Header() |
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.
Properties
Read-only views computed from the fields.