|
|
|
@ -12,18 +12,18 @@ from functools import partial |
|
|
|
|
|
|
|
|
|
from openpilot.common.basedir import BASEDIR |
|
|
|
|
from openpilot.tools.lib.helpers import save_log |
|
|
|
|
|
|
|
|
|
from openpilot.tools.lib.logreader import LogReader, ReadMode |
|
|
|
|
|
|
|
|
|
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" |
|
|
|
|
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", "Linux-aarch64", "Darwin-arm64", "Darwin-x86_64") |
|
|
|
@ -38,7 +38,7 @@ def install(): |
|
|
|
|
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): |
|
|
|
|
for chunk in r.iter_content(chunk_size=1024 * 1024): |
|
|
|
|
tmpf.write(chunk) |
|
|
|
|
|
|
|
|
|
with tarfile.open(tmp.name) as tar: |
|
|
|
@ -69,9 +69,11 @@ def start_juggler(fn=None, dbc=None, layout=None, route_or_segment_name=None): |
|
|
|
|
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 process(can, lr): |
|
|
|
|
return [d for d in lr if can or d.which() not in ['can', 'sendcan']] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def juggle_route(route_or_segment_name, can, layout, dbc=None): |
|
|
|
|
sr = LogReader(route_or_segment_name, default_mode=ReadMode.AUTO_INTERACTIVE) |
|
|
|
|
|
|
|
|
|