mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
Add a minimal debugging tool to show the UI while device not in car (#1937)
* add a minimal uiview file with alias from selfdrive/ui * make ui_debug executable * minimize uiview.py; remove os and functions. the processes exit normally when ctrl+c'ing out of the loop * violating E401 here, save 1 more line * kill on exit * forgot signal * new record! 15 lines * add comments and declare some common variables. don't need to redefine the messages every loop old-commit-hash: 2e59349b2e4bda54942cb96ba6bba9661ee89b4b
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/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]
|
||||
Reference in New Issue
Block a user