Add openpilot tools

This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent b39097a12d
commit a083b93479
156 changed files with 16482 additions and 0 deletions

3
tools/plotjuggler/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
bin/
bin
*.rlog

View File

@@ -0,0 +1,74 @@
# PlotJuggler
[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.
## Installation
Once you've [set up the openpilot environment](../README.md), this command will download PlotJuggler and install our plugins:
`cd tools/plotjuggler && ./juggle.py --install`
## Usage
```
$ ./juggle.py -h
usage: juggle.py [-h] [--demo] [--qlog] [--ci] [--can] [--stream] [--layout [LAYOUT]] [--install] [--dbc DBC]
[route_or_segment_name] [segment_count]
A helper to run PlotJuggler on openpilot routes
positional arguments:
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)
optional arguments:
-h, --help show this help message and exit
--demo Use the demo route instead of providing one (default: False)
--qlog Use qlogs (default: False)
--ci Download data from openpilot CI bucket (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)
--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)
```
Examples using route name:
`./juggle.py "a2a0ccea32023010|2023-07-27--13-01-19"`
Examples using segment name:
`./juggle.py "a2a0ccea32023010|2023-07-27--13-01-19--1"`
## Streaming
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`.
If streaming to PlotJuggler from a replay on your PC, simply run: `./juggle.py --stream` and start the cereal subscriber.
## Demo
For a quick demo, go through the installation step and run this command:
`./juggle.py --demo --qlog --layout=layouts/demo.xml`
## Layouts
If you create a layout that's useful for others, consider upstreaming it.
### Tuning
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.
`--layout layouts/tuning.xml`
![screenshot](https://i.imgur.com/cizHCH3.png)

180
tools/plotjuggler/juggle.py Normal file
View File

@@ -0,0 +1,180 @@
#!/usr/bin/env python3
import os
import sys
import multiprocessing
import platform
import shutil
import subprocess
import tarfile
import tempfile
import requests
import argparse
from openpilot.common.basedir import BASEDIR
from openpilot.selfdrive.test.openpilotci import get_url
from openpilot.tools.lib.logreader import LogReader
from openpilot.tools.lib.route import Route, SegmentName
from openpilot.tools.lib.helpers import save_log
from urllib.parse import urlparse, parse_qs
juggle_dir = os.path.dirname(os.path.realpath(__file__))
DEMO_ROUTE = "a2a0ccea32023010|2023-07-27--13-01-19"
RELEASES_URL="https://github.com/commaai/PlotJuggler/releases/download/latest"
INSTALL_DIR = os.path.join(juggle_dir, "bin")
PLOTJUGGLER_BIN = os.path.join(juggle_dir, "bin/plotjuggler")
MINIMUM_PLOTJUGGLER_VERSION = (3, 5, 2)
MAX_STREAMING_BUFFER_SIZE = 1000
def install():
m = f"{platform.system()}-{platform.machine()}"
supported = ("Linux-x86_64", "Darwin-arm64", "Darwin-x86_64")
if m not in supported:
raise Exception(f"Unsupported platform: '{m}'. Supported platforms: {supported}")
if os.path.exists(INSTALL_DIR):
shutil.rmtree(INSTALL_DIR)
os.mkdir(INSTALL_DIR)
url = os.path.join(RELEASES_URL, m + ".tar.gz")
with requests.get(url, stream=True, timeout=10) as r, tempfile.NamedTemporaryFile() as tmp:
r.raise_for_status()
with open(tmp.name, 'wb') as tmpf:
for chunk in r.iter_content(chunk_size=1024*1024):
tmpf.write(chunk)
with tarfile.open(tmp.name) as tar:
tar.extractall(path=INSTALL_DIR)
def get_plotjuggler_version():
out = subprocess.check_output([PLOTJUGGLER_BIN, "-v"], encoding="utf-8").strip()
version = out.split(" ")[1]
return tuple(map(int, version.split(".")))
def load_segment(segment_name):
if segment_name is None:
return []
try:
return list(LogReader(segment_name))
except (AssertionError, ValueError) as e:
print(f"Error parsing {segment_name}: {e}")
return []
def start_juggler(fn=None, dbc=None, layout=None, route_or_segment_name=None):
env = os.environ.copy()
env["BASEDIR"] = BASEDIR
env["PATH"] = f"{INSTALL_DIR}:{os.getenv('PATH', '')}"
if dbc:
env["DBC_NAME"] = dbc
extra_args = ""
if fn is not None:
extra_args += f" -d {fn}"
if layout is not None:
extra_args += f" -l {layout}"
if route_or_segment_name is not None:
extra_args += f" --window_title \"{route_or_segment_name}\""
cmd = f'{PLOTJUGGLER_BIN} --buffer_size {MAX_STREAMING_BUFFER_SIZE} --plugin_folders {INSTALL_DIR}{extra_args}'
subprocess.call(cmd, shell=True, env=env, cwd=juggle_dir)
def juggle_route(route_or_segment_name, segment_count, qlog, can, layout, dbc=None, ci=False):
segment_start = 0
if 'cabana' in route_or_segment_name:
query = parse_qs(urlparse(route_or_segment_name).query)
route_or_segment_name = query["route"][0]
if route_or_segment_name.startswith(("http://", "https://", "cd:/")) or os.path.isfile(route_or_segment_name):
logs = [route_or_segment_name]
elif ci:
route_or_segment_name = SegmentName(route_or_segment_name, allow_route_name=True)
route = route_or_segment_name.route_name.canonical_name
segment_start = max(route_or_segment_name.segment_num, 0)
logs = [get_url(route, i) for i in range(100)] # Assume there not more than 100 segments
else:
route_or_segment_name = SegmentName(route_or_segment_name, allow_route_name=True)
segment_start = max(route_or_segment_name.segment_num, 0)
if route_or_segment_name.segment_num != -1 and segment_count is None:
segment_count = 1
r = Route(route_or_segment_name.route_name.canonical_name, route_or_segment_name.data_dir)
logs = r.qlog_paths() if qlog else r.log_paths()
segment_end = segment_start + segment_count if segment_count else None
logs = logs[segment_start:segment_end]
if None in logs:
resp = input(f"{logs.count(None)}/{len(logs)} of the rlogs in this segment are missing, would you like to fall back to the qlogs? (y/n) ")
if resp == 'y':
logs = r.qlog_paths()[segment_start:segment_end]
else:
print("Please try a different route or segment")
return
all_data = []
with multiprocessing.Pool(24) as pool:
for d in pool.map(load_segment, logs):
all_data += d
if not can:
all_data = [d for d in all_data if d.which() not in ['can', 'sendcan']]
# Infer DBC name from logs
if dbc is None:
for cp in [m for m in all_data if m.which() == 'carParams']:
try:
DBC = __import__(f"openpilot.selfdrive.car.{cp.carParams.carName}.values", fromlist=['DBC']).DBC
dbc = DBC[cp.carParams.carFingerprint]['pt']
except Exception:
pass
break
with tempfile.NamedTemporaryFile(suffix='.rlog', dir=juggle_dir) as tmp:
save_log(tmp.name, all_data, compress=False)
del all_data
start_juggler(tmp.name, dbc, layout, route_or_segment_name)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="A helper to run PlotJuggler on openpilot routes",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--demo", action="store_true", help="Use the demo route instead of providing one")
parser.add_argument("--qlog", action="store_true", help="Use qlogs")
parser.add_argument("--ci", action="store_true", help="Download data from openpilot CI bucket")
parser.add_argument("--can", action="store_true", help="Parse CAN data")
parser.add_argument("--stream", action="store_true", help="Start PlotJuggler in streaming mode")
parser.add_argument("--layout", nargs='?', help="Run PlotJuggler with a pre-defined layout")
parser.add_argument("--install", action="store_true", help="Install or update PlotJuggler + plugins")
parser.add_argument("--dbc", help="Set the DBC name to load for parsing CAN data. If not set, the DBC will be automatically inferred from the logs.")
parser.add_argument("route_or_segment_name", nargs='?', help="The route or segment name to plot (cabana share URL accepted)")
parser.add_argument("segment_count", type=int, nargs='?', help="The number of segments to plot")
if len(sys.argv) == 1:
parser.print_help()
sys.exit()
args = parser.parse_args()
if args.install:
install()
sys.exit()
if not os.path.exists(PLOTJUGGLER_BIN):
print("PlotJuggler is missing. Downloading...")
install()
if get_plotjuggler_version() < MINIMUM_PLOTJUGGLER_VERSION:
print("PlotJuggler is out of date. Installing update...")
install()
if args.stream:
start_juggler(layout=args.layout)
else:
route_or_segment_name = DEMO_ROUTE if args.demo else args.route_or_segment_name.strip()
juggle_route(route_or_segment_name, args.segment_count, args.qlog, args.can, args.layout, args.dbc, args.ci)

View File

@@ -0,0 +1,86 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab containers="1" tab_name="tab1">
<Container>
<DockSplitter sizes="0.33362;0.33276;0.33362" count="3" orientation="-">
<DockArea name="CAN RX">
<plot style="Lines" flip_y="false" mode="TimeSeries" flip_x="false">
<range top="1101.875000" left="0.000000" bottom="-26.875000" right="60.526742"/>
<limitY/>
<curve name="/pandaStates/0/canState0/totalRxCnt" color="#f14cc1">
<transform alias="/pandaStates/0/canState0/totalRxCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
<curve name="/pandaStates/0/canState1/totalRxCnt" color="#9467bd">
<transform alias="/pandaStates/0/canState1/totalRxCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
<curve name="/pandaStates/0/canState2/totalRxCnt" color="#ff7f0e">
<transform alias="/pandaStates/0/canState2/totalRxCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
</plot>
</DockArea>
<DockArea name="CAN TX">
<plot style="Lines" flip_y="false" mode="TimeSeries" flip_x="false">
<range top="455.100000" left="0.000000" bottom="-11.100000" right="60.526742"/>
<limitY/>
<curve name="/pandaStates/0/canState0/totalTxCnt" color="#17becf">
<transform alias="/pandaStates/0/canState0/totalTxCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
<curve name="/pandaStates/0/canState1/totalTxCnt" color="#bcbd22">
<transform alias="/pandaStates/0/canState1/totalTxCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
<curve name="/pandaStates/0/canState2/totalTxCnt" color="#1f77b4">
<transform alias="/pandaStates/0/canState2/totalTxCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
</plot>
</DockArea>
<DockArea name="CAN errors">
<plot style="Lines" flip_y="false" mode="TimeSeries" flip_x="false">
<range top="2515.350000" left="0.000000" bottom="-61.350000" right="60.526742"/>
<limitY/>
<curve name="/pandaStates/0/canState0/totalErrorCnt" color="#1f77b4">
<transform alias="/pandaStates/0/canState0/totalErrorCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
<curve name="/pandaStates/0/canState1/totalErrorCnt" color="#d62728">
<transform alias="/pandaStates/0/canState1/totalErrorCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
<curve name="/pandaStates/0/canState2/totalErrorCnt" color="#1ac938">
<transform alias="/pandaStates/0/canState2/totalErrorCnt[Derivative]" name="Derivative">
<options radioChecked="radioCustom" lineEdit="1.0"/>
</transform>
</curve>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<customMathEquations/>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,148 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab tab_name="SOF / EOF (encodeIdx)" containers="1">
<Container>
<DockSplitter orientation="-" sizes="0.500885;0.499115" count="2">
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="35000000.000000" left="0.000000" top="65000000.000000" right="630.006367"/>
<limitY max="6.5e+07" min="3.5e+07"/>
<curve color="#1f77b4" name="/driverEncodeIdx/timestampSof">
<transform name="Derivative" alias="/driverEncodeIdx/timestampSof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#d62728" name="/roadEncodeIdx/timestampSof">
<transform name="Derivative" alias="/roadEncodeIdx/timestampSof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#1ac938" name="/wideRoadEncodeIdx/timestampSof">
<transform name="Derivative" alias="/wideRoadEncodeIdx/timestampSof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="35000000.000000" left="0.000000" top="65000000.000000" right="630.006367"/>
<limitY max="6.5e+07" min="3.5e+07"/>
<curve color="#f14cc1" name="/driverEncodeIdx/timestampEof">
<transform name="Derivative" alias="/driverEncodeIdx/timestampEof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#9467bd" name="/roadEncodeIdx/timestampEof">
<transform name="Derivative" alias="/roadEncodeIdx/timestampEof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#17becf" name="/wideRoadEncodeIdx/timestampEof">
<transform name="Derivative" alias="/wideRoadEncodeIdx/timestampEof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab tab_name="model timings" containers="1">
<Container>
<DockSplitter orientation="-" sizes="0.5;0.5" count="2">
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="0.015143" left="0.000000" top="0.016865" right="630.006367"/>
<limitY/>
<curve color="#ff7f0e" name="/modelV2/modelExecutionTime"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="-0.100000" left="0.000000" top="0.100000" right="630.006367"/>
<limitY/>
<curve color="#f14cc1" name="/modelV2/frameDropPerc"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab tab_name="sensor info" containers="1">
<Container>
<DockSplitter orientation="-" sizes="1" count="1">
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="-0.100000" left="0.000000" top="0.100000" right="630.006367"/>
<limitY/>
<curve color="#bcbd22" name="/driverCameraState/sensor"/>
<curve color="#1f77b4" name="/roadCameraState/sensor"/>
<curve color="#d62728" name="/wideRoadCameraState/sensor"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab tab_name="SOF / EOF (cameraState)" containers="1">
<Container>
<DockSplitter orientation="-" sizes="0.500885;0.499115" count="2">
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="35000000.000000" left="0.000000" top="65000000.000000" right="630.006367"/>
<limitY max="6.5e+07" min="3.5e+07"/>
<curve color="#1f77b4" name="/driverCameraState/timestampSof">
<transform name="Derivative" alias="/driverCameraState/timestampSof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#d62728" name="/roadCameraState/timestampSof">
<transform name="Derivative" alias="/roadCameraState/timestampSof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#1ac938" name="/wideRoadCameraState/timestampSof">
<transform name="Derivative" alias="/wideRoadCameraState/timestampSof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_x="false" mode="TimeSeries" flip_y="false" style="Lines">
<range bottom="35000000.000000" left="0.000000" top="65000000.000000" right="630.006367"/>
<limitY max="6.5e+07" min="3.5e+07"/>
<curve color="#ff7f0e" name="/driverCameraState/timestampEof">
<transform name="Derivative" alias="/driverCameraState/timestampEof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#f14cc1" name="/roadCameraState/timestampEof">
<transform name="Derivative" alias="/roadCameraState/timestampEof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
<curve color="#9467bd" name="/wideRoadCameraState/timestampEof">
<transform name="Derivative" alias="/wideRoadCameraState/timestampEof[Derivative]">
<options lineEdit="1.0" radioChecked="radioCustom"/>
</transform>
</curve>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<customMathEquations/>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,72 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget parent="main_window" name="Main Window">
<Tab containers="1" tab_name="tab1">
<Container>
<DockSplitter count="2" sizes="0.500381;0.499619" orientation="-">
<DockSplitter count="2" sizes="0.5;0.5" orientation="|">
<DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_y="false" flip_x="false">
<range right="632.799721" bottom="-17755.925000" top="771630.925000" left="0.000000"/>
<limitY/>
<curve color="#1f77b4" name="/pandaStates/0/canState0/totalRxCnt"/>
<curve color="#d62728" name="/pandaStates/0/canState1/totalRxCnt"/>
<curve color="#1ac938" name="/pandaStates/0/canState2/totalRxCnt"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_y="false" flip_x="false">
<range right="632.799721" bottom="-18545.500000" top="760365.500000" left="0.000000"/>
<limitY/>
<curve color="#ff7f0e" name="/pandaStates/0/canState0/totalTxCnt"/>
<curve color="#f14cc1" name="/pandaStates/0/canState1/totalTxCnt"/>
<curve color="#9467bd" name="/pandaStates/0/canState2/totalTxCnt"/>
</plot>
</DockArea>
</DockSplitter>
<DockSplitter count="3" sizes="0.333333;0.333333;0.333333" orientation="|">
<DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_y="false" flip_x="false">
<range right="632.799721" bottom="-1.350000" top="55.350000" left="0.000000"/>
<limitY/>
<curve color="#ff7f0e" name="/pandaStates/0/canState0/totalRxLostCnt"/>
<curve color="#f14cc1" name="/pandaStates/0/canState1/totalRxLostCnt"/>
<curve color="#9467bd" name="/pandaStates/0/canState2/totalRxLostCnt"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_y="false" flip_x="false">
<range right="632.799721" bottom="-0.050000" top="2.050000" left="0.000000"/>
<limitY/>
<curve color="#17becf" name="/pandaStates/0/canState0/totalTxLostCnt"/>
<curve color="#bcbd22" name="/pandaStates/0/canState1/totalTxLostCnt"/>
<curve color="#1f77b4" name="/pandaStates/0/canState2/totalTxLostCnt"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" mode="TimeSeries" flip_y="false" flip_x="false">
<range right="632.799721" bottom="-0.100000" top="0.100000" left="0.000000"/>
<limitY/>
<curve color="#17becf" name="/pandaStates/0/canState0/busOffCnt"/>
<curve color="#1ac938" name="/pandaStates/0/canState1/busOffCnt"/>
<curve color="#bcbd22" name="/pandaStates/0/canState2/busOffCnt"/>
</plot>
</DockArea>
</DockSplitter>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,60 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget parent="main_window" name="Main Window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter orientation="-" count="5" sizes="0.2;0.2;0.2;0.2;0.2">
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range top="1.025000" bottom="-0.025000" left="0.018309" right="59.674401"/>
<limitY/>
<curve color="#1f77b4" name="/controlsState/enabled"/>
<curve color="#d62728" name="/pandaStates/0/controlsAllowed"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range top="27.087398" bottom="-0.905168" left="0.018309" right="59.674401"/>
<limitY/>
<curve color="#9467bd" name="/controlsState/cumLagMs"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range top="1.025000" bottom="-0.025000" left="0.018309" right="59.674401"/>
<limitY/>
<curve color="#1f77b4" name="/pandaStates/0/safetyRxInvalid"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range top="158.850000" bottom="-2.850000" left="0.018309" right="59.674401"/>
<limitY/>
<curve color="#d62728" name="/pandaStates/0/safetyTxBlocked"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" mode="TimeSeries" flip_y="false">
<range top="1.025000" bottom="-0.025000" left="0.018309" right="59.674401"/>
<limitY/>
<curve color="#1ac938" name="/carState/gasPressed"/>
<curve color="#ff7f0e" name="/carState/brakePressed"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<customMathEquations/>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,104 @@
<?xml version='1.0' encoding='UTF-8'?>
<root version="2.3.8">
<tabbed_widget parent="main_window" name="Main Window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter orientation="-" sizes="1" count="1">
<DockSplitter orientation="|" sizes="0.5;0.5" count="2">
<DockSplitter orientation="-" sizes="0.500497;0.499503" count="2">
<DockArea name="...">
<plot mode="TimeSeries" style="Lines">
<range top="2.762667" bottom="-3.239397" right="56.512723" left="0.000000"/>
<limitY/>
<curve color="#1f77b4" name="/carState/aEgo"/>
<curve color="#17becf" name="/carState/brake"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" style="Lines">
<range top="5.191867" bottom="-5.724069" right="56.512723" left="0.000000"/>
<limitY/>
<curve color="#1ac938" name="dv/dt"/>
</plot>
</DockArea>
</DockSplitter>
<DockSplitter orientation="-" sizes="0.500497;0.499503" count="2">
<DockArea name="...">
<plot mode="TimeSeries" style="Lines">
<range top="16.065524" bottom="-0.470076" right="56.512723" left="0.000000"/>
<limitY/>
<curve color="#d62728" name="/carState/vEgo"/>
<curve color="#bcbd22" name="/carState/gas"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" style="Lines">
<range top="1.014703" bottom="-0.012971" right="56.512723" left="0.000000"/>
<limitY/>
<curve color="#ff7f0e" name="/model/meta/brakeDisengageProb"/>
<curve color="#f14cc1" name="/model/meta/engagedProb"/>
<curve color="#9467bd" name="/model/meta/steerOverrideProb"/>
</plot>
</DockArea>
</DockSplitter>
</DockSplitter>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad CSV">
<default time_axis=""/>
</plugin>
<plugin ID="DataLoad ROS bags">
<use_header_stamp value="false"/>
<use_renaming_rules value="true"/>
<discard_large_arrays value="true"/>
<max_array_size value="100"/>
</plugin>
<plugin ID="DataLoad Rlog"/>
<plugin ID="DataLoad ULog"/>
<plugin ID="LSL Subscriber"/>
<plugin ID="MQTT Subscriber"/>
<plugin ID="ROS Topic Subscriber">
<use_header_stamp value="false"/>
<use_renaming_rules value="true"/>
<discard_large_arrays value="true"/>
<max_array_size value="100"/>
</plugin>
<plugin ID="UDP Server"/>
<plugin ID="WebSocket Server"/>
<plugin ID="ZMQ Subscriber"/>
<plugin status="idle" ID="ROS /rosout Visualization"/>
<plugin status="idle" ID="ROS Topic Re-Publisher"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations>
<snippet name="dv/dt">
<global>prevX = 0
prevY = 0
is_first = true</global>
<function>if (is_first) then
is_first = false
prevX = time
prevY = value
end
dx = time - prevX
dy = value - prevY
prevX = time
prevY = value
return dy/dx</function>
<linkedSource>/carState/vEgo</linkedSource>
</snippet>
</customMathEquations>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,83 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter count="3" sizes="0.333805;0.33239;0.333805" orientation="-">
<DockArea name="...">
<plot mode="TimeSeries" style="Lines" flip_y="false" flip_x="false">
<range bottom="0.368228" right="196.811937" left="76.646983" top="32.070386"/>
<limitY/>
<curve name="haversine distance [m]" color="#1f77b4"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" style="Lines" flip_y="false" flip_x="false">
<range bottom="-0.259115" right="196.811937" left="76.646983" top="12.637299"/>
<limitY/>
<curve name="/carState/vEgo" color="#17becf"/>
<curve name="/gpsLocationExternal/speed" color="#bcbd22"/>
</plot>
</DockArea>
<DockSplitter count="2" sizes="0.500516;0.499484" orientation="|">
<DockArea name="...">
<plot mode="TimeSeries" style="Lines" flip_y="false" flip_x="false">
<range bottom="-0.100000" right="196.811937" left="76.646983" top="0.100000"/>
<limitY/>
<curve name="/liveLocationKalman/positionGeodetic/std/0" color="#d62728"/>
<curve name="/liveLocationKalman/positionGeodetic/std/1" color="#1ac938"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" style="Lines" flip_y="false" flip_x="false">
<range bottom="-0.449385" right="196.811937" left="76.646983" top="7.160833"/>
<limitY/>
<curve name="/gpsLocationExternal/accuracy" color="#ff7f0e"/>
<curve name="/gpsLocationExternal/verticalAccuracy" color="#f14cc1"/>
<curve name="/gpsLocationExternal/speedAccuracy" color="#9467bd"/>
</plot>
</DockArea>
</DockSplitter>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations>
<snippet name="haversine distance [m]">
<global>R = 6378.137 -- Radius of earth in KM</global>
<function>-- Compute the Haversine distance between
-- two points defined by latitude and longitude.
-- Return the distance in meters
lat1, lon1 = value, v1
lat2, lon2 = v2, v3
dLat = (lat2 - lat1) * math.pi / 180
dLon = (lon2 - lon1) * math.pi / 180
a = math.sin(dLat/2) * math.sin(dLat/2) +
math.cos(lat1 * math.pi / 180) * math.cos(lat2 * math.pi / 180) *
math.sin(dLon/2) * math.sin(dLon/2)
c = 2 * math.atan(math.sqrt(a), math.sqrt(1-a))
d = R * c
distance = d * 1000 -- meters
return distance</function>
<linked_source>/gpsLocationExternal/latitude</linked_source>
<additional_sources>
<v1>/gpsLocationExternal/longitude</v1>
<v2>/liveLocationKalman/positionGeodetic/value/0</v2>
<v3>/liveLocationKalman/positionGeodetic/value/1</v3>
</additional_sources>
</snippet>
</customMathEquations>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,59 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter orientation="-" sizes="0.250401;0.249599;0.250401;0.249599" count="4">
<DockArea name="...">
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="1.391623" left="104.907277" bottom="-2.563614"/>
<limitY/>
<curve name="/carState/aEgo" color="#f14cc1"/>
<curve name="/longitudinalPlan/accels/0" color="#9467bd"/>
<curve name="/carControl/actuators/accel" color="#17becf"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="1.184960" left="104.907277" bottom="-1.811222" />
<limitY/>
<curve name="/controlsState/upAccelCmd" color="#1f77b4"/>
<curve name="/controlsState/uiAccelCmd" color="#d62728"/>
<curve name="/controlsState/ufAccelCmd" color="#1ac938"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="15.862889" left="104.907277" bottom="-0.568809" />
<limitY/>
<curve name="/carState/vEgo" color="#1ac938"/>
<curve name="/longitudinalPlan/speeds/0" color="#ff7f0e"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="1.025000" left="104.907277" bottom="-0.025000" />
<limitY/>
<curve name="/carControl/longActive" color="#1f77b4"/>
<curve name="/carState/gasPressed" color="#d62728"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations/>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,92 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab containers="1" tab_name="tab1">
<Container>
<DockSplitter orientation="-" count="4" sizes="0.249724;0.250829;0.249724;0.249724">
<DockArea name="...">
<plot flip_y="false" style="Lines" flip_x="false" mode="TimeSeries">
<range left="0.000450" top="6.050533" right="2483.624998" bottom="-7.599037"/>
<limitY/>
<curve color="#1ac938" name="Actual lateral accel (roll compensated)"/>
<curve color="#ff7f0e" name="Desired lateral accel (roll compensated)"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" flip_x="false" mode="TimeSeries">
<range left="0.000450" top="5.384416" right="2483.624998" bottom="-7.503945"/>
<limitY/>
<curve color="#1ac938" name="roll compensated lateral acceleration"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" flip_x="false" mode="TimeSeries">
<range left="0.000450" top="1.050000" right="2483.624998" bottom="-1.050000"/>
<limitY/>
<curve color="#0097ff" name="/carState/steeringPressed"/>
<curve color="#d62728" name="/carControl/actuatorsOutput/steer"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" flip_x="false" mode="TimeSeries">
<range left="0.000450" top="80.762969" right="2483.624998" bottom="-2.181837"/>
<limitY/>
<curve color="#f14cc1" name="/carState/vEgo">
<transform alias="/carState/vEgo[Scale/Offset]" name="Scale/Offset">
<options value_offset="0" time_offset="0" value_scale="2.23694"/>
</transform>
</curve>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations>
<snippet name="roll compensated lateral acceleration">
<global></global>
<function>if (v3 == 0 and v4 == 1) then
return (value * v1 ^ 2) - (v2 * 9.81)
end
return 0</function>
<linked_source>/controlsState/curvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
<v3>/carState/steeringPressed</v3>
<v4>/carControl/latActive</v4>
</additional_sources>
</snippet>
<snippet name="Desired lateral accel (roll compensated)">
<global></global>
<function>return (value * v1 ^ 2) - (v2 * 9.81)</function>
<linked_source>/controlsState/desiredCurvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
<snippet name="Actual lateral accel (roll compensated)">
<global></global>
<function>return (value * v1 ^ 2) - (v2 * 9.81)</function>
<linked_source>/controlsState/curvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
</customMathEquations>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,68 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter orientation="-" count="4" sizes="0.249729;0.250814;0.249729;0.249729">
<DockArea name="...">
<plot mode="TimeSeries" flip_x="false" flip_y="false" style="Lines">
<range top="102.500000" right="59.992103" left="0.000000" bottom="-2.500000"/>
<limitY/>
<curve name="/deviceState/cpuUsagePercent/0" color="#1f77b4"/>
<curve name="/deviceState/cpuUsagePercent/1" color="#d62728"/>
<curve name="/deviceState/cpuUsagePercent/2" color="#1ac938"/>
<curve name="/deviceState/cpuUsagePercent/3" color="#ff7f0e"/>
<curve name="/deviceState/cpuUsagePercent/4" color="#f14cc1"/>
<curve name="/deviceState/cpuUsagePercent/5" color="#9467bd"/>
<curve name="/deviceState/cpuUsagePercent/6" color="#17becf"/>
<curve name="/deviceState/cpuUsagePercent/7" color="#bcbd22"/>
<curve name="/deviceState/gpuUsagePercent" color="#1f77b4"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" flip_x="false" flip_y="false" style="Lines">
<range top="64.005001" right="59.992103" left="0.000000" bottom="51.195000"/>
<limitY/>
<curve name="/deviceState/cpuTempC/0" color="#d62728"/>
<curve name="/deviceState/cpuTempC/1" color="#1ac938"/>
<curve name="/deviceState/cpuTempC/2" color="#ff7f0e"/>
<curve name="/deviceState/cpuTempC/3" color="#f14cc1"/>
<curve name="/deviceState/cpuTempC/4" color="#9467bd"/>
<curve name="/deviceState/cpuTempC/5" color="#17becf"/>
<curve name="/deviceState/cpuTempC/6" color="#bcbd22"/>
<curve name="/deviceState/cpuTempC/7" color="#1f77b4"/>
<curve name="/deviceState/gpuTempC/0" color="#d62728"/>
<curve name="/deviceState/gpuTempC/1" color="#1ac938"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" flip_x="false" flip_y="false" style="Lines">
<range top="37.371108" right="59.992103" left="0.000000" bottom="-0.911490"/>
<limitY/>
<curve name="/modelV2/frameDropPerc" color="#f14cc1"/>
</plot>
</DockArea>
<DockArea name="...">
<plot mode="TimeSeries" flip_x="false" flip_y="false" style="Lines">
<range top="-3.593455" right="59.992103" left="0.000000" bottom="-12.190956"/>
<limitY/>
<curve name="/controlsState/cumLagMs" color="#9467bd"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,107 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab containers="1" tab_name="tab1">
<Container>
<DockSplitter count="6" orientation="-" sizes="0.166785;0.166785;0.166075;0.166785;0.166785;0.166785">
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="87.987497" bottom="75.912497" right="301.842654"/>
<limitY/>
<curve name="/deviceState/cpuTempC/0" color="#1f77b4"/>
<curve name="/deviceState/cpuTempC/1" color="#d62728"/>
<curve name="/deviceState/cpuTempC/2" color="#1ac938"/>
<curve name="/deviceState/cpuTempC/3" color="#ff7f0e"/>
<curve name="/deviceState/cpuTempC/4" color="#f14cc1"/>
<curve name="/deviceState/cpuTempC/5" color="#9467bd"/>
<curve name="/deviceState/cpuTempC/6" color="#17becf"/>
<curve name="/deviceState/cpuTempC/7" color="#bcbd22"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="85.861052" bottom="66.496950" right="301.842654"/>
<limitY/>
<curve name="/deviceState/pmicTempC/0" color="#1f77b4"/>
<curve name="/deviceState/gpuTempC/0" color="#d62728"/>
<curve name="/deviceState/gpuTempC/1" color="#1ac938"/>
<curve name="/deviceState/memoryTempC" color="#f14cc1"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="86.207876" bottom="70.665918" right="301.842654"/>
<limitY/>
<curve name="/deviceState/maxTempC" color="#1f77b4"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="1.025000" bottom="-0.025000" right="301.842654"/>
<limitY/>
<curve name="/deviceState/thermalStatus" color="#1f77b4"/>
</plot>
</DockArea>
<DockSplitter count="3" orientation="|" sizes="0.333124;0.333752;0.333124">
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="12.057358" bottom="4.843517" right="301.842654"/>
<limitY/>
<curve name="/deviceState/powerDrawW" color="#ff7f0e"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="100.000000" bottom="0.000000" right="301.842654"/>
<limitY min="0" max="100"/>
<curve name="/deviceState/fanSpeedPercentDesired" color="#9467bd"/>
<curve name="/pandaStates/0/fanPower" color="#1f77b4"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="5018.400000" bottom="255.600000" right="301.842654"/>
<limitY/>
<curve name="/peripheralState/fanSpeedRpm" color="#1f77b4"/>
</plot>
</DockArea>
</DockSplitter>
<DockSplitter count="2" orientation="|" sizes="0.502513;0.497487">
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="100.025000" bottom="14.975000" right="301.842654"/>
<limitY/>
<curve name="/deviceState/cpuUsagePercent/0" color="#1f77b4"/>
<curve name="/deviceState/cpuUsagePercent/1" color="#d62728"/>
<curve name="/deviceState/cpuUsagePercent/2" color="#1ac938"/>
<curve name="/deviceState/cpuUsagePercent/3" color="#ff7f0e"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="0.006955" top="102.500000" bottom="-2.500000" right="301.842654"/>
<limitY/>
<curve name="/deviceState/cpuUsagePercent/4" color="#f14cc1"/>
<curve name="/deviceState/cpuUsagePercent/5" color="#9467bd"/>
<curve name="/deviceState/cpuUsagePercent/6" color="#17becf"/>
<curve name="/deviceState/cpuUsagePercent/7" color="#bcbd22"/>
</plot>
</DockArea>
</DockSplitter>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<customMathEquations/>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,92 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter sizes="0.250298;0.250298;0.249106;0.250298" orientation="-" count="4">
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range bottom="-2.900899" top="3.526047" left="825.563261" right="1415.827546"/>
<limitY/>
<curve name="/controlsState/lateralControlState/torqueState/actualLateralAccel" color="#1f77b4"/>
<curve name="/controlsState/lateralControlState/torqueState/desiredLateralAccel" color="#d62728"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range bottom="-4.577789" top="3.642392" left="825.563261" right="1415.827546"/>
<limitY/>
<curve name="Actual lateral accel (roll compensated)" color="#1ac938"/>
<curve name="Desired lateral accel (roll compensated)" color="#ff7f0e"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range bottom="-1.134948" top="1.052072" left="825.563261" right="1415.827546"/>
<limitY/>
<curve name="/carControl/actuatorsOutput/steer" color="#9467bd">
<transform name="Scale/Offset" alias="/carControl/actuatorsOutput/steer[Scale/Offset]">
<options time_offset="0" value_scale="-1" value_offset="0"/>
</transform>
</curve>
<curve name="/controlsState/lateralControlState/torqueState/f" color="#1f77b4"/>
<curve name="/carState/steeringPressed" color="#ff000f"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range bottom="-1.373608" top="56.208012" left="825.563261" right="1415.827546"/>
<limitY/>
<curve name="carState.vEgo mph" color="#d62728"/>
<curve name="carState.vEgo kmh" color="#1ac938"/>
<curve name="/carState/vEgo" color="#ff7f0e"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations>
<snippet name="carState.vEgo kmh">
<global></global>
<function>return value * 3.6</function>
<linked_source>/carState/vEgo</linked_source>
</snippet>
<snippet name="carState.vEgo mph">
<global></global>
<function>return value * 2.23694</function>
<linked_source>/carState/vEgo</linked_source>
</snippet>
<snippet name="Desired lateral accel (roll compensated)">
<global></global>
<function>return (value * v1 ^ 2) - (v2 * 9.81)</function>
<linked_source>/controlsState/desiredCurvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
<snippet name="Actual lateral accel (roll compensated)">
<global></global>
<function>return (value * v1 ^ 2) - (v2 * 9.81)</function>
<linked_source>/controlsState/curvature</linked_source>
<additional_sources>
<v1>/carState/vEgo</v1>
<v2>/liveParameters/roll</v2>
</additional_sources>
</snippet>
</customMathEquations>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,291 @@
<?xml version='1.0' encoding='UTF-8'?>
<root version="2.3.8">
<tabbed_widget parent="main_window" name="Main Window">
<Tab tab_name="Lateral" containers="1">
<Container>
<DockSplitter orientation="-" count="5" sizes="0.200458;0.199313;0.200458;0.199313;0.200458">
<DockArea name="Velocity [m/s]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="29.954036" bottom="-0.841715" right="631.055584"/>
<limitY/>
<curve color="#0072b2" name="/carState/vEgo"/>
</plot>
</DockArea>
<DockArea name="Curvature [1/m] True [blue] Vehicle Model [purple] Plan [green]">
<plot style="Lines" mode="TimeSeries">
<range left="0.000000" top="0.006648" bottom="-0.003150" right="631.055209"/>
<limitY/>
<curve color="#009e73" name="engaged curvature plan"/>
<curve color="#785ef0" name="engaged curvature vehicle model"/>
<curve color="#0072b2" name="engaged curvature yaw"/>
</plot>
</DockArea>
<DockArea name="Roll [rad]">
<plot style="Lines" mode="TimeSeries">
<range left="0.000000" top="0.166067" bottom="-1.598381" right="631.038276"/>
<limitY/>
<curve color="#ffb000" name="/liveLocationKalman/calibratedOrientationNED/value/0"/>
</plot>
</DockArea>
<DockArea name="Engaged [green] Steering Pressed [blue]">
<plot style="Lines" mode="TimeSeries">
<range left="1.252984" top="1.025000" bottom="-0.025000" right="631.055584"/>
<limitY/>
<curve color="#009e73" name="/controlsState/enabled"/>
<curve color="#0072b2" name="/carState/steeringPressed"/>
</plot>
</DockArea>
<DockArea name="Steering Limited: Rate [orange] Saturated [magenta]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="1.025000" bottom="-0.025000" right="631.055584"/>
<limitY/>
<curve name="/carState/steeringRateLimited" color="#ffb000"/>
<curve name="/controlsState/lateralControlState/pidState/saturated" color="#dc267f"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab tab_name="Longitudinal" containers="1">
<Container>
<DockSplitter orientation="-" count="5" sizes="0.1875;0.1875;0.1875;0.1875;0.25">
<DockArea name="Velocity [m/s] True [blue] Plan [green] Cruise [magenta]">
<plot style="Lines" mode="TimeSeries">
<range left="0.000000" top="42.713492" bottom="-1.041792" right="631.055584"/>
<limitY/>
<curve color="#dc267f" name="/carState/cruiseState/speed"/>
<curve color="#009e73" name="/longitudinalPlan/speeds/0"/>
<curve color="#0072b2" name="/carState/vEgo"/>
</plot>
</DockArea>
<DockArea name="Acceleration [m/s^2] True [blue] Actuator [purple] Plan [green]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="0.808303" bottom="-1.213305" right="631.055759"/>
<limitY/>
<curve color="#009e73" name="engaged_accel_plan"/>
<curve color="#785ef0" name="engaged_accel_actuator"/>
<curve color="#0072b2" name="engaged_accel_actual"/>
</plot>
</DockArea>
<DockArea name="Pitch [rad]">
<plot style="Lines" mode="TimeSeries">
<range left="0.000000" top="0.158854" bottom="-0.594843" right="631.038276"/>
<limitY/>
<curve color="#ffb000" name="/liveLocationKalman/calibratedOrientationNED/value/1"/>
</plot>
</DockArea>
<DockArea name="Engaged [green] Gas [orange] Brake [magenta]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="1.025000" bottom="-0.025000" right="631.055759"/>
<limitY/>
<curve color="#009e73" name="/carControl/enabled"/>
<curve color="#ffb000" name="/carState/gasPressed"/>
<curve color="#dc267f" name="/carState/brakePressed"/>
</plot>
</DockArea>
<DockArea name="State [blue: off,pid,stop,start] Source [green: cruise,lead0,lead1,lead2,e2e]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253620" top="5.125000" bottom="-0.125000" right="631.055759"/>
<limitY/>
<curve color="#0072b2" name="/carControl/actuators/longControlState"/>
<curve color="#009e73" name="/longitudinalPlan/longitudinalPlanSource"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<Tab tab_name="Lateral Debug" containers="1">
<Container>
<DockSplitter orientation="-" count="4" sizes="0.25;0.25;0.25;0.25">
<DockArea name="Controller F [magenta] P [purple] I [blue]">
<plot style="Lines" mode="TimeSeries">
<range left="0.000000" top="1.000000" bottom="0.000000" right="1.000000"/>
<limitY/>
<curve name="/controlsState/lateralControlState/pidState/f" color="#f14cc1"/>
<curve name="/controlsState/lateralControlState/pidState/p" color="#9467bd"/>
<curve name="/controlsState/lateralControlState/pidState/i" color="#17becf"/>
</plot>
</DockArea>
<DockArea name="Driver Torque [blue] EPS Torque [green]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="2690.999030" bottom="-3450.198981" right="631.055584"/>
<limitY/>
<curve color="#009e73" name="/carState/steeringTorqueEps"/>
<curve color="#0072b2" name="/carState/steeringTorque"/>
</plot>
</DockArea>
<DockArea name="Engaged [green] Steering Pressed [blue]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="1.025000" bottom="-0.025000" right="631.055759"/>
<limitY/>
<curve color="#009e73" name="/carControl/enabled"/>
<curve color="#0072b2" name="/carState/steeringPressed"/>
</plot>
</DockArea>
<DockArea name="Steering Limited: Rate [orange] Saturated [magenta]">
<plot style="Lines" mode="TimeSeries">
<range left="1.253354" top="1.025000" bottom="-0.025000" right="631.055584"/>
<limitY/>
<curve name="/carState/steeringRateLimited" color="#ffb000"/>
<curve name="/controlsState/lateralControlState/pidState/saturated" color="#dc267f"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<customMathEquations>
<snippet name="engaged curvature yaw">
<global>engage_delay = 5
last_bad_time = -engage_delay</global>
<function>curvature = value / v3
pressed = v1
enabled = v2
if (pressed == 1 or enabled == 0) then
last_bad_time = time
end
if (time > last_bad_time + engage_delay) then
return curvature
else
return 0
end</function>
<linked_source>/liveLocationKalman/angularVelocityCalibrated/value/2</linked_source>
<additional_sources>
<v1>/carState/steeringPressed</v1>
<v2>/carControl/enabled</v2>
<v3>/liveLocationKalman/velocityCalibrated/value/0</v3>
</additional_sources>
</snippet>
<snippet name="engaged curvature vehicle model">
<global>engage_delay = 5
last_bad_time = -engage_delay</global>
<function>curvature = value
pressed = v1
enabled = v2
if (pressed == 1 or enabled == 0) then
last_bad_time = time
end
if (time > last_bad_time + engage_delay) then
return value
else
return 0
end</function>
<linked_source>/controlsState/curvature</linked_source>
<additional_sources>
<v1>/carState/steeringPressed</v1>
<v2>/carControl/enabled</v2>
</additional_sources>
</snippet>
<snippet name="engaged curvature plan">
<global>engage_delay = 5
last_bad_time = -engage_delay</global>
<function>curvature = value
pressed = v1
enabled = v2
if (pressed == 1 or enabled == 0) then
last_bad_time = time
end
if (time > last_bad_time + engage_delay) then
return value
else
return 0
end</function>
<linked_source>/lateralPlan/curvatures/0</linked_source>
<additional_sources>
<v1>/carState/steeringPressed</v1>
<v2>/carControl/enabled</v2>
</additional_sources>
</snippet>
<snippet name="engaged_accel_actual">
<global>engage_delay = 5
last_bad_time = -engage_delay</global>
<function>accel = value
brake = v1
gas = v2
enabled = v3
if (brake ~= 0 or gas ~= 0 or enabled == 0) then
last_bad_time = time
end
if (time > last_bad_time + engage_delay) then
return value
else
return 0
end</function>
<linked_source>/carState/aEgo</linked_source>
<additional_sources>
<v1>/carState/brakePressed</v1>
<v2>/carState/gasPressed</v2>
<v3>/carControl/enabled</v3>
</additional_sources>
</snippet>
<snippet name="engaged_accel_plan">
<global>engage_delay = 5
last_bad_time = -engage_delay</global>
<function>accel = value
brake = v1
gas = v2
enabled = v3
if (brake ~= 0 or gas ~= 0 or enabled == 0) then
last_bad_time = time
end
if (time > last_bad_time + engage_delay) then
return value
else
return 0
end</function>
<linked_source>/longitudinalPlan/accels/0</linked_source>
<additional_sources>
<v1>/carState/brakePressed</v1>
<v2>/carState/gasPressed</v2>
<v3>/carControl/enabled</v3>
</additional_sources>
</snippet>
<snippet name="engaged_accel_actuator">
<global>engage_delay = 5
last_bad_time = -engage_delay</global>
<function>accel = value
brake = v1
gas = v2
enabled = v3
if (brake ~= 0 or gas ~= 0 or enabled == 0) then
last_bad_time = time
end
if (time > last_bad_time + engage_delay) then
return value
else
return 0
end</function>
<linked_source>/carControl/actuators/accel</linked_source>
<additional_sources>
<v1>/carState/brakePressed</v1>
<v2>/carState/gasPressed</v2>
<v3>/carControl/enabled</v3>
</additional_sources>
</snippet>
</customMathEquations>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,44 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
<tabbed_widget name="Main Window" parent="main_window">
<Tab containers="1" tab_name="tab1">
<Container>
<DockSplitter orientation="-" sizes="0.333333;0.333333;0.333333" count="3">
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range right="134.825489" top="4402341.574525" bottom="-107369.555525" left="0.000000"/>
<limitY/>
<curve name="/gpsLocationExternal/accuracy" color="#1f77b4"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range right="134.825489" top="1.025000" bottom="-0.025000" left="0.000000"/>
<limitY/>
<curve name="/gpsLocationExternal/flags" color="#d62728"/>
</plot>
</DockArea>
<DockArea name="...">
<plot style="Lines" flip_x="false" flip_y="false" mode="TimeSeries">
<range right="134.825489" top="6.150000" bottom="-0.150000" left="0.000000"/>
<limitY/>
<curve name="/ubloxGnss/measurementReport/numMeas" color="#1ac938"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad Rlog"/>
<plugin ID="Cereal Subscriber"/>
</Plugins>
<customMathEquations/>
<snippets/>
<!-- - - - - - - - - - - - - - - -->
</root>

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
import os
import glob
import signal
import subprocess
import time
import unittest
from openpilot.common.basedir import BASEDIR
from openpilot.common.timeout import Timeout
from openpilot.tools.plotjuggler.juggle import install
PJ_DIR = os.path.join(BASEDIR, "tools/plotjuggler")
class TestPlotJuggler(unittest.TestCase):
def test_demo(self):
install()
pj = os.path.join(PJ_DIR, "juggle.py")
with subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog',
stderr=subprocess.PIPE, shell=True, start_new_session=True) as p:
# Wait for "Done reading Rlog data" signal from the plugin
output = "\n"
with Timeout(180, error_msg=output):
while output.splitlines()[-1] != "Done reading Rlog data":
output += p.stderr.readline().decode("utf-8")
# ensure plotjuggler didn't crash after exiting the plugin
time.sleep(15)
self.assertEqual(p.poll(), None)
os.killpg(os.getpgid(p.pid), signal.SIGTERM)
# TODO: also test that layouts successfully load
def test_layouts(self):
bad_strings = (
# if a previously loaded file is defined,
# PJ will throw a warning when loading the layout
"fileInfo",
"previouslyLoaded_Datafiles",
)
for fn in glob.glob(os.path.join(PJ_DIR, "layouts/*")):
name = os.path.basename(fn)
with self.subTest(layout=name):
with open(fn) as f:
layout = f.read()
violations = [s for s in bad_strings if s in layout]
assert len(violations) == 0, f"These should be stripped out of the layout: {str(violations)}"
if __name__ == "__main__":
unittest.main()