From ba11b97c59112cd9c02cd03ff4f0e3f80b74117f Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 15 Nov 2024 12:03:28 -0500 Subject: [PATCH] Rename --- cereal/custom.capnp | 8 ++++---- selfdrive/selfdrived/selfdrived.py | 4 ++-- sunnypilot/mads/mads.py | 4 ++-- sunnypilot/mads/state.py | 2 +- sunnypilot/mads/tests/test_state_machine.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cereal/custom.capnp b/cereal/custom.capnp index ddb09e34ff..06d3eec0b3 100644 --- a/cereal/custom.capnp +++ b/cereal/custom.capnp @@ -9,15 +9,15 @@ $Cxx.namespace("cereal"); # you can rename the struct, but don't change the identifier struct SelfdriveStateSP @0x81c2f05a394cf4af { - mads @0 :ModifiedAssistDrivingSystem; + mads @0 :ModularAssistiveDrivingSystem; - struct ModifiedAssistDrivingSystem { - state @0 :ModifiedAssistDrivingSystemState; + struct ModularAssistiveDrivingSystem { + state @0 :ModularAssistiveDrivingSystemState; enabled @1 :Bool; active @2 :Bool; available @3 :Bool; - enum ModifiedAssistDrivingSystemState { + enum ModularAssistiveDrivingSystemState { disabled @0; paused @1; enabled @2; diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index 43ede9235d..3dceee4c41 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -23,7 +23,7 @@ from openpilot.selfdrive.controls.lib.latcontrol import MIN_LATERAL_CONTROL_SPEE from openpilot.system.version import get_build_metadata -from openpilot.sunnypilot.mads.mads import ModifiedAssistDrivingSystem +from openpilot.sunnypilot.mads.mads import ModularAssistiveDrivingSystem REPLAY = "REPLAY" in os.environ SIMULATION = "SIMULATION" in os.environ @@ -133,7 +133,7 @@ class SelfdriveD: elif self.CP.passive: self.events.add(EventName.dashcamMode, static=True) - self.mads = ModifiedAssistDrivingSystem(self) + self.mads = ModularAssistiveDrivingSystem(self) sock_services = list(self.pm.sock.keys()) + ['selfdriveStateSP'] self.pm = messaging.PubMaster(sock_services) diff --git a/sunnypilot/mads/mads.py b/sunnypilot/mads/mads.py index e8527faa03..69946d7bbc 100644 --- a/sunnypilot/mads/mads.py +++ b/sunnypilot/mads/mads.py @@ -3,12 +3,12 @@ from cereal import car, log, custom from openpilot.sunnypilot.mads.helpers import MadsParams from openpilot.sunnypilot.mads.state import StateMachine -State = custom.SelfdriveStateSP.ModifiedAssistDrivingSystem.ModifiedAssistDrivingSystemState +State = custom.SelfdriveStateSP.ModularAssistiveDrivingSystem.ModularAssistiveDrivingSystemState ButtonType = car.CarState.ButtonEvent.Type EventName = log.OnroadEvent.EventName -class ModifiedAssistDrivingSystem: +class ModularAssistiveDrivingSystem: def __init__(self, selfdrive): mads_params = MadsParams() diff --git a/sunnypilot/mads/state.py b/sunnypilot/mads/state.py index 490e4a480e..d23c888877 100644 --- a/sunnypilot/mads/state.py +++ b/sunnypilot/mads/state.py @@ -3,7 +3,7 @@ from openpilot.selfdrive.selfdrived.events import ET, Events from openpilot.selfdrive.selfdrived.state import SOFT_DISABLE_TIME from openpilot.common.realtime import DT_CTRL -State = custom.SelfdriveStateSP.ModifiedAssistDrivingSystem.ModifiedAssistDrivingSystemState +State = custom.SelfdriveStateSP.ModularAssistiveDrivingSystem.ModularAssistiveDrivingSystemState EventName = log.OnroadEvent.EventName ENABLED_STATES = (State.enabled, State.softDisabling, State.overriding) diff --git a/sunnypilot/mads/tests/test_state_machine.py b/sunnypilot/mads/tests/test_state_machine.py index a669e824c4..fdce389905 100644 --- a/sunnypilot/mads/tests/test_state_machine.py +++ b/sunnypilot/mads/tests/test_state_machine.py @@ -6,7 +6,7 @@ from openpilot.common.realtime import DT_CTRL from openpilot.sunnypilot.mads.state import StateMachine, SOFT_DISABLE_TIME from openpilot.selfdrive.selfdrived.events import Events, ET, EVENTS, NormalPermanentAlert -State = custom.SelfdriveStateSP.ModifiedAssistDrivingSystem.ModifiedAssistDrivingSystemState +State = custom.SelfdriveStateSP.ModularAssistiveDrivingSystem.ModularAssistiveDrivingSystemState # The event types that maintain the current state MAINTAIN_STATES = {State.enabled: (None,), State.disabled: (None,), State.softDisabling: (ET.SOFT_DISABLE,),