mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-11 07:52:03 +08:00
27e12ccad7
======================== * Based on latest openpilot 0.7.8 devel. * Added "Reset DP Settings" button. (Thanks to @LOVEChen) * Alert messages changed to concept UI alike design. * Added ability to execute reset_update.sh when press "Exit" button once manager returned errors.
22 lines
792 B
Python
22 lines
792 B
Python
#!/usr/bin/env python3
|
|
import time
|
|
import cereal.messaging as messaging
|
|
from selfdrive.manager import start_managed_process, kill_managed_process
|
|
|
|
services = ['controlsState', 'thermal'] # the services needed to be spoofed to start ui offroad
|
|
procs = ['camerad', 'ui']
|
|
[start_managed_process(p) for p in procs] # start needed processes
|
|
pm = messaging.PubMaster(services)
|
|
|
|
dat_cs, dat_thermal = [messaging.new_message(s) for s in services]
|
|
dat_cs.controlsState.rearViewCam = False # ui checks for these two messages
|
|
dat_thermal.thermal.started = True
|
|
|
|
try:
|
|
while True:
|
|
pm.send('controlsState', dat_cs)
|
|
pm.send('thermal', dat_thermal)
|
|
time.sleep(1 / 100) # continually send, rate doesn't matter for thermal
|
|
except KeyboardInterrupt:
|
|
[kill_managed_process(p) for p in procs]
|