This plotter package includes two tools to plot the generated results:
- Results rendered on a PDF file: handy to share results

- Results rendered in a Jupyter notebook: used to compare multiple experiments

On an Ubuntu system, install the following python3 and texlive packages:
sudo apt-get update
sudo apt-get install python3 python3-pip texlive texlive-pictures texlive-luatex texlive-latex-extraStart a Python virtual environment:
cd plotter
python3 -m venv venv
source venv/bin/activateInstall the required Python packages in that virtual environment:
pip3 install wheel
pip3 install .To generate a PDF from the log file, invoke the perfplot binary installed in the previous step:
perfplot <filename1> <filename2> ...
# When you are finished, deactivate the venv
deactivateThe PDF is created in the same directory as the log file.
Be sure to also check perfplot -h for additional options.
☝️ Common Pitfalls
All of the latency metrics are collected and calculated by the subscriber process. For interprocess communication, it is recommended to provide different suffixes for the log files:
perf_test -c rclcpp-single-threaded-executor --msg Array1k -p 0 -s 1 -l log_sub.csv
perf_test -c rclcpp-single-threaded-executor --msg Array1k -p 1 -s 0 -l log_pub.csvThen, to plot the latency metrics, invoke perfplot on the subscriber's log file. If perfplot is invoked on the publisher's log file, then the CPU and memory metrics will be plotted, but the latency plot will be empty.
For users familiar with Python, plot_logs.ipynb includes an example to
plot and compare multiple results simultaneously.