﻿# Diff-drive chained mode: the topic command timeout does not automatically guard reference interfaces

Trace the chained update path before inheriting cmd_vel_timeout as a freshness guarantee for body-velocity references written by another controller.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/robotics-diffdrive-chained-reference-topic-timeout-scope/
Language: en

## A mode change moves the freshness responsibility

A mobile base previously received stamped velocity messages and used cmd_vel_timeout. An integration changes it to chained mode, with another controller writing body-velocity reference interfaces. The application keeps the timeout parameter and assumes it protects the new path unchanged. That assumption requires a dispatch review. A configuration parameter can remain present while the method containing its check is no longer called. Identify who now establishes that the reference is current before treating the mode change as behaviorally equivalent.

## Chained references replace the subscriber input path

The [diff-drive guide](https://control.ros.org/kilted/doc/ros2_controllers/diff_drive_controller/doc/userdoc.html) describes linear and angular velocity references supplied by a preceding controller in chained mode. Its ordinary topic input uses a stamped velocity command. These are different input contracts. A bare reference value does not automatically carry the message header that the topic path uses for age. Preserve the active mode and actual producer in the interface inventory rather than assuming all body-velocity commands enter through the same freshness check.

## The reviewed dispatch skips the method containing the check

The reviewed [chainable base](https://raw.githubusercontent.com/ros-controls/ros2_control/kilted/controller_interface/src/chainable_controller_interface.cpp) calls update_reference_from_subscribers only outside chained mode. The [diff-drive implementation](https://raw.githubusercontent.com/ros-controls/ros2_controllers/kilted/diff_drive_controller/src/diff_drive_controller.cpp) places its message-age comparison and timeout zeroing in that method. Its command-writing method reads the reference interfaces separately. Together these paths show why the topic watchdog cannot simply be credited to the chained path. This is scoped source review; an upstream controller or hardware layer may implement another independently qualified timeout.

## Assign a reference-validity contract upstream

Define how the preceding controller detects stale intent, invalid input and its own failure. Decide what it writes or how the controller chain transitions when a reference is no longer valid. Review update ordering and resource ownership so an old value is not mistaken for a newly computed command. The goal is an explicit chain-level contract, not an instruction to duplicate the topic timestamp blindly. Any conversion from a stamped external request into a reference should retain enough provenance to explain its continued use.

## Compare paths with a passive stalled producer

Propose dummy hardware and a reference producer that stops refreshing its intent while the lower update loop continues. Compare the ordinary stamped-topic timeout case with chained operation under the declared upstream policy. Observe references, generated wheel commands, lifecycle outcomes and the actual freshness decision. No controller or base was run here. Acceptance requires the chain’s specified response to invalid reference age, not the mere presence of a timeout parameter. Generated zero commands still do not independently establish physical standstill.

## Retain the active input path with the result

[SmolVLA queue refill](/journal/fg2-smolvla-async-action-queue-refill-overlap/) addresses another source of stale action content. [Request timeout boundaries](/journal/provider-request-deadline-stage-budget/) show why a timer’s location matters. For the base, retain mode, upstream owner, validity rule and observed output path. Repeat the fixture after changing controller composition. The resulting evidence establishes which layer handles stale intent; it does not extend a topic-only check into a universal command watchdog or certify the robot’s complete stopping behavior.
