mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-11 16:02:06 +08:00
100f89a161
* openpilot v0.9.9 release date: 2025-06-05T19:54:08 master commit: 8aadf02b2fd91f4e1285e18c2c7feb32d93b66f5 * AGNOS 12.4 (#35558) agnos12.4 --------- Co-authored-by: Vehicle Researcher <user@comma.ai> Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
30 lines
837 B
Python
Executable File
30 lines
837 B
Python
Executable File
#!/usr/bin/env python3
|
|
import time
|
|
import re
|
|
from panda import Panda
|
|
|
|
RED = '\033[91m'
|
|
GREEN = '\033[92m'
|
|
|
|
def colorize_errors(value):
|
|
if isinstance(value, str):
|
|
if re.search(r'(?i)No error', value):
|
|
return f'{GREEN}{value}\033[0m'
|
|
elif re.search(r'(?i)(?<!No error\s)(err|error)', value):
|
|
return f'{RED}{value}\033[0m'
|
|
return str(value)
|
|
|
|
if __name__ == "__main__":
|
|
|
|
panda = Panda()
|
|
while True:
|
|
print(chr(27) + "[2J") # clear screen
|
|
print("Connected to " + ("internal panda" if panda.is_internal() else "External panda") + f" id: {panda.get_serial()[0]}: {panda.get_version()}")
|
|
for bus in range(3):
|
|
print(f"\nBus {bus}:")
|
|
health = panda.can_health(bus)
|
|
for key, value in health.items():
|
|
print(f"{key}: {colorize_errors(value)} ", end=" ")
|
|
print()
|
|
time.sleep(1)
|