GLOBAL KNOWLEDGE ARK

Robotics & Mechatronics · Embedded execution and hardware contracts

Define command/state units, timestamps and validity

A robot message needs more than a numerical value. State exactly which quantity it represents, its unit and reference, when it was acquired or is to apply, and which conditions make it usable.

All numerical tables, scenarios and records are original constructed teaching data unless a specific external dataset is named. No physical experiment is claimed. A worked simulation model is distinguished from an executed simulator.

Lesson preparation and course links

Use the local explanations and supplied units, diagrams, tables and examples; advanced chapters build on the named local chapters. External links are point-of-need depth, not a requirement to finish an entire map.

Back to the Robotics chapter

After reading, you can

Make position, velocity, effort, enable and fault fields unambiguous across a controller and device interface.

01

Define a command/state contract

Contract C1 is a fictional one-axis message pair. Fields are illustrative and do not claim to be ROS message definitions.

Define a command/state contract
FieldCommand meaningState meaning
quantity/unitposition in radmeasured joint angle in rad
referencejoint-zero version J3same supported J3 calibration/reference
timeapply-at in device monotonic clockacquired-at in mapped sensor clock
identitysession epoch and command sequenceacquisition sequence and configuration ID
validitywithin range and unexpired; explicit acceptancefinite, fresh, referenced, quality accepted
effortif used: N·m, separate modeestimated or measured torque must be labelled
02

Dimensional consistency is part of the interface

A field called effort can mean torque for a rotational joint or force for a linear joint. Current in amperes is not torque without an explicit supported conversion. A position array must retain joint ordering as well as unit. A swapped index can be numerically plausible while moving the wrong axis.

SI conventions help interoperability, but a driver or device can use counts, degrees or millimetres internally. Transform exactly once at an explicit boundary and retain raw values. Double conversion is as wrong as missing conversion.

03

Distinguish apply time, acquisition time and receipt time

A command queued at 1.000 s for application at 1.020 s differs from a state acquired at 1.015 s and received at 1.030 s. Controller decisions must use the age and alignment appropriate to their question. Network receipt time does not reveal acquisition age by itself.

Compare times only through a supported clock mapping. Clock drift, reset and synchronisation uncertainty can invalidate the relationship. An epoch identifies a restart/session change so an old timestamp or sequence cannot masquerade as current.

04

Find the contract defect

Assume the consumer expects C1 and all unspecified fields are otherwise valid.

Find the contract defect
Incoming recordDefect
position=90, unit=degreeUnit differs; convert at declared boundary or reject
joint order [elbow, shoulder] instead of [shoulder, elbow]Identity/order mismatch
position=0.2 rad, reference J2Reference mismatch
acquired clock restarted; old mapping retainedAge/alignment unsupported
effort=1.0 A labelled N·mQuantity mismatch, not just formatting
05

Keep enough raw evidence to reconstruct the decision

Store raw message identity, conversion version, clock mapping, accepted command and applied/observed response. A later analyst should be able to distinguish rejection, delayed application, wrong conversion and genuine tracking error.

A contract test feeds valid, boundary and malformed records through the interface and checks its logged response. It is an implementation check, not a general AI estimation or frame-theory lesson.

Align a command and an observation

Command application is scheduled for 1.020 s. A position sample acquired 1.015 s predates it by 5 ms even if received 1.030 s. It cannot demonstrate the response to that command.

A later sample acquired 1.025 s is 5 ms after application, subject to clock-mapping uncertainty. If mapping uncertainty is±8 ms, the relative ordering is not firmly established by those timestamps alone. Report that timing limitation rather than assigning a precise 5 ms response.

Try the reasoning

  1. Why is receipt time insufficient to establish sensor age?

    Show the answer and reasoning

    Acquisition and transport delay can differ. The record needs acquisition time and a supported mapping.

  2. Can 1 A be relabelled 1 N·m?

    Show the answer and reasoning

    No. A supported torque/current relationship and conditions are required; they are different physical quantities.

  3. Why include an epoch as well as sequence?

    Show the answer and reasoning

    A restart can reset counters and clocks. Epoch distinguishes old-session records from current ones.

  4. What is 90° in radians?

    Show the answer and reasoning

    π/2≈1.5708 rad, converted once at the declared boundary.

What to carry forward

Units, reference, identity and timestamp meaning are part of the robot value. A plausible number with the wrong contract is unusable.

References

Sources supporting this lesson’s explanations and examples.

  1. ros-controls project2 sources
    1. ros2_control: Hardware Components and hardware interface typesros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentationcontrol.ros.orgRead source
    2. ros2_control: Controller Managerros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentationcontrol.ros.orgRead source
  2. REP 103: Standard Units of Measure and Coordinate ConventionsTully Foote, Mike PurvisOfficial informational specificationCreated 7 October 2010; post-history 31 December 2014ros.orgRead source