mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-20 13:32:04 +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>
34 lines
655 B
Python
Executable File
34 lines
655 B
Python
Executable File
#!/usr/bin/env python3
|
|
import struct
|
|
import time
|
|
|
|
from opendbc.car.structs import CarParams
|
|
from panda import Panda
|
|
|
|
if __name__ == "__main__":
|
|
p = Panda()
|
|
print(p.get_serial())
|
|
print(p.health())
|
|
|
|
t1 = time.time()
|
|
for _ in range(100):
|
|
p.get_serial()
|
|
t2 = time.time()
|
|
print("100 requests took %.2f ms" % ((t2 - t1) * 1000))
|
|
|
|
p.set_safety_mode(CarParams.SafetyModel.allOutput)
|
|
|
|
a = 0
|
|
while True:
|
|
# flood
|
|
msg = b"\xaa" * 4 + struct.pack("I", a)
|
|
p.can_send(0xaa, msg, 0)
|
|
p.can_send(0xaa, msg, 1)
|
|
p.can_send(0xaa, msg, 4)
|
|
time.sleep(0.01)
|
|
|
|
dat = p.can_recv()
|
|
if len(dat) > 0:
|
|
print(dat)
|
|
a += 1
|