Part of ros2-doctor-tools , an index of my ROS 2 diagnosis, fault injection and evaluation tools.
Install into a ROS 2 workspace (Humble tested; the C++ package also builds in CI on Jazzy and Lyrical):
Or with pip (the launch file example above needs the colcon build):
A pip install puts the armdoc command on your PATH; run it directly. The ros2 run form needs the colcon build.
Docker (nothing else to install; the demo runs a healthy fake arm, then a stalled one, then a fake MoveIt with no planning scene):
Real output from a UR3 in Gazebo: healthy, then the arm controller deactivated, then the sim paused while armdoc was attached. Source: docs/ur3_gazebo_demo.txt , docs/make_screenshot.py .
How the new checks work, and what they cannot see:
NOISY_JOINTS takes the fourth difference of each arm joint's positions (white noise of sigma s gives a standard deviation of 8.4 s; smooth motion cancels out, even a fast sine). It treats samples as evenly spaced, so heavy timing jitter at high joint speed can raise the estimate, and it stays silent below 20 Hz. A sudden step in the data (for example a stream that was delayed catching up) shows up as one report. Tune with --noise-rad .
STREAM_LAG compares a message's header stamp with the time it arrives, using the median of the last 2 s. When the stamps are simulation time, run armdoc with --ros-args -p use_sim_time:=true , otherwise the two clocks differ by years and the check stays silent on purpose. A source that restamps old data is invisible to it. Tune with --lag-max .
MOVEIT_PLAN_FAILED counts goals that went to ABORTED on /move_action/_action/status after armdoc attached; goals that finished before that are history, judged by the goal's own timestamp. It cannot tell you why planning failed, only that it did.
NO_PLANNING_SCENE looks for a publisher on /monitored_planning_scene or a /get_planning_scene service rather than waiting for a message, because MoveIt publishes the scene only when it changes.
The LOG_* rows read WARN and ERROR lines on /rosout from move_group , controller_manager and the controllers, counted over 30 s, each with a hint. The patterns follow the MoveIt 2 and joint_trajectory_controller sources and are tested on the message text and with a fake move_group log line; they have not yet been run against a real stack that emits each one.
Limits come from /robot_description , and are checked only for joints that arm controllers claim (grippers and broadcasters are skipped). Missing-thing checks wait out a startup grace ( --grace , 20 s).
A 50 Hz /joint_states is normal on one arm and a sign of trouble on another. Record normal once, then get warned on drift:
The rate is the median messages per second: plain statistics, no model. A silent stream is still JOINT_STATES_STALE , not a rate finding.
Parameters and launch
ros2 launch armdoc armdoc.launch.py takes ns , moveit , diagnostics , use_sim_time and params_file (default config/armdoc.yaml ). The thresholds in that file are ROS parameters of the armdoc node: period , hints , stale , grace , track_err , stall_time , noise_rad , lag_max . They also work without the launch file:
Parameters win over the matching command-line flags. --once , --ready , --json and --record are command-line only.
/diagnostics (opt-in)
armdoc never publishes anything unless you pass --diagnostics . Then each report goes to /diagnostics as a diagnostic_msgs/DiagnosticArray : one status per finding ( armdoc: , level WARN or ERROR, the message), or a single OK status when the arm looks healthy. It publishes nothing else, and never commands or reconfigures the arm.
Timeline report (visualization)
Record a run, then turn it into a timeline: joint positions with shaded bands where findings were active, a controller lane, and a findings table.
Real recording of a UR3 in Gazebo (80 s): two moves, then arm_controller deactivated (the move commanded meanwhile is ignored, and the arm only follows after reactivation), then the sim paused until /joint_states went silent. Source: docs/ur3_run.jsonl ; open docs/ur3_report.html for the interactive version.
HTML: one self-contained file (inline SVG + a little JS, no network). Hover for a crosshair with every joint value and the findings active at that moment, click a legend entry to hide a joint, light/dark follows the OS. A 1 Hz table of the joint positions is folded under the findings table.
PNG: the same timeline via matplotlib.
Lines break where /joint_states was silent, so a gap is shown as a gap. The controller lane shows only controllers that had been active and then dropped out.
The same report runs in the browser: web/index.html loads your --record log and builds the page with Pyodide, nothing uploaded (no ROS, no numpy needed). Serve the folder with any static host ( python3 -m http.server -d web , or GitHub Pages); web/build.sh refreshes the copied module. Tested in headless Chrome with the bundled UR3 example (same findings as the command line) and a garbage file (clear error).
Try it without a robot
test/fake_arm.py publishes a fake ros2_control graph: healthy, or --freeze , --inactive , --stall , and with --moveit a fake move_group ( --no-scene , --plan-fail ).
Checked with armchaos
armchaos injects noise and lag into a stream; armdoc named both. Raw runs: docs/e2e_noise_lag.txt , docs/e2e_lag_timeline.txt , docs/e2e_moveit.txt .
C++ node (low overhead)
armdoc_cpp is a sibling colcon package with a C++ port of the live joint-state checks, for leaving on to a fast controller:
It covers JOINT_STATES_NONE / STALE , JOINT_NAN , LIMIT_POS , NEAR_LIMIT , LIMIT_VEL , EFFORT_SAT , NOISY_JOINTS and STREAM_LAG , with the same thresholds ( grace , stale , noise_rad , lag_max ). It learns the arm's joints from the controller manager (or the arm_joints parameter), so a gripper at its closed limit is not judged. -p json:=true prints the findings as the same JSON list as armdoc --json . Trajectory goals, MoveIt, --record and /diagnostics stay in the Python tool. Run against a live UR3 Gazebo sim, it reports the arm healthy like the Python tool. A test feeds the same randomized streams to both and requires identical findings. Measured on a 50 Hz fake arm (one 20 s run, busy machine): 0.9% of a core and 22 MB for C++, 5.5% and 65 MB for Python.
Checked on other arms
Besides UR3 and UR5e in Gazebo, armdoc was run (through armchaos) against FANUC (6 joints) and Franka Panda (7 joints, separate gripper controller) on the real ros2_control controller manager with mock hardware: every injected fault was named by the right code. The Fanuc URDF has no effort limit, so EFFORT_SAT cannot fire there. Not a real arm; see armchaos docs/e2e_fanuc_ros2_control.txt and docs/e2e_panda_ros2_control.txt .
Verified on Humble against live Gazebo sims of a UR3 and a UR5e (ros2_control, arm_controller ; the UR3 also with gripper_controller ): healthy, a deactivated controller and a paused sim gave the expected verdicts on both. Both are Universal Robots arms in simulation; no real robot and no non-UR arm has been tested yet. Controller state topics assume /state ( JointTrajectoryControllerState ).
The Docker image and demo were built and run on Docker 29 with ros:humble ; the GitHub Actions workflow itself has not been seen running.
One arm per run; use --ns for each.
Text or --json output; /diagnostics only with --diagnostics .
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
