From 769661857382a7871127cc5a0dca31cce834b565 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Fri, 24 May 2024 02:43:03 -0700 Subject: [PATCH] Controls - Longitudinal Tuning - Deceleration Profile Change the deceleration rate to be either sporty or eco-friendly. --- selfdrive/frogpilot/controls/frogpilot_planner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/frogpilot/controls/frogpilot_planner.py b/selfdrive/frogpilot/controls/frogpilot_planner.py index ba1004b857..3bb83dc98a 100644 --- a/selfdrive/frogpilot/controls/frogpilot_planner.py +++ b/selfdrive/frogpilot/controls/frogpilot_planner.py @@ -18,6 +18,8 @@ from openpilot.selfdrive.frogpilot.controls.lib.conditional_experimental_mode im from openpilot.selfdrive.frogpilot.controls.lib.frogpilot_functions import calculate_lane_width, calculate_road_curvature from openpilot.selfdrive.frogpilot.controls.lib.frogpilot_variables import CITY_SPEED_LIMIT, CRUISING_SPEED, TRAJECTORY_SIZE +A_CRUISE_MIN_ECO = A_CRUISE_MIN / 5 +A_CRUISE_MIN_SPORT = A_CRUISE_MIN / 2 # MPH = [ 0., 11, 22, 34, 45, 56, 89] A_CRUISE_MAX_BP_CUSTOM = [ 0., 5., 10., 15., 20., 25., 40.] A_CRUISE_MAX_VALS_ECO = [1.4, 1.2, 1.0, 0.8, 0.6, 0.4, 0.2] @@ -94,6 +96,10 @@ class FrogPilotPlanner: if controlsState.experimentalMode: self.min_accel = ACCEL_MIN + elif frogpilot_toggles.deceleration_profile == 1: + self.min_accel = A_CRUISE_MIN_ECO + elif frogpilot_toggles.deceleration_profile == 2: + self.min_accel = A_CRUISE_MIN_SPORT else: self.min_accel = A_CRUISE_MIN