@ -11,8 +11,8 @@ import argparse
from functools import partial
from functools import partial
from openpilot . common . basedir import BASEDIR
from openpilot . common . basedir import BASEDIR
from openpilot . selfdrive . car . fingerprints import MIGRATION
from openpilot . tools . lib . helpers import save_log
from openpilot . tools . lib . helpers import save_log
from openpilot . tools . lib . logreader import LogReader , ReadMode
from openpilot . tools . lib . logreader import LogReader , ReadMode
juggle_dir = os . path . dirname ( os . path . realpath ( __file__ ) )
juggle_dir = os . path . dirname ( os . path . realpath ( __file__ ) )
@ -24,6 +24,7 @@ PLOTJUGGLER_BIN = os.path.join(juggle_dir, "bin/plotjuggler")
MINIMUM_PLOTJUGGLER_VERSION = ( 3 , 5 , 2 )
MINIMUM_PLOTJUGGLER_VERSION = ( 3 , 5 , 2 )
MAX_STREAMING_BUFFER_SIZE = 1000
MAX_STREAMING_BUFFER_SIZE = 1000
def install ( ) :
def install ( ) :
m = f " { platform . system ( ) } - { platform . machine ( ) } "
m = f " { platform . system ( ) } - { platform . machine ( ) } "
supported = ( " Linux-x86_64 " , " Linux-aarch64 " , " Darwin-arm64 " , " Darwin-x86_64 " )
supported = ( " Linux-x86_64 " , " Linux-aarch64 " , " Darwin-arm64 " , " Darwin-x86_64 " )
@ -69,9 +70,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 } '
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 )
subprocess . call ( cmd , shell = True , env = env , cwd = juggle_dir )
def process ( can , lr ) :
def process ( can , lr ) :
return [ d for d in lr if can or d . which ( ) not in [ ' can ' , ' sendcan ' ] ]
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 ) :
def juggle_route ( route_or_segment_name , can , layout , dbc = None ) :
sr = LogReader ( route_or_segment_name , default_mode = ReadMode . AUTO_INTERACTIVE )
sr = LogReader ( route_or_segment_name , default_mode = ReadMode . AUTO_INTERACTIVE )
@ -82,7 +85,8 @@ def juggle_route(route_or_segment_name, can, layout, dbc=None):
for cp in [ m for m in all_data if m . which ( ) == ' carParams ' ] :
for cp in [ m for m in all_data if m . which ( ) == ' carParams ' ] :
try :
try :
DBC = __import__ ( f " openpilot.selfdrive.car. { cp . carParams . carName } .values " , fromlist = [ ' DBC ' ] ) . DBC
DBC = __import__ ( f " openpilot.selfdrive.car. { cp . carParams . carName } .values " , fromlist = [ ' DBC ' ] ) . DBC
dbc = DBC [ cp . carParams . carFingerprint ] [ ' pt ' ]
fingerprint = cp . carParams . carFingerprint
dbc = DBC [ MIGRATION . get ( fingerprint , fingerprint ) ] [ ' pt ' ]
except Exception :
except Exception :
pass
pass
break
break