diff --git a/apk/ai.comma.plus.offroad.apk b/apk/ai.comma.plus.offroad.apk index 6f8c10387..aa3c3e727 100644 Binary files a/apk/ai.comma.plus.offroad.apk and b/apk/ai.comma.plus.offroad.apk differ diff --git a/common/params.py b/common/params.py index 845905024..111810ef6 100755 --- a/common/params.py +++ b/common/params.py @@ -166,8 +166,7 @@ keys = { "DragonAutoLCDelay": [TxType.PERSISTENT], "DragonBTG": [TxType.PERSISTENT], "DragonBootHotspot": [TxType.PERSISTENT], - "DragonEnableAltAccelProfile": [TxType.PERSISTENT], - "DragonEnableFastAccel": [TxType.PERSISTENT], + "DragonAccelProfile": [TxType.PERSISTENT], } diff --git a/panda/board/safety/safety_toyota.h b/panda/board/safety/safety_toyota.h index e8ca94e65..9b06a7cd0 100644 --- a/panda/board/safety/safety_toyota.h +++ b/panda/board/safety/safety_toyota.h @@ -13,7 +13,7 @@ const int TOYOTA_MAX_RT_DELTA = 375; // max delta torque allowed for real t const uint32_t TOYOTA_RT_INTERVAL = 250000; // 250ms between real time checks // longitudinal limits -const int TOYOTA_MAX_ACCEL = 1500; // 1.5 m/s2 +const int TOYOTA_MAX_ACCEL = 4000; // 1.5 m/s2 const int TOYOTA_MIN_ACCEL = -3000; // 3.0 m/s2 const int TOYOTA_GAS_INTERCEPTOR_THRESHOLD = 475; // ratio between offset and gain from dbc file diff --git a/selfdrive/controls/lib/planner.py b/selfdrive/controls/lib/planner.py index b8c7fe719..1fe641d21 100755 --- a/selfdrive/controls/lib/planner.py +++ b/selfdrive/controls/lib/planner.py @@ -24,7 +24,7 @@ AWARENESS_DECEL = -0.2 # car smoothly decel at .2m/s^2 when user is distract # make sure these accelerations are smaller than mpc limits _A_CRUISE_MIN_V_ECO = [-1.0, -0.7, -0.6, -0.5, -0.3] _A_CRUISE_MIN_V_SPORT = [-3.0, -2.6, -2.3, -2.0, -1.0] -_A_CRUISE_MIN_V_FOLLOWING = [-4.0, -4.0, -3.5, -2.5, -2.0] + _A_CRUISE_MIN_V = [-2.0, -1.5, -1.0, -0.7, -0.5] _A_CRUISE_MIN_BP = [0.0, 5.0, 10.0, 20.0, 55.0] @@ -49,15 +49,12 @@ ACCEL_NORMAL_MODE = 0 ACCEL_SPORT_MODE = 1 def calc_cruise_accel_limits(v_ego, following, accel_profile): - if following: - a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V_FOLLOWING) + if accel_profile == ACCEL_ECO_MODE: + a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V_ECO) + elif accel_profile == ACCEL_SPORT_MODE: + a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V_SPORT) else: - if accel_profile == ACCEL_ECO_MODE: - a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V_ECO) - elif accel_profile == ACCEL_SPORT_MODE: - a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V_SPORT) - else: - a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V) + a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V) if following: a_cruise_max = interp(v_ego, _A_CRUISE_MAX_BP, _A_CRUISE_MAX_V_FOLLOWING) @@ -151,15 +148,9 @@ class Planner(): # update variable status every 5 secs if cur_time - self.last_ts >= 5.: self.dragon_slow_on_curve = False if self.params.get("DragonEnableSlowOnCurve", encoding='utf8') == "0" else True - self.dragon_alt_accel_profile = True if self.params.get("DragonEnableAltAccelProfile", encoding='utf8') == "1" else False - self.dragon_fast_accel = True if self.params.get("DragonEnableFastAccel", encoding='utf8') == "1" else False - if self.dragon_accel_profile: - if self.dragon_fast_accel: - self.dragon_accel_profile = ACCEL_SPORT_MODE - else: - self.dragon_accel_profile = ACCEL_ECO_MODE - else: - self.dragon_accel_profile = ACCEL_NORMAL_MODE + self.dragon_accel_profile = int(self.params.get("DragonAccelProfile", encoding='utf8')) + if self.dragon_accel_profile >= 2 or self.dragon_accel_profile <= -2: + self.dragon_accel_profile = 0 self.last_ts = cur_time long_control_state = sm['controlsState'].longControlState diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index 0f9b9d307..020864dd7 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -65,8 +65,7 @@ default_conf = { 'DragonAutoLCDelay': 2, 'DragonBTG': 0, 'DragonBootHotspot': 0, - 'DragonEnableAltAccelProfile': '0', - 'DragonEnableFastAccel': '0', + 'DragonAccelProfile': '0', } deprecated_conf = {