Ensure you have the following Python packages installed:
pip install rosbag matplotlib pandas tqdm numpy
The rosbag_io_py
package is required for testing the C++ implementation.
- Run the benchmark:
python rosbag_benchmark.py path/to/your/bagfile.bag [--output results.json]
- Visualize results:
python visualize.py results.json [--output-dir benchmark_results]
Run multiple benchmarks and generate statistical analysis:
python run_benchmarks.py path/to/your/bagfile.bag [--runs N] [--output-dir DIR]
Options:
--runs
: Number of benchmark runs (default: 5)--output-dir
: Directory to save results (default: benchmark_stats)
- Detailed test results in JSON format
- Processed bag file using Python implementation
- Processed bag file using C++ implementation (if available)
- Visualization results:
- Processing time comparison chart
- Message throughput comparison chart
- Detailed Markdown report
- Individual JSON results for each run
- Statistical report including:
- Mean processing time
- Standard deviation
- Min/max times
- Median time
- Box plot showing time distribution
- Performance comparison between implementations
# Run a single benchmark
python rosbag_benchmark.py demo.bag
# Run multiple benchmarks with statistics
python run_benchmarks.py demo.bag --runs 10
# Visualize single run results
python visualize.py benchmark_results.json
- Ensure sufficient disk space as output files will be similar in size to input
- Processing large bag files may take considerable time
- If
rosbag_io_py
is not available, only the Python implementation will be tested