Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jackvice/RoboTerrain/llms.txt
Use this file to discover all available pages before exploring further.
cli_main.py provides the MetricsAnalyzerCLI class, a unified command-line tool that wraps three backend components — MetricsDataLoader, MetricsStatistics, and TimeSeriesVisualizer — into a single workflow for offline analysis of RoboTerrain session logs. You point it at one or more CSV files produced by MetricsNode, specify which metrics and plot types you want, and the tool handles outlier removal, optional time normalization, statistical computation, and figure generation automatically. Output is saved as both PDF and PNG files under a structured output directory, making results easy to share or include in research papers.
Basic Usage
Metric Flags
The following flags are accepted by the-m/--metrics argument. They map to the column names written by MetricsNode in the session CSV files.
| Flag | Full Name | Description |
|---|---|---|
TC | Total Collisions | Cumulative collision count for the session |
CS | Current Collision Status | Binary collision flag (0 or 1) per logging cycle |
SM | Smoothness Metric | Cumulative sum of IMU acceleration + angular velocity magnitudes |
OC | Obstacle Clearance | Rolling average of minimum LIDAR range (meters) |
DT | Distance Traveled | Cumulative Euclidean distance from pose data (meters) |
CV | Velocity Over Rough Terrain (VORT) | Mean wheel odometry speed; recorded as VORT when rough terrain is active |
IM | IMU Acceleration Magnitude | 3-axis linear acceleration magnitude from the latest IMU sample (m/s²) |
RT | Is Rough Terrain | Binary flag — 1 when IMU acceleration exceeds 15.0 m/s² |
VR | Vertical Roughness | Absolute Z-axis IMU acceleration — continuous terrain roughness signal |
CLI Arguments
All arguments are defined in_setup_arguments() inside MetricsAnalyzerCLI.
Positional
| Argument | Type | Description |
|---|---|---|
csv_files | Path (one or more) | Input CSV files to process. Pass multiple paths separated by spaces to enable multi-trial comparison. |
Optional
| Argument | Short | Choices / Type | Default | Description |
|---|---|---|---|---|
--metrics | -m | Any combination of TC CS SM OC DT CV IM RT VR | All metrics | Restrict analysis and plotting to the specified metric flags. |
--plot-types | -p | time_series correlation aggregate comparison | time_series | One or more plot types to generate. Multiple values are space-separated. |
--output-dir | -o | Path | ./output | Root directory for all generated figures and CSV exports. Created automatically if it does not exist. |
--normalize | -n | percentage fixed_interval none | percentage | Time normalization method applied before plotting. percentage maps the session to 0–100%; fixed_interval resamples to a regular grid; none keeps raw ROS timestamps. |
--iqr-multiplier | — | float | 1.5 | Multiplier applied to the interquartile range when identifying outliers. Higher values make outlier removal less aggressive. |
--save-outliers | — | flag | False | When set, rows identified as outliers are written to outliers.csv in the output directory instead of being silently discarded. |
--confidence-level | — | float (0–1) | 0.95 | Confidence level used by MetricsStatistics when computing confidence intervals for rolling statistics. |
--fixed-interval | — | float | 1.0 | Resampling interval in seconds, used only when --normalize fixed_interval is active. |
- All
csv_filesmust exist and have a.csvextension. --confidence-levelmust be strictly between 0 and 1.--iqr-multipliermust be positive.--fixed-intervalmust be positive.
Output Files
All figures are written inside thecombined_metrics/ subdirectory of your chosen output path. The tool saves each figure in both PDF and PNG formats.
<FLAG>_comparison figure is a multi-trial overlay produced by TimeSeriesVisualizer.plot_multi_trial_comparison(). Trial labels are derived from the CSV filenames (stem only, without the .csv extension) so plots are self-annotating.
The tool also prints the mean value of each metric per trial to stdout during processing:
The output directory (and the
combined_metrics/ subdirectory within it) are created automatically by validate_output_dir() before any processing begins. You do not need to create them manually.Velocity vs. Roughness Comparison
When bothCV and VR are included in the selected metrics, the tool generates an additional special figure: velocity_roughness_comparison. This plot is produced by TimeSeriesVisualizer.plot_velocity_roughness_comparison() and overlays Current Velocity (VORT) and Vertical Roughness on dual Y-axes across all trials, making it easy to see whether the rover decelerates in response to terrain roughness events.
combined_metrics/:
Multi-Trial Comparison Example
The following example compares three separate session logs across four metrics and writes results to a custom directory:What this command does
Loads all three trial CSV files, removes outliers with the default IQR multiplier of 1.5, normalizes time as a percentage of total session length, then overlays all three trials in a single time-series figure for each of the four selected metrics.
Output produced
Saves
TC_comparison, OC_comparison, CV_comparison, and IM_comparison figures (PDF + PNG) to ./results/combined_metrics/. Trial names are automatically derived from the CSV filenames.