|
3 | 3 | import cereal.messaging as messaging
|
4 | 4 | from selfdrive.manager.process_config import managed_processes
|
5 | 5 |
|
6 |
| - |
7 | 6 | if __name__ == "__main__":
|
8 |
| - services = ['controlsState', 'deviceState', 'radarState'] # the services needed to be spoofed to start ui offroad |
| 7 | + services = ['controlsState', 'deviceState', 'pandaState'] # the services needed to be spoofed to start ui offroad |
9 | 8 | procs = ['camerad', 'ui', 'modeld', 'calibrationd']
|
10 | 9 |
|
11 | 10 | for p in procs:
|
12 | 11 | managed_processes[p].start()
|
13 | 12 |
|
14 | 13 | pm = messaging.PubMaster(services)
|
15 | 14 |
|
16 |
| - dat_controlsState, dat_deviceState, dat_radar = [messaging.new_message(s) for s in services] |
17 |
| - dat_deviceState.deviceState.started = True |
| 15 | + msgs = {s: messaging.new_message(s) for s in services} |
| 16 | + msgs['deviceState'].deviceState.started = True |
| 17 | + msgs['pandaState'].pandaState.ignitionLine = True |
18 | 18 |
|
19 | 19 | try:
|
20 | 20 | while True:
|
21 |
| - pm.send('controlsState', dat_controlsState) |
22 |
| - pm.send('deviceState', dat_deviceState) |
23 |
| - pm.send('radarState', dat_radar) |
24 |
| - time.sleep(1 / 100) # continually send, rate doesn't matter for deviceState |
| 21 | + time.sleep(1 / 100) # continually send, rate doesn't matter |
| 22 | + for s in msgs: |
| 23 | + pm.send(s, msgs[s]) |
25 | 24 | except KeyboardInterrupt:
|
26 | 25 | for p in procs:
|
27 | 26 | managed_processes[p].stop()
|
0 commit comments