2021-02-11 22:40:12 -08:00
# PlotJuggler
2021-11-28 14:19:49 -08:00
[PlotJuggler ](https://github.com/facontidavide/PlotJuggler ) is a tool to quickly visualize time series data, and we've written plugins to parse openpilot logs. Check out our plugins: https://github.com/commaai/PlotJuggler.
2021-02-11 22:40:12 -08:00
## Installation
2022-08-30 02:40:23 -07:00
Once you've [set up the openpilot environment ](../README.md ), this command will download PlotJuggler and install our plugins:
2021-02-11 22:40:12 -08:00
2021-12-31 16:44:57 -08:00
`cd tools/plotjuggler && ./juggle.py --install`
2021-02-11 22:40:12 -08:00
## Usage
2021-02-17 20:07:37 -08:00
```
2021-08-16 22:23:42 -07:00
$ ./juggle.py -h
2024-04-01 18:24:23 -04:00
usage: juggle.py [-h] [--demo] [--can] [--stream] [--layout [LAYOUT]] [--install] [--dbc DBC]
2022-07-27 16:19:19 +02:00
[route_or_segment_name] [segment_count]
2021-02-17 20:07:37 -08:00
2021-11-28 14:19:49 -08:00
A helper to run PlotJuggler on openpilot routes
2021-02-17 20:07:37 -08:00
positional arguments:
2022-01-04 06:55:46 -08:00
route_or_segment_name
The route or segment name to plot (cabana share URL accepted) (default: None)
segment_count The number of segments to plot (default: None)
2021-02-17 20:07:37 -08:00
optional arguments:
2022-03-08 01:04:02 +01:00
-h, --help show this help message and exit
--demo Use the demo route instead of providing one (default: False)
--can Parse CAN data (default: False)
--stream Start PlotJuggler in streaming mode (default: False)
--layout [LAYOUT] Run PlotJuggler with a pre-defined layout (default: None)
--install Install or update PlotJuggler + plugins (default: False)
2022-07-27 16:19:19 +02:00
--dbc DBC Set the DBC name to load for parsing CAN data. If not set, the DBC will be automatically
inferred from the logs. (default: None)
2021-02-17 20:07:37 -08:00
```
2021-02-11 22:40:12 -08:00
2022-01-04 06:55:46 -08:00
Examples using route name:
2021-02-11 22:40:12 -08:00
2024-04-01 18:24:23 -04:00
`./juggle.py "a2a0ccea32023010/2023-07-27--13-01-19"`
2021-02-26 19:11:59 -08:00
2024-04-01 18:24:23 -04:00
Examples using segment range:
2022-01-04 06:55:46 -08:00
2024-04-01 18:24:23 -04:00
`./juggle.py "a2a0ccea32023010/2023-07-27--13-01-19/1"`
`./juggle.py "a2a0ccea32023010/2023-07-27--13-01-19/1/q" # use qlogs`
2022-01-04 06:55:46 -08:00
2021-05-21 15:28:06 -05:00
## Streaming
2021-05-20 22:19:06 -05:00
2021-08-16 22:23:42 -07:00
Explore live data from your car! Follow these steps to stream from your comma device to your laptop:
- Enable wifi tethering on your comma device
- [SSH into your device ](https://github.com/commaai/openpilot/wiki/SSH ) and run `cd /data/openpilot && ./cereal/messaging/bridge`
- On your laptop, connect to the device's wifi hotspot
- Start PlotJuggler with `ZMQ=1 ./juggle.py --stream` , find the `Cereal Subscriber` plugin in the dropdown under Streaming, and click `Start` .
2021-05-20 22:19:06 -05:00
2021-08-16 22:23:42 -07:00
If streaming to PlotJuggler from a replay on your PC, simply run: `./juggle.py --stream` and start the cereal subscriber.
2021-05-20 22:19:06 -05:00
## Demo
2021-02-26 19:11:59 -08:00
2021-02-27 21:11:36 -08:00
For a quick demo, go through the installation step and run this command:
2021-02-26 19:11:59 -08:00
2024-05-12 17:00:17 -07:00
`./juggle.py --demo --layout=layouts/demo.xml`
2021-11-28 14:19:49 -08:00
## Layouts
If you create a layout that's useful for others, consider upstreaming it.
2021-11-13 23:16:42 -08:00
2021-11-28 14:19:49 -08:00
### Tuning
2021-11-13 23:16:42 -08:00
2022-04-05 12:30:09 -05:00
Use this layout to improve your car's tuning and generate plots for tuning PRs. Also see the [tuning wiki ](https://github.com/commaai/openpilot/wiki/Tuning ) and tuning PR template.
2021-11-13 23:16:42 -08:00
`--layout layouts/tuning.xml`
2021-02-26 19:11:59 -08:00
2021-02-27 21:11:36 -08:00
