Diagnose a failing launch¶
When a ROS 2 stack won't come up, hand Quatern Code what it left behind: the launch log, the TF tree, the URDF, the params files. It finds the root cause, quotes the evidence, and writes the fix as a diff against your own file, checked before you see it. Nothing is written until you ask.
ros2 launch my_robot nav.launch.py 2>&1 | tee launch.log
quatern diagnose launch.log nav2_params.yaml mybot.urdf
More ways to run it:
quatern diagnose launch.log nav2_params.yaml frames_2026-10-02.gv mybot.urdf
quatern diagnose --robot mybot # its URDF, checked on its newest recording
quatern diagnose --robot mybot --live # and the live robot's streams
quatern diagnose launch.log params.yaml mybot.urdf --bag rosbag2_2026_10_02/ # verify fixes on a bag
quatern diagnose launch.log params.yaml --write # apply the checked fixes
quatern diagnose launch.log params.yaml --agent # the agent explains and writes the fixes
In the REPL, /diagnose <files...> does the same, with the selected robot filled in.
What it reads¶
Each file is recognised by its content, not its name, so pass them in any order:
| Input | How to get it |
|---|---|
| Launch log | ros2 launch ... 2>&1 \| tee launch.log, or a node's file under ~/.ros/log |
| TF tree | ros2 run tf2_tools view_frames (the frames_*.gv file) |
| URDF | The robot's URDF, or xacro robot.urdf.xacro > robot.urdf |
| Parameters | The YAML files your launch passes: Nav2, SLAM Toolbox, ros2_control, robot_localization |
| Topics | ros2 topic list -t > topics.txt |
| A robot | --robot: its URDF and newest recording (--recording ID for another) |
| The live robot | --live: the stream probe from quatern doctor, as findings |
What it finds¶
| Cause | Looks like | The fix it writes |
|---|---|---|
planner_plugin_unknown / plugin_unknown |
Failed to create global planner ... the class X ... does not exist |
The plugin name pluginlib does declare (names are case-sensitive). |
controller_plugin_missing / plugin_missing |
'FollowPath.plugin' parameter not set |
The stock plugin for that server, inserted. |
tf_link_unpublished |
not part of the same tree, two roots in view_frames |
Turns on the odometry source's TF (enable_odom_tf, publish_tf). |
frame_not_in_tf_tree |
Failed to compute odom pose; a *_frame parameter the tree lacks |
The tree's frame for that role. |
message_frame_not_in_tf |
Message Filter dropping message: frame 'laser', with laser in no URDF, view_frames or robot_state_publisher segment |
Where the frame comes from: the driver's frame_id (when you pass its params file), else a fixed URDF link at the sensor's link, so TF has it. Never the costmap. |
sensor_frame_not_in_urdf |
A costmap sensor_frame TF lacks, while the messages' own frame is fine |
sensor_frame set to the sensor's URDF link (or left out). |
qos_incompatible |
offering incompatible QoS ... RELIABILITY_QOS_POLICY |
A QoS override on the subscriber. |
clock_mismatch |
earlier than all the data in the transform cache |
One use_sim_time for every node. |
amcl_no_scans |
No laser scan received ... on the /laser_scan topic |
scan_topic set to the topic the lidar publishes. |
amcl_no_initial_pose |
Please set the initial pose..., set_initial_pose: false |
set_initial_pose: true, from the file's initial_pose, which must be where the robot really starts (or publish one on /initialpose). |
sensor_mount_rotated |
Nothing in any log: the map smears when the robot turns | The URDF joint's yaw that makes the recording's scans line up. |
live_* |
With --live: a stream that doesn't report, is slow or stale |
What quatern doctor advises. |
What you get¶
Each finding gives the cause in plain words, the evidence (exact log lines with line numbers, TF roots, the parameter as written) and the fix:
$ quatern diagnose launch.log nav2_params.yaml
1. planner_server cannot load the plugin 'nav2_navfn_planner/NavFnPlanner': no installed plugin has that name [planner_plugin_unknown]
The global planner plugin is named 'nav2_navfn_planner/NavFnPlanner', and pluginlib only knows nav2_navfn_planner/NavfnPlanner, nav2_smac_planner/SmacPlanner2D, ... Names are case-sensitive; 'nav2_navfn_planner/NavfnPlanner' is almost certainly the one meant. planner_server fails to configure, and the lifecycle manager aborts the whole bringup.
evidence:
launch.log:20: [planner_server-3] [FATAL] [1727532132.170883307] [planner_server]: Failed to create global planner. Exception: According to the loaded plugin descriptions the class nav2_navfn_planner/NavFnPlanner with base class type nav2_core::GlobalPlanner does not exist. ...
nav2_params.yaml:7: planner_server.ros__parameters.GridBased.plugin: nav2_navfn_planner/NavFnPlanner
fix (nav2_params.yaml):
--- a/nav2_params.yaml
+++ b/nav2_params.yaml
@@ -4,7 +4,7 @@
use_sim_time: true
planner_plugins: ["GridBased"]
GridBased:
- plugin: "nav2_navfn_planner/NavFnPlanner"
+ plugin: "nav2_navfn_planner/NavfnPlanner"
tolerance: 0.5
use_astar: false
allow_unknown: true
- checked against the configuration: planner_plugin_unknown is gone and nothing new appears
- unverified: no recording to replay it on (pass --bag, or --robot with a ROS 2 recording)
nothing written; --write applies the checked fixes
How a fix is checked¶
Every fix is a change to your file that Quatern Code (or the agent) writes and then checks. A fix is offered only when:
- It applies to a file you passed, and changes something.
- The file still parses.
- Run over the patched configuration, the detectors no longer find the cause, and find nothing they didn't find before.
The detectors judge the configuration, with the logs as the pointer and the quote. That's what makes step 3 possible: the log is history, the configuration is what you'll launch next.
On a recording¶
A fix is called verified on recording only when a recording was replayed through it and passed. Every fix ends with one of these lines:
verified on recording <id>: ...A recording of the robot (--bag, or a ROS 2 or simulator capture of--robot, through its capture context) was replayed through a check of the patched files. The frame each recorded sensor message is stamped in must be one TF has; every topic a node subscribes to must be in the recording; every subscriber that asks for reliable delivery must get it from the QoS the publisher offered. When the replay shows the fix wouldn't work (the recording is stamped in yet another frame), the fix is rejected, not labelled.replayed <capture>: .../mount check passed ...The sensor mount, replayed on the robot's recording: its scans are laid along its odometry once per candidate mount (the URDF's, and a quarter, half and three-quarter turn from it), and the fix is the mount whose map is clearly sharpest. The recording must turn the robot a quarter turn or more.unverified: <why>There's no recording; or it carries no message frames, topics or QoS (no rosbag2 and no capture context); or a QoS fix meets a bag whose offered QoS is empty, with no graph snapshot to say what the publisher offered; or the cause isn't one a recording can show (a plugin name, an initial pose, a node's clock). The fix is still checked against the configuration, and confirming it takes a relaunch of the real stack.
Fixes are printed, not written. --write applies each checked fix to its file. A second fix to a file an earlier one changed is skipped, with a note to run again.
With the agent¶
quatern diagnose ... --agent, or asking the agent in the REPL, gives the agent two tools: diagnose_stack, which returns the findings above, and propose_fix, which takes the agent's own fix (the whole new file, or one parameter to set) and returns the diff only if it passes the same checks, otherwise the reason it was rejected. The agent explains each cause from its evidence and offers only fixes those tools returned. Neither tool writes anything.
Flags¶
| Flag | Meaning |
|---|---|
files |
Launch logs, view_frames .gv output, URDFs, params files, ros2 topic list -t output. |
--robot R |
Also check this robot: its URDF and newest recording. |
--recording ID |
Capture to verify fixes on (default: the robot's newest). |
--bag DIR |
A rosbag2 directory of the robot: fixes are replayed against its topics, QoS and message frames. |
--live |
Also probe the live robot's streams (needs --robot). |
--target T |
Target to probe with --live. |
--probe-seconds S |
How long the live probe watches. |
--write |
Apply every checked fix to its file. |
--agent |
Have the agent explain the findings and write (and check) the fixes. |
--json |
Findings, evidence and diffs as JSON, for CI. |
Exits 1 when it found a cause, 0 when it found none, 2 when an input couldn't be read.
Next¶
After a fix, run quatern regress to check nothing else got worse, then deploy as usual: the gate still asks before anything moves.