Hi Community,
Tuning Nav2 parameters (like DWB or MPPI) is often an exercise in trial and error. When a robot oscillates or behaves unexpectedly, we usually rely on subjective observations in RViz. It’s difficult to quantify exactly how much we’ve improved the tracking or why the controller is struggling in a specific scenario.
To make this process more data-driven, I’ve developed Astryin—a lightweight Python toolkit designed to analyze and visualize navigation behavior directly from ROS 2 bag files.
Key Technical Highlights:
- Dynamic TF Compensation: Automatically performs time-accurate
map -> odomlookups to align trajectories correctly. - Automated Metrics: Calculates path length, mean/max velocity, and tracking errors with “Motion Windowing” to filter out stationary data.
- Behavioral Synergy: Overlays Global/Local plans with Odometry to help developers correlate a controller’s “thinking” with its physical execution.
Quantitative Metrics
astryin analyze examples/turtlebot3_navigation
Output:
[INFO] [1774939863.695093815] [rosbag2_storage]: Opened database 'examples/turtlebot3_navigation/turtlebot3_navigation_0.db3' for READ_ONLY.
Bag Summary
-------------------------------
Bag duration: 51.39 s
Odom samples: 1511
Plan samples: 138
Motion Window (Automatically Trimmed)
-------------------------------
Motion start: 23.21 s
Motion end: 41.97 s
Motion duration: 18.75 s
Motion odom samples: 552
Trajectory Metrics
-------------------------------
Path length: 3.56 m
Mean velocity: 0.18 m/s
Max velocity: 0.23 m/s
Mean tracking error: 0.055 m
Max tracking error: 0.242 m
Velocity Profile Visualization
astryin plot velocity examples/turtlebot3_navigation
Output:
[INFO] [1773133209.823054913] [rosbag2_storage]: Opened database 'examples/turtlebot3_navigation/turtlebot3_navigation_0.db3' for READ_ONLY.
Comprehensive Trajectory Visualization
astryin plot trajectory examples/turtlebot3_navigation
Output:
[INFO] [1773190749.119507577] [rosbag2_storage]: Opened database 'examples/turtlebot3_navigation/turtlebot3_navigation_0.db3' for READ_ONLY.
This project is currently in the MVP stage, and I’d love to hear your thoughts! What specific metrics do you find yourself constantly wishing you could extract from your navigation bags?

