Pause lateral control with turn signal
Added toggle to pause lateral control when a turn signal is active.
This commit is contained in:
@@ -296,6 +296,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
{"OSMDownloadProgress", CLEAR_ON_MANAGER_START},
|
{"OSMDownloadProgress", CLEAR_ON_MANAGER_START},
|
||||||
{"PathEdgeWidth", PERSISTENT},
|
{"PathEdgeWidth", PERSISTENT},
|
||||||
{"PathWidth", PERSISTENT},
|
{"PathWidth", PERSISTENT},
|
||||||
|
{"PauseLateralOnSignal", PERSISTENT},
|
||||||
{"PreferredSchedule", PERSISTENT},
|
{"PreferredSchedule", PERSISTENT},
|
||||||
{"RelaxedFollow", PERSISTENT},
|
{"RelaxedFollow", PERSISTENT},
|
||||||
{"RelaxedJerk", PERSISTENT},
|
{"RelaxedJerk", PERSISTENT},
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from openpilot.system.version import get_short_branch
|
|||||||
from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp
|
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.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.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.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.latcontrol import LatControl, MIN_LATERAL_CONTROL_SPEED
|
||||||
from openpilot.selfdrive.controls.lib.longcontrol import LongControl
|
from openpilot.selfdrive.controls.lib.longcontrol import LongControl
|
||||||
@@ -633,18 +634,20 @@ class Controls:
|
|||||||
gear = car.CarState.GearShifter
|
gear = car.CarState.GearShifter
|
||||||
driving_gear = CS.gearShifter not in (gear.neutral, gear.park, gear.reverse, gear.unknown)
|
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)
|
||||||
|
|
||||||
# Always on lateral
|
# Always on lateral
|
||||||
if self.always_on_lateral:
|
if self.always_on_lateral:
|
||||||
self.lateral_allowed &= CS.cruiseState.available
|
self.lateral_allowed &= CS.cruiseState.available
|
||||||
self.lateral_allowed |= CS.cruiseState.enabled or (CS.cruiseState.available and self.always_on_lateral_main)
|
self.lateral_allowed |= CS.cruiseState.enabled or (CS.cruiseState.available and self.always_on_lateral_main)
|
||||||
|
|
||||||
self.FPCC.alwaysOnLateral = self.lateral_allowed and driving_gear
|
self.FPCC.alwaysOnLateral = self.lateral_allowed and driving_gear and signal_check
|
||||||
if self.FPCC.alwaysOnLateral:
|
if self.FPCC.alwaysOnLateral:
|
||||||
self.current_alert_types.append(ET.WARNING)
|
self.current_alert_types.append(ET.WARNING)
|
||||||
|
|
||||||
# Check which actuators can be enabled
|
# Check which actuators can be enabled
|
||||||
standstill = CS.vEgo <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill
|
standstill = CS.vEgo <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill
|
||||||
CC.latActive = (self.active or self.FPCC.alwaysOnLateral) and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \
|
CC.latActive = (self.active or self.FPCC.alwaysOnLateral) and signal_check and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \
|
||||||
(not standstill or self.joystick_mode)
|
(not standstill or self.joystick_mode)
|
||||||
CC.longActive = self.enabled and not self.events.contains(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl
|
CC.longActive = self.enabled and not self.events.contains(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl
|
||||||
|
|
||||||
@@ -987,6 +990,7 @@ class Controls:
|
|||||||
longitudinal_tune = self.params.get_bool("LongitudinalTune")
|
longitudinal_tune = self.params.get_bool("LongitudinalTune")
|
||||||
self.sport_plus = self.params.get_int("AccelerationProfile") == 3 and longitudinal_tune
|
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")
|
self.reverse_cruise_increase = self.params.get_bool("ReverseCruise")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
BIN
selfdrive/frogpilot/assets/toggle_icons/icon_pause_lane.png
Normal file
BIN
selfdrive/frogpilot/assets/toggle_icons/icon_pause_lane.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -39,6 +39,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil
|
|||||||
{"LaneChangeTime", "Lane Change Timer", "Specify a delay before executing a nudgeless lane change.", ""},
|
{"LaneChangeTime", "Lane Change Timer", "Specify a delay before executing a nudgeless lane change.", ""},
|
||||||
{"LaneDetection", "Lane Detection", "Block nudgeless lane changes when a lane isn't detected.", ""},
|
{"LaneDetection", "Lane Detection", "Block nudgeless lane changes when a lane isn't detected.", ""},
|
||||||
{"OneLaneChange", "One Lane Change Per Signal", "Limit to one nudgeless lane change per turn signal activation.", ""},
|
{"OneLaneChange", "One Lane Change Per Signal", "Limit to one nudgeless lane change per turn signal activation.", ""},
|
||||||
|
{"PauseLateralOnSignal", "Pause Lateral On Turn Signal", "Temporarily disable lateral control during turn signal use.", ""},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto &[param, title, desc, icon] : controlToggles) {
|
for (const auto &[param, title, desc, icon] : controlToggles) {
|
||||||
@@ -256,7 +257,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil
|
|||||||
|
|
||||||
conditionalExperimentalKeys = {"CECurves", "CECurvesLead", "CESlowerLead", "CENavigation", "CEStopLights", "CESignal"};
|
conditionalExperimentalKeys = {"CECurves", "CECurvesLead", "CESlowerLead", "CENavigation", "CEStopLights", "CESignal"};
|
||||||
fireTheBabysitterKeys = {"NoLogging", "MuteDM", "MuteDoor", "MuteOverheated", "MuteSeatbelt"};
|
fireTheBabysitterKeys = {"NoLogging", "MuteDM", "MuteDoor", "MuteOverheated", "MuteSeatbelt"};
|
||||||
laneChangeKeys = {"LaneChangeTime", "LaneDetection", "OneLaneChange"};
|
laneChangeKeys = {"LaneChangeTime", "LaneDetection", "OneLaneChange", "PauseLateralOnSignal"};
|
||||||
lateralTuneKeys = {"AverageCurvature", "NNFF"};
|
lateralTuneKeys = {"AverageCurvature", "NNFF"};
|
||||||
longitudinalTuneKeys = {"AccelerationProfile", "AggressiveAcceleration", "StoppingDistance"};
|
longitudinalTuneKeys = {"AccelerationProfile", "AggressiveAcceleration", "StoppingDistance"};
|
||||||
speedLimitControllerKeys = {};
|
speedLimitControllerKeys = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user