This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| # import an MS SQL .bak backup file to an MS SQL database, then export all | |
| # tables to csv. run this script as `import.sh <filename>`. It expects to be | |
| # run in the same directory as the backup file. | |
| # this is only tested on my mac (OS X Catalina). I tried to stick to posix, but | |
| # It will probably require some tweaking for you. I hope it gives a general | |
| # sense of what you need to do at the very least. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from tools.lib.logreader import LogReader, MultiLogIterator | |
| from tools.lib.route import Route | |
| from cereal import messaging | |
| from tqdm import tqdm | |
| import time | |
| from panda.python import uds | |
| from selfdrive.test.openpilotci import get_url | |
| from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery | |
| """Given an ECU address, prints back and forth ISO-TP communication between OP and ECU""" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import matplotlib | |
| matplotlib.use('tkagg') | |
| import numpy as np | |
| import scipy | |
| import matplotlib.pyplot as plt | |
| import matplotlib.animation as animation | |
| import time | |
| from common.filter_simple import FirstOrderFilter | |
| from system.micd import calculate_spl, FILTER_DT | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import random | |
| MIN_INTERCEPTOR_1 = 490 | |
| INTERCEPTOR_2_OFFSET = 490 | |
| PANDA_THRSLD = 765 | |
| CS_THRSLD = 30 | |
| # what CANParser does | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from opendbc.can.parser import CANParser | |
| from opendbc.can.packer import CANPacker | |
| from opendbc.can.tests.test_packer_parser import can_list_to_can_capnp | |
| import random | |
| import time | |
| signals = [("BRAKE_SWITCH", "POWERTRAIN_DATA"), ("USER_BRAKE", "VSA_STATUS")] | |
| for _ in range(10): | |
| t = time.time() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| from opendbc.can.parser import CANParser, CANDefine | |
| from selfdrive.car.toyota.values import CAR, DBC | |
| from tools.lib.logreader import LogReader | |
| from tools.lib.route import Route | |
| matplotlib.use('Qt5Agg') | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from tools.lib.route import Route | |
| from tools.lib.logreader import MultiLogIterator | |
| from opendbc.can.parser import CANParser | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| # route = Route("0cf0840158be859e|2021-06-27--23-53-57"), 0, 2 # TOYOTA COROLLA 2017 | |
| route = Route("7627c16a16a6f69b|2021-06-15--07-46-30"), 3, 5 # KIA NIRO HYBRID 2018 | |
| # route = Route("587c6380f108936f|2021-06-11--16-55-45") # SONATA 2020 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from tools.lib.route import Route | |
| from tools.lib.logreader import MultiLogIterator | |
| from opendbc.can.parser import CANParser | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| route = Route("163b34548290d096|2021-06-20--14-56-59"), 13, 17 # oddesey, couldn't find torque | |
| # route = Route("0c03141535b94447|2021-06-12--08-57-29"), 3, 6 # honda civic (TODO: absolutely nothing) | |
| # route = Route("e5554665e107572b|2021-06-20--17-11-06") # insight, same here | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import time | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| MPH_TO_MS = 0.44704 | |
| FT_TO_M = 0.3048 | |
| def start_simulation(v_ego, a_ego, v_lead, a_lead, x_lead, rate=20, plot=True): | |
| """ |