robot_msgs

Outcome

The verdict: a FollowJointTrajectory result code, the reason, and the room left.

Full docstring
- `error_code` is `SUCCESSFUL`, `PATH_TOLERANCE_VIOLATED` or `GOAL_TOLERANCE_VIOLATED`,
  taken from the earliest violation; `error_string` names the joint / metric and the numbers.
- `violations`: the first violation per (phase, metric), by time. Empty on success, even when
  the run was still settling early in the goal phase: the goal was met.
- `margins`: ``path/<metric>`` = limit - worst ``|error|`` over the path phase;
  ``goal/<metric>`` = limit - ``|error|`` at the sample where the goal was decided. Negative
  = violated by that much.
- `goal_time`: seconds after the reference ends at which the goal was met; NaN if not met.
- `unchecked`: what a limit asked for but the data could not give (a measured run without
  velocities cannot be held to `stopped_velocity_tolerance`); never silently a pass.
Import
from robot_msgs.compare import Outcome
ROS 2no ROS equivalent

Fields

NameTypeDefault
error_codeintrequired
error_stringstr''
violationstuple[Violation, ...]()
marginsMapping[str, float]{}
goal_timefloatnan
uncheckedtuple[str, ...]()

Example

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

Outcome(error_code=-4, error_string='path tolerance violated: positions/j1 error -0.2041 exceeds limit 0.01 at t=0 s', violations=(Violation(phase='path', metric='positions/j1', t=0.0, error=-0.20409191213851852, limit=0.01), Violation(phase='path', metric='positions/j2', t=0.0, error=0.25556650313141827, limit=0.05)), margins={'path/positions/j1': -0.1940919121385185, 'path/positions/j2': -0.20556650313141828}, goal_time=nan)
to_dict() as JSON
{
  "_type": "compare/Outcome",
  "error_code": -4,
  "error_string": "path tolerance violated: positions/j1 error -0.2041 exceeds limit 0.01 at t=0 s",
  "violations": [
    {
      "_type": "compare/Violation",
      "phase": "path",
      "metric": "positions/j1",
      "t": 0.0,
      "error": -0.20409191213851852,
      "limit": 0.01
    },
    {
      "_type": "compare/Violation",
      "phase": "path",
      "metric": "positions/j2",
      "t": 0.0,
      "error": 0.25556650313141827,
      "limit": 0.05
    }
  ],
  "margins": {
    "path/positions/j1": -0.1940919121385185,
    "path/positions/j2": -0.20556650313141828
  },
  "goal_time": NaN,
  "unchecked": []
}

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.

code_name: str

No docstring.

ok: bool

No docstring.

Methods

Return new values; messages are never mutated.

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.

Violation

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