Quality of life toggles
Co-Authored-By: Tim Wilson <7284371+twilsonco@users.noreply.github.com> Update visual_settings.cc
This commit is contained in:
@@ -18,7 +18,6 @@ from openpilot.system.version import get_short_branch
|
||||
from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp
|
||||
from openpilot.selfdrive.car.car_helpers import get_car, get_startup_event, get_one_can
|
||||
from openpilot.selfdrive.controls.lib.lateral_planner import CAMERA_OFFSET
|
||||
from openpilot.selfdrive.controls.lib.desire_helper import LANE_CHANGE_SPEED_MIN
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import VCruiseHelper, get_lag_adjusted_curvature
|
||||
from openpilot.selfdrive.controls.lib.latcontrol import LatControl, MIN_LATERAL_CONTROL_SPEED
|
||||
from openpilot.selfdrive.controls.lib.longcontrol import LongControl
|
||||
@@ -527,7 +526,7 @@ class Controls:
|
||||
def state_transition(self, CS):
|
||||
"""Compute conditional state transitions and execute actions on state transitions"""
|
||||
|
||||
self.v_cruise_helper.update_v_cruise(CS, self.enabled, self.is_metric, self.reverse_cruise_increase)
|
||||
self.v_cruise_helper.update_v_cruise(CS, self.enabled, self.is_metric, self.reverse_cruise_increase, self.set_speed_offset)
|
||||
|
||||
# decrement the soft disable timer at every step, as it's reset on
|
||||
# entrance in SOFT_DISABLING state
|
||||
@@ -641,7 +640,7 @@ class Controls:
|
||||
gear = car.CarState.GearShifter
|
||||
driving_gear = CS.gearShifter not in (gear.neutral, gear.park, gear.reverse, gear.unknown)
|
||||
|
||||
signal_check = not ((CS.leftBlinker or CS.rightBlinker) and self.pause_lateral_on_signal and CS.vEgo < LANE_CHANGE_SPEED_MIN)
|
||||
signal_check = not ((CS.leftBlinker or CS.rightBlinker) and CS.vEgo < self.pause_lateral_on_signal and not CS.standstill)
|
||||
|
||||
# Always on lateral
|
||||
if self.always_on_lateral:
|
||||
@@ -1000,8 +999,10 @@ class Controls:
|
||||
longitudinal_tune = self.params.get_bool("LongitudinalTune")
|
||||
self.sport_plus = self.params.get_int("AccelerationProfile") == 3 and longitudinal_tune
|
||||
|
||||
self.pause_lateral_on_signal = self.params.get_bool("PauseLateralOnSignal")
|
||||
self.reverse_cruise_increase = self.params.get_bool("ReverseCruise")
|
||||
quality_of_life = self.params.get_bool("QOLControls")
|
||||
self.pause_lateral_on_signal = self.params.get_int("PauseLateralOnSignal") * (CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS) if quality_of_life else 0
|
||||
self.reverse_cruise_increase = self.params.get_bool("ReverseCruise") and quality_of_life
|
||||
self.set_speed_offset = self.params.get_int("SetSpeedOffset") * (1 if self.is_metric else CV.MPH_TO_KPH) if quality_of_life else 0
|
||||
|
||||
def main():
|
||||
controls = Controls()
|
||||
|
||||
Reference in New Issue
Block a user