mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-20 01:13:55 +08:00
* wip: move to pandaStates
* bump cereal
* wip: SafetyMode struct
* move to safetyMode
* fix typo
* this can be None
* fix potential empty pandaStates list
* fix thermald
* fix controlsd
* rename safetyModes to safetyConfigs
* update process_replay
* fix test_models
* bump cereal
old-commit-hash: 91987f38d4
29 lines
913 B
Python
Executable File
29 lines
913 B
Python
Executable File
#!/usr/bin/env python3
|
|
import time
|
|
import cereal.messaging as messaging
|
|
from selfdrive.manager.process_config import managed_processes
|
|
|
|
if __name__ == "__main__":
|
|
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
|
|
|
|
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()
|