mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-03-02 07:53:51 +08:00
version: lp-dp v0.9.5 for EON/C2 date: 2023-09-13T13:36:48 commit: 1d59b81c40b93f37d4a341c5d35b1c3cd293543d
34 lines
1.1 KiB
Python
Executable File
34 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import time
|
|
|
|
from cereal import car, log, messaging
|
|
from openpilot.common.params import Params
|
|
from openpilot.selfdrive.manager.process_config import managed_processes
|
|
|
|
if __name__ == "__main__":
|
|
CP = car.CarParams(notCar=True)
|
|
Params().put("CarParams", CP.to_bytes())
|
|
|
|
procs = ['camerad', 'ui', 'modeld', 'calibrationd']
|
|
for p in procs:
|
|
managed_processes[p].start()
|
|
|
|
pm = messaging.PubMaster(['controlsState', 'deviceState', 'pandaStates', 'carParams'])
|
|
|
|
msgs = {s: messaging.new_message(s) for s in ['controlsState', 'deviceState', 'carParams']}
|
|
msgs['deviceState'].deviceState.started = True
|
|
msgs['carParams'].carParams.openpilotLongitudinalControl = True
|
|
|
|
msgs['pandaStates'] = messaging.new_message('pandaStates', 1)
|
|
msgs['pandaStates'].pandaStates[0].ignitionLine = True
|
|
msgs['pandaStates'].pandaStates[0].pandaType = log.PandaState.PandaType.uno
|
|
|
|
try:
|
|
while True:
|
|
time.sleep(1 / 100) # continually send, rate doesn't matter
|
|
for s in msgs:
|
|
pm.send(s, msgs[s])
|
|
except KeyboardInterrupt:
|
|
for p in procs:
|
|
managed_processes[p].stop()
|