mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-20 12:22:04 +08:00
openpilot v0.8.8 release
This commit is contained in:
@@ -44,7 +44,7 @@ def get_arg_parser():
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
|
||||
parser.add_argument("proc_names", nargs="?", default='',
|
||||
help="Process names to be monitored, comma seperated")
|
||||
help="Process names to be monitored, comma separated")
|
||||
parser.add_argument("--list_all", action='store_true',
|
||||
help="Show all running processes' cmdline")
|
||||
parser.add_argument("--detailed_times", action='store_true',
|
||||
|
||||
@@ -24,16 +24,13 @@ def cycle_alerts(duration=2000, is_metric=False):
|
||||
sm = messaging.SubMaster(['deviceState', 'pandaState', 'roadCameraState', 'modelV2', 'liveCalibration',
|
||||
'driverMonitoringState', 'longitudinalPlan', 'lateralPlan', 'liveLocationKalman'])
|
||||
|
||||
controls_state = messaging.pub_sock('controlsState')
|
||||
deviceState = messaging.pub_sock('deviceState')
|
||||
|
||||
idx, last_alert_millis = 0, 0
|
||||
pm = messaging.PubMaster(['controlsState', 'pandaState', 'deviceState'])
|
||||
|
||||
events = Events()
|
||||
AM = AlertManager()
|
||||
|
||||
frame = 0
|
||||
|
||||
idx, last_alert_millis = 0, 0
|
||||
while 1:
|
||||
if frame % duration == 0:
|
||||
idx = (idx + 1) % len(alerts)
|
||||
@@ -50,7 +47,6 @@ def cycle_alerts(duration=2000, is_metric=False):
|
||||
|
||||
dat = messaging.new_message()
|
||||
dat.init('controlsState')
|
||||
|
||||
dat.controlsState.alertText1 = AM.alert_text_1
|
||||
dat.controlsState.alertText2 = AM.alert_text_2
|
||||
dat.controlsState.alertSize = AM.alert_size
|
||||
@@ -58,14 +54,18 @@ def cycle_alerts(duration=2000, is_metric=False):
|
||||
dat.controlsState.alertBlinkingRate = AM.alert_rate
|
||||
dat.controlsState.alertType = AM.alert_type
|
||||
dat.controlsState.alertSound = AM.audible_alert
|
||||
controls_state.send(dat.to_bytes())
|
||||
pm.send('controlsState', dat)
|
||||
|
||||
dat = messaging.new_message()
|
||||
dat.init('deviceState')
|
||||
dat.deviceState.started = True
|
||||
deviceState.send(dat.to_bytes())
|
||||
pm.send('deviceState', dat)
|
||||
|
||||
dat = messaging.new_message()
|
||||
dat.init('pandaState')
|
||||
dat.pandaState.ignitionLine = True
|
||||
pm.send('pandaState', dat)
|
||||
|
||||
frame += 1
|
||||
time.sleep(0.01)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -3,9 +3,8 @@ import time
|
||||
import cereal.messaging as messaging
|
||||
from selfdrive.manager.process_config import managed_processes
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
services = ['controlsState', 'deviceState', 'radarState'] # the services needed to be spoofed to start ui offroad
|
||||
services = ['controlsState', 'deviceState', 'pandaState'] # the services needed to be spoofed to start ui offroad
|
||||
procs = ['camerad', 'ui', 'modeld', 'calibrationd']
|
||||
|
||||
for p in procs:
|
||||
@@ -13,15 +12,15 @@ if __name__ == "__main__":
|
||||
|
||||
pm = messaging.PubMaster(services)
|
||||
|
||||
dat_controlsState, dat_deviceState, dat_radar = [messaging.new_message(s) for s in services]
|
||||
dat_deviceState.deviceState.started = True
|
||||
msgs = {s: messaging.new_message(s) for s in services}
|
||||
msgs['deviceState'].deviceState.started = True
|
||||
msgs['pandaState'].pandaState.ignitionLine = True
|
||||
|
||||
try:
|
||||
while True:
|
||||
pm.send('controlsState', dat_controlsState)
|
||||
pm.send('deviceState', dat_deviceState)
|
||||
pm.send('radarState', dat_radar)
|
||||
time.sleep(1 / 100) # continually send, rate doesn't matter for deviceState
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user