dragonpilot beta3

date: 2023-10-09T10:55:55
commit: 91b6e3aecd7170f24bccacb10c515ec281c30295
This commit is contained in:
dragonpilot
2023-10-09 10:54:45 -07:00
parent a9ba3193e2
commit cfe0ae9b8a
518 changed files with 159750 additions and 17402 deletions

View File

@@ -1,17 +1,17 @@
#!/usr/bin/env python3
import argparse
import binascii
import time
from collections import defaultdict
import cereal.messaging as messaging
from common.realtime import sec_since_boot
def can_printer(bus, max_msg, addr, ascii_decode):
logcan = messaging.sub_sock('can', addr=addr)
start = sec_since_boot()
lp = sec_since_boot()
start = time.monotonic()
lp = time.monotonic()
msgs = defaultdict(list)
while 1:
can_recv = messaging.drain_sock(logcan, wait_for_one=True)
@@ -20,17 +20,17 @@ def can_printer(bus, max_msg, addr, ascii_decode):
if y.src == bus:
msgs[y.address].append(y.dat)
if sec_since_boot() - lp > 0.1:
if time.monotonic() - lp > 0.1:
dd = chr(27) + "[2J"
dd += f"{sec_since_boot() - start:5.2f}\n"
dd += f"{time.monotonic() - start:5.2f}\n"
for addr in sorted(msgs.keys()):
a = f"\"{msgs[addr][-1].decode('ascii', 'backslashreplace')}\"" if ascii_decode else ""
x = binascii.hexlify(msgs[addr][-1]).decode('ascii')
freq = len(msgs[addr]) / (sec_since_boot() - start)
freq = len(msgs[addr]) / (time.monotonic() - start)
if max_msg is None or addr < max_msg:
dd += "%04X(%4d)(%6d)(%3dHz) %s %s\n" % (addr, addr, len(msgs[addr]), freq, x.ljust(20), a)
print(dd)
lp = sec_since_boot()
lp = time.monotonic()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="simple CAN data viewer",

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python3
import argparse
import numpy as np
import time
from collections import defaultdict, deque
from typing import DefaultDict, Deque, MutableSequence
from common.realtime import sec_since_boot
import cereal.messaging as messaging
@@ -22,7 +22,7 @@ if __name__ == "__main__":
rcv_times: DefaultDict[str, MutableSequence[float]] = defaultdict(lambda: deque(maxlen=100))
valids: DefaultDict[str, Deque[bool]] = defaultdict(lambda: deque(maxlen=100))
t = sec_since_boot()
t = time.monotonic()
for name in socket_names:
sock = messaging.sub_sock(name, poller=poller)
sockets[sock] = name
@@ -36,7 +36,7 @@ if __name__ == "__main__":
name = msg.which()
t = sec_since_boot()
t = time.monotonic()
rcv_times[name].append(msg.logMonoTime / 1e9)
valids[name].append(msg.valid)

View File

@@ -8,7 +8,7 @@ import cereal.messaging as messaging
from hexdump import hexdump
from cereal import log
from cereal.services import service_list
from cereal.services import SERVICE_LIST
codecs.register_error("strict", codecs.backslashreplace_errors)
@@ -31,7 +31,7 @@ if __name__ == "__main__":
poller = messaging.Poller()
for m in args.socket if len(args.socket) > 0 else service_list:
for m in args.socket if len(args.socket) > 0 else SERVICE_LIST:
messaging.sub_sock(m, poller, addr=args.addr)
values = None

View File

@@ -4,8 +4,8 @@ import argparse
import json
import cereal.messaging as messaging
from tools.lib.logreader import LogReader
from tools.lib.route import Route
from openpilot.tools.lib.logreader import LogReader
from openpilot.tools.lib.route import Route
LEVELS = {
"DEBUG": 10,

View File

@@ -62,6 +62,10 @@ SUPPORTED_FW_VERSIONS = {
b"TM__ SCC F-CUP 1.00 1.02 99110-S2000\x18\x07\x08\x18W ": ConfigValues(
default_config=b"\x00\x00\x00\x01\x00\x00",
tracks_enabled=b"\x00\x00\x00\x01\x00\x01"),
# 2021 K5 HEV
b"DLhe SCC FHCUP 1.00 1.02 99110-L7000 \x01 \x102 ": ConfigValues(
default_config=b"\x00\x00\x00\x01\x00\x00",
tracks_enabled=b"\x00\x00\x00\x01\x00\x01"),
}
if __name__ == "__main__":

View File

@@ -2,8 +2,8 @@
import time
from cereal import car, log, messaging
from common.params import Params
from selfdrive.manager.process_config import managed_processes
from openpilot.common.params import Params
from openpilot.selfdrive.manager.process_config import managed_processes
if __name__ == "__main__":
CP = car.CarParams(notCar=True)

View File

@@ -144,6 +144,7 @@ if __name__ == "__main__":
uds_client.write_data_by_identifier(VOLKSWAGEN_DATA_IDENTIFIER_TYPE.CODING, new_coding) # type: ignore
except (NegativeResponseError, MessageTimeoutError):
print("Writing new configuration failed!")
print("Make sure the comma processes are stopped: tmux kill-session -t comma")
quit()
try: