diff --git a/cereal b/cereal index 2cb2bfb0154874..65b34b4d152bce 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 2cb2bfb0154874775e56715ecf81f0e6b00538e9 +Subproject commit 65b34b4d152bcea6d49b821bf1da7189f6086b0f diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 96a81dd441568b..aca074c95add90 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -64,7 +64,7 @@ def __init__(self, CI=None): # Setup sockets self.pm = messaging.PubMaster(['sendcan', 'controlsState', 'carState', - 'carControl', 'carEvents', 'carParams']) + 'carControl', 'onroadEvents', 'carParams']) self.sensor_packets = ["accelerometer", "gyroscope"] self.camera_packets = ["roadCameraState", "driverCameraState", "wideRoadCameraState"] @@ -212,7 +212,7 @@ def set_initial_state(self): self.state = State.enabled def update_events(self, CS): - """Compute carEvents from carState""" + """Compute onroadEvents from carState""" self.events.clear() @@ -823,11 +823,11 @@ def publish_logs(self, CS, start_time, CC, lac_log): cs_send.carState.events = car_events self.pm.send('carState', cs_send) - # carEvents - logged every second or on change + # onroadEvents - logged every second or on change if (self.sm.frame % int(1. / DT_CTRL) == 0) or (self.events.names != self.events_prev): - ce_send = messaging.new_message('carEvents', len(self.events)) - ce_send.carEvents = car_events - self.pm.send('carEvents', ce_send) + ce_send = messaging.new_message('onroadEvents', len(self.events)) + ce_send.onroadEvents = car_events + self.pm.send('onroadEvents', ce_send) self.events_prev = self.events.names.copy() # carParams - logged every 50 seconds (> 1 per segment) diff --git a/selfdrive/debug/count_events.py b/selfdrive/debug/count_events.py index a148996d94a58a..a2c3576b6fefc5 100755 --- a/selfdrive/debug/count_events.py +++ b/selfdrive/debug/count_events.py @@ -32,8 +32,8 @@ end_time = max(end_time, msg.logMonoTime) start_time = min(start_time, msg.logMonoTime) - if msg.which() == 'carEvents': - for e in msg.carEvents: + if msg.which() == 'onroadEvents': + for e in msg.onroadEvents: cnt_events[e.name] += 1 elif msg.which() == 'controlsState': if len(alerts) == 0 or alerts[-1][1] != msg.controlsState.alertType: diff --git a/selfdrive/test/process_replay/README.md b/selfdrive/test/process_replay/README.md index bec3eb9016f814..008a9010100756 100644 --- a/selfdrive/test/process_replay/README.md +++ b/selfdrive/test/process_replay/README.md @@ -31,7 +31,7 @@ optional arguments: --blacklist-procs BLACKLIST_PROCS Blacklist given processes from the test (e.g. controlsd) --blacklist-cars BLACKLIST_CARS Blacklist given cars from the test (e.g. HONDA) --ignore-fields IGNORE_FIELDS Extra fields or msgs to ignore (e.g. carState.events) - --ignore-msgs IGNORE_MSGS Msgs to ignore (e.g. carEvents) + --ignore-msgs IGNORE_MSGS Msgs to ignore (e.g. onroadEvents) --update-refs Updates reference logs using current commit --upload-only Skips testing processes and uploads logs from previous test run ``` diff --git a/selfdrive/test/process_replay/conftest.py b/selfdrive/test/process_replay/conftest.py index f3794d26acf361..3f9744ed616b05 100644 --- a/selfdrive/test/process_replay/conftest.py +++ b/selfdrive/test/process_replay/conftest.py @@ -16,7 +16,7 @@ def pytest_addoption(parser: pytest.Parser): parser.addoption("--ignore-fields", type=str, nargs="*", default=[], help="Extra fields or msgs to ignore (e.g. carState.events)") parser.addoption("--ignore-msgs", type=str, nargs="*", default=[], - help="Msgs to ignore (e.g. carEvents)") + help="Msgs to ignore (e.g. onroadEvents)") parser.addoption("--update-refs", action="store_true", help="Updates reference logs using current commit") parser.addoption("--upload-only", action="store_true", diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index a26e9645504d34..77c4ab1eabe118 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -442,8 +442,8 @@ def controlsd_config_callback(params, cfg, lr): controlsState = msg.controlsState if initialized: break - elif msg.which() == "carEvents": - initialized = car.CarEvent.EventName.controlsInitializing not in [e.name for e in msg.carEvents] + elif msg.which() == "onroadEvents": + initialized = car.CarEvent.EventName.controlsInitializing not in [e.name for e in msg.onroadEvents] assert controlsState is not None and initialized, "controlsState never initialized" params.put("ReplayControlsState", controlsState.as_builder().to_bytes()) @@ -465,7 +465,7 @@ def locationd_config_pubsub_callback(params, cfg, lr): "modelV2", "driverCameraState", "roadCameraState", "wideRoadCameraState", "managerState", "testJoystick", "liveTorqueParameters", "accelerometer", "gyroscope" ], - subs=["controlsState", "carState", "carControl", "sendcan", "carEvents", "carParams"], + subs=["controlsState", "carState", "carControl", "sendcan", "onroadEvents", "carParams"], ignore=["logMonoTime", "valid", "controlsState.startMonoTime", "controlsState.cumLagMs"], config_callback=controlsd_config_callback, init_callback=controlsd_fingerprint_callback, diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index 17026dc69fb9ff..e89ce5c72b63fa 100755 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -408,7 +408,7 @@ def test_timings(self): def test_startup(self): startup_alert = None for msg in self.lrs[0]: - # can't use carEvents because the first msg can be dropped while loggerd is starting up + # can't use onroadEvents because the first msg can be dropped while loggerd is starting up if msg.which() == "controlsState": startup_alert = msg.controlsState.alertText1 break @@ -417,8 +417,8 @@ def test_startup(self): def test_engagable(self): no_entries = Counter() - for m in self.service_msgs['carEvents']: - for evt in m.carEvents: + for m in self.service_msgs['onroadEvents']: + for evt in m.onroadEvents: if evt.noEntry: no_entries[evt.name] += 1 diff --git a/selfdrive/test/test_time_to_onroad.py b/selfdrive/test/test_time_to_onroad.py index cc2cc6514eb7f5..aec49cb13a5fee 100755 --- a/selfdrive/test/test_time_to_onroad.py +++ b/selfdrive/test/test_time_to_onroad.py @@ -18,7 +18,7 @@ def test_time_to_onroad(): proc = subprocess.Popen(["python", manager_path]) start_time = time.monotonic() - sm = messaging.SubMaster(['controlsState', 'deviceState', 'carEvents']) + sm = messaging.SubMaster(['controlsState', 'deviceState', 'onroadEvents']) try: # wait for onroad with Timeout(20, "timed out waiting to go onroad"): @@ -40,7 +40,7 @@ def test_time_to_onroad(): # once we're enageable, must be for the next few seconds for _ in range(500): sm.update(100) - assert sm['controlsState'].engageable, f"events: {sm['carEvents']}" + assert sm['controlsState'].engageable, f"events: {sm['onroadEvents']}" finally: proc.terminate() if proc.wait(60) is None: diff --git a/tools/sim/tests/test_sim_bridge.py b/tools/sim/tests/test_sim_bridge.py index b00527b322fa84..2654526fa82909 100644 --- a/tools/sim/tests/test_sim_bridge.py +++ b/tools/sim/tests/test_sim_bridge.py @@ -24,7 +24,7 @@ def test_engage(self): p_manager = subprocess.Popen("./launch_openpilot.sh", cwd=SIM_DIR) self.processes.append(p_manager) - sm = messaging.SubMaster(['controlsState', 'carEvents', 'managerState']) + sm = messaging.SubMaster(['controlsState', 'onroadEvents', 'managerState']) q = Queue() carla_bridge = self.create_bridge() p_bridge = carla_bridge.run(q, retries=10) @@ -46,7 +46,7 @@ def test_engage(self): sm.update() not_running = [p.name for p in sm['managerState'].processes if not p.running and p.shouldBeRunning] - car_event_issues = [event.name for event in sm['carEvents'] if any([event.noEntry, event.softDisable, event.immediateDisable])] + car_event_issues = [event.name for event in sm['onroadEvents'] if any([event.noEntry, event.softDisable, event.immediateDisable])] if sm.all_alive() and len(car_event_issues) == 0 and len(not_running) == 0: no_car_events_issues_once = True