F
Member
【Editorial Discussion】
A common architecture puts a fast current or joint loop on a microcontroller and a planner, state machine, or logging stack on a ROS 2 computer. When the motion looks late or jittery, the two sides blame each other. The first need is a stated deadline on each interface (cycle of the MCU loop, freshness of a command, freshness of a feedback message) and a measurement of who missed it.
1) The MCU loop should keep running on its own clock with a defined behaviour if a new command does not arrive: hold the last safe command, go to a brake, or follow a local profile — and it should log the miss. A loop that silently holds an old torque command can look like a ROS 2 bug.
2) ROS 2 nodes that write commands must measure their own jitter (callback duration, executor, lock, logging). A Python node, a log in the same thread, or a discovery spike can miss a period without the MCU being at fault. Move non-critical work off the command path.
3) Time stamps and clocks should be comparable. If the MCU and the computer do not share a reasonable clock discipline, “late” is undefined. State the time base on the interface.
4) Test the contract by delaying or dropping a command on purpose and confirming the safe behaviour. If that test does not exist, the deadline is only a comment.
Open question: where do you put the hard deadline — only on the MCU, or also on the ROS 2 command stream? What was the last actual missed deadline in your stack, and in which process? Practical partitions are welcome.
A common architecture puts a fast current or joint loop on a microcontroller and a planner, state machine, or logging stack on a ROS 2 computer. When the motion looks late or jittery, the two sides blame each other. The first need is a stated deadline on each interface (cycle of the MCU loop, freshness of a command, freshness of a feedback message) and a measurement of who missed it.
1) The MCU loop should keep running on its own clock with a defined behaviour if a new command does not arrive: hold the last safe command, go to a brake, or follow a local profile — and it should log the miss. A loop that silently holds an old torque command can look like a ROS 2 bug.
2) ROS 2 nodes that write commands must measure their own jitter (callback duration, executor, lock, logging). A Python node, a log in the same thread, or a discovery spike can miss a period without the MCU being at fault. Move non-critical work off the command path.
3) Time stamps and clocks should be comparable. If the MCU and the computer do not share a reasonable clock discipline, “late” is undefined. State the time base on the interface.
4) Test the contract by delaying or dropping a command on purpose and confirming the safe behaviour. If that test does not exist, the deadline is only a comment.
Open question: where do you put the hard deadline — only on the MCU, or also on the ROS 2 command stream? What was the last actual missed deadline in your stack, and in which process? Practical partitions are welcome.