path-tracking-metrics

Compute cross-track error, heading error, and path length ratio from rosbag2 navigation recordings.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill path-tracking-metrics-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: path-tracking-metrics
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/path-tracking-metrics
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill path-tracking-metrics-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rosbags, numpy.

What problem does it solve? Evaluating whether a robot's path-following controller is well-tuned requires quantitative metrics, but manually inspecting navigation runs is subjective and slow. This Skill provides concrete metric definitions, quality thresholds, and a ready-to-run analysis script that computes path tracking performance from recorded ROS 2 data. ## Core Features & Use Cases - Six Navigation Metrics: Cross-track error, heading error, path length ratio, time to completion, recovery event count, and average velocity, each with quality thresholds. - rosbag2 Analysis Script: A Python script using the rosbags library that reads /odom and /plan topics and prints mean, max, and standard deviation for each metric. - Tuning Guidance: A symptom-to-action table mapping poor metrics to specific controller critic weights (PathAlignCritic, PathAngleCritic, CostCritic) for Nav2 DWB and MPPI controllers. - Use Case: Record a patrol run with ros2 bag record, run the analysis script, discover a high mean cross-track error, and increase PathAlignCritic.cost_weight to tighten path following. ## Quick Start Record a navigation run with ros2 bag record on the /odom, /plan, /local_plan, /cmd_vel, and /tf topics, then ask the AI to run the analysis script on the bag and interpret the cross-track and heading error results.

Frequently Asked Questions about path-tracking-metrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure cross-track error for a ROS 2 robot?

Record /odom and /plan topics with ros2 bag record, then compute the lateral distance from each odometry position to the nearest point on the planned path. The included Python script automates this using the rosbags library and reports mean, max, and standard deviation.

What is a good cross-track error value for indoor navigation?

For indoor navigation, cross-track error below 0.10 m is excellent and suitable for narrow corridors, while 0.10-0.20 m is normal. Values above 0.30 m indicate significant wandering, usually caused by misconfigured controller critic weights.

How do I record navigation topics with rosbag2?

Run ros2 bag record with the /odom, /plan, /local_plan, /cmd_vel, /tf, and /tf_static topics during a typical patrol run. Including the tf topics allows later replay and transform lookups during offline analysis.

Why is my robot's heading error high during path following?

High heading error means the robot is skewed relative to the path tangent, typically because PathAngleCritic is too weak. Increase PathAngleCritic.cost_weight or lower max_angle_to_furthest in the Nav2 controller configuration.

What does a path length ratio above 1.3 indicate?

A path length ratio above 1.3 means the robot traveled much farther than the planned path, indicating major detours, oscillations, or repeated recovery behaviors. Check the Oscillation critic for DWB or TwirlingCritic for MPPI controllers.

Can I analyze rosbag2 files without a running ROS 2 system?

Yes, the analysis script uses the rosbags Python library, which reads rosbag2 files standalone without a ROS 2 installation. Install it with pip alongside numpy and run the script directly against the bag directory.