Robotics & Mechatronics · Embedded execution and hardware contracts
Test communication loss and restart behaviour
Reconnection can restore messages while leaving an old movement request in a queue. Define restart as a new state transition with current evidence, not a continuation inferred from network availability.
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 chapterAfter reading, you can
Demonstrate that reconnecting a robot interface does not silently replay stale motion or lose the physical state assumptions.
State what survives a disconnect
Fictional contract R2 uses command epochs, monotonically increasing sequence within an epoch and a 0.10 s expiry interval on a supported clock. A disconnect inhibits new task acceptance and applies the module’s declared response. Reconnection enters an unarmed state. Old-epoch commands are rejected even if delivered later.
Reference continuity must be established separately. A device reset may lose incremental position, while a network-only interruption may preserve it. A new timestamp does not distinguish those cases without device/reset identity and reference status.
Find the stale-motion replay
Supplied chronology; times share the declared monotonic basis.
| Time / s | Event | Required result |
|---|---|---|
| 1.00 | Epoch 7 command seq 42 issued: move | Accepted while valid |
| 1.04 | Link lost | Enter declared disconnect response |
| 1.30 | Link returns; old seq 42 delivered | Reject: old task/expired |
| 1.32 | Device reports reset; reference unknown | Remain unarmed |
| 1.80 | Reference established; fresh epoch 8 accepted | Ready for explicit new task |
| 1.90 | New epoch 8 seq 1 command | May be accepted if all task preconditions hold |
Inject disconnects at meaningful phases
Test before a command, after acceptance but before application, during motion, while stop is pending and after completion. For each, retain queued command identity, applied output, physical/simulated state and reference treatment. A single reconnect-at-idle case cannot establish in-motion restart behaviour.
For supplied-data study, annotate the table and reject replayed records. In simulation, inject the disconnect and export state/command identities. Physical fault injection must use supported procedures and appropriate equipment arrangements; the curriculum does not prescribe unplugging a live robot.
A timeout is a configured response, not an observation
A framework may provide a command timeout, but its default duration and zero/disabled semantics are version-specific. More importantly, sending zero velocity after timeout does not by itself establish physical stop distance, retained load or a certified protective function.
Record the actual configured timeout, the last valid command time, response time and observed task outcome. Reconnection must not clear a latched task fault without the explicit readiness checks and new command identity.
Apply expiry and epoch rules
The 1.00 s command delivered again at 1.30 s is 0.30 s old, exceeding 0.10 s by 0.20 s. It is expired even before considering epoch. If it were retimestamped by an intermediary, epoch/sequence and original acquisition identity must still prevent it becoming a new command.
After device reset, the position-reference assumption is unknown. Establish it by the configured method, then accept a new epoch and explicit task. A recovered packet stream cannot reconstruct unobserved physical motion during the gap.
Try the reasoning
Does a restored link imply the old task should resume?
Show the answer and reasoning
No. Current state, supported reference and an explicitly accepted new task are required.
Why keep original issue time rather than receipt time for expiry?
Show the answer and reasoning
Receipt time can make a delayed old command appear new; expiry concerns the original command’s validity.
What distinguishes network-only interruption from device reset?
Show the answer and reasoning
Device/reset/epoch identity and reference continuity evidence, not merely fresh messages.
Does a configured timeout establish physical stopping distance?
Show the answer and reasoning
No. It specifies a software response whose physical result requires appropriate observation and testing.
What to carry forward
A restart must reject stale motion and re-establish physical-state assumptions before accepting a new task.
References
Sources supporting this lesson’s explanations and examples.
ros-controls project4 sources
- ros2_control: Lifecycle of a Hardware Componentros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation
- ros2_control: Controller Managerros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation
- ros2_controllers: diff_drive_controllerros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation
- ros2_control: Hardware Components and hardware interface typesros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation