force standstill
This commit is contained in:
Binary file not shown.
@@ -261,6 +261,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
||||
{"ForceOffroad", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}},
|
||||
{"ForceOnroad", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}},
|
||||
{"ForceStops", {PERSISTENT, BOOL, "0", "0", 2}},
|
||||
{"ForceStandstill", {PERSISTENT, BOOL, "0", "0", 2}},
|
||||
{"ForceTorqueController", {PERSISTENT, BOOL, "0", "0", 3}},
|
||||
{"FPSCounter", {PERSISTENT, BOOL, "1", "0", 3}},
|
||||
{"StarPilotApiToken", {PERSISTENT | DONT_LOG, STRING, "", "", 0}},
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
extern const uint8_t gitversion[19];
|
||||
const uint8_t gitversion[19] = "DEV-6099e109-DEBUG";
|
||||
const uint8_t gitversion[19] = "DEV-f8c5e90e-DEBUG";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
DEV-6099e109-DEBUG
|
||||
DEV-f8c5e90e-DEBUG
|
||||
Binary file not shown.
@@ -417,6 +417,13 @@ def custom_startup_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubM
|
||||
|
||||
|
||||
def forcing_stop_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality, starpilot_toggles: SimpleNamespace) -> Alert:
|
||||
if CS.standstill:
|
||||
return Alert(
|
||||
"Holding the car at a stop",
|
||||
"Press the gas pedal or 'Resume' button to override",
|
||||
StarPilotAlertStatus.starpilot, AlertSize.mid,
|
||||
Priority.MID, VisualAlert.none, AudibleAlert.prompt, 1.)
|
||||
|
||||
model_length = sm["starpilotPlan"].forcingStopLength
|
||||
model_length_msg = f"{model_length:.1f} meters" if metric else f"{model_length * CV.METER_TO_FOOT:.1f} feet"
|
||||
|
||||
|
||||
@@ -521,6 +521,13 @@ class StarPilotLongitudinalQOLLayout(StarPilotPanel):
|
||||
"set_state": lambda s: self._params.put_bool("ForceStops", s),
|
||||
"color": "#597497",
|
||||
},
|
||||
{
|
||||
"title": tr_noop("Force Standstill State"),
|
||||
"type": "toggle",
|
||||
"get_state": lambda: self._params.get_bool("ForceStandstill"),
|
||||
"set_state": lambda s: self._params.put_bool("ForceStandstill", s),
|
||||
"color": "#597497",
|
||||
},
|
||||
{
|
||||
"title": tr_noop("Stopped Distance"),
|
||||
"type": "value",
|
||||
|
||||
Binary file not shown.
@@ -66,6 +66,7 @@ SAFE_MODE_MANAGED_KEYS = (
|
||||
"TacoTune",
|
||||
"QOLLongitudinal",
|
||||
"ForceStops",
|
||||
"ForceStandstill",
|
||||
"IncreasedStoppedDistance",
|
||||
"MapGears",
|
||||
"MapAcceleration",
|
||||
|
||||
@@ -842,6 +842,7 @@ class StarPilotVariables:
|
||||
toggle.cruise_increase = self.get_value("CustomCruise", cast=float, condition=(quality_of_life_longitudinal and not pcm_cruise))
|
||||
toggle.cruise_increase_long = self.get_value("CustomCruiseLong", cast=float, condition=(quality_of_life_longitudinal and not pcm_cruise))
|
||||
toggle.force_stops = self.get_value("ForceStops", condition=quality_of_life_longitudinal)
|
||||
toggle.force_standstill = self.get_value("ForceStandstill", condition=quality_of_life_longitudinal)
|
||||
toggle.increase_stopped_distance = self.get_value("IncreasedStoppedDistance", cast=float, condition=quality_of_life_longitudinal, conversion=distance_conversion)
|
||||
map_gears = self.get_value("MapGears", condition=quality_of_life_longitudinal)
|
||||
toggle.map_acceleration = self.get_value("MapAcceleration", condition=map_gears)
|
||||
|
||||
@@ -19,6 +19,7 @@ class StarPilotVCruise:
|
||||
|
||||
self.forcing_stop = False
|
||||
self.override_force_stop = False
|
||||
self.override_force_standstill = False
|
||||
|
||||
self.override_force_stop_timer = 0
|
||||
self.force_stop_timer = 0.0
|
||||
@@ -42,6 +43,13 @@ class StarPilotVCruise:
|
||||
elif self.override_force_stop_timer > 0:
|
||||
self.override_force_stop_timer -= DT_MDL
|
||||
|
||||
force_standstill_enabled = controls_enabled and starpilot_toggles.force_standstill and sm["carState"].standstill
|
||||
if force_standstill_enabled:
|
||||
self.override_force_standstill |= sm["carState"].gasPressed
|
||||
self.override_force_standstill |= sm["starpilotCarState"].accelPressed
|
||||
else:
|
||||
self.override_force_standstill = False
|
||||
|
||||
v_cruise_cluster = max(sm["carState"].vCruiseCluster * CV.KPH_TO_MS, v_cruise)
|
||||
v_cruise_diff = v_cruise_cluster - v_cruise
|
||||
|
||||
@@ -81,7 +89,12 @@ class StarPilotVCruise:
|
||||
self.slc_offset = 0
|
||||
self.slc_target = 0
|
||||
|
||||
if force_stop_enabled and not self.override_force_stop:
|
||||
if force_standstill_enabled and not self.override_force_standstill:
|
||||
self.forcing_stop = True
|
||||
self.tracked_model_length = 0.0
|
||||
v_cruise = 0.0
|
||||
|
||||
elif force_stop_enabled and not self.override_force_stop:
|
||||
self.forcing_stop |= not sm["carState"].standstill
|
||||
|
||||
self.tracked_model_length = max(self.tracked_model_length - (v_ego * DT_MDL), 0)
|
||||
|
||||
@@ -928,6 +928,14 @@
|
||||
"ui_type": "toggle",
|
||||
"parent_key": "QOLLongitudinal"
|
||||
},
|
||||
{
|
||||
"key": "ForceStandstill",
|
||||
"label": "Force Standstill State",
|
||||
"description": "Keep openpilot in the standstill state until you press the gas pedal or the Resume/+ cruise button.\n\nThis applies to any engaged stop, not just red lights or stop signs.",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
"parent_key": "QOLLongitudinal"
|
||||
},
|
||||
{
|
||||
"key": "IncreasedStoppedDistance",
|
||||
"label": "Increase Stopped Distance by:",
|
||||
|
||||
@@ -155,6 +155,7 @@ StarPilotLongitudinalPanel::StarPilotLongitudinalPanel(StarPilotSettingsWindow *
|
||||
{"CustomCruise", tr("Cruise Interval"), tr("<b>How much the set speed increases or decreases</b> for each + or – cruise control button press."), ""},
|
||||
{"CustomCruiseLong", tr("Cruise Interval (Hold)"), tr("<b>How much the set speed increases or decreases while holding the + or – cruise control buttons.</b>"), ""},
|
||||
{"ForceStops", tr("Force Stop at \"Detected\" Stop Lights/Signs"), tr("<b>Force openpilot to stop whenever the driving model \"detects\" a red light or stop sign.</b><br><br><i><b>Disclaimer</b>: openpilot does not explicitly detect traffic lights or stop signs. In \"Experimental Mode\", openpilot makes end-to-end driving decisions from camera input, which means it may stop even when there's no clear reason!</i>"), ""},
|
||||
{"ForceStandstill", tr("Force Standstill State"), tr("<b>Keep openpilot in the standstill state until you press the gas pedal or the Resume/+ cruise button.</b><br><br>This applies to any engaged stop, not just red lights or stop signs."), ""},
|
||||
{"IncreasedStoppedDistance", tr("Increase Stopped Distance by:"), tr("<b>Add extra space when stopped behind vehicles.</b> Increase for more room; decrease for shorter gaps."), ""},
|
||||
{"MapGears", tr("Map Accel/Decel to Gears"), tr("<b>Map the Acceleration or Deceleration profiles to the vehicle's \"Eco\" and \"Sport\" gear modes.</b>"), ""},
|
||||
{"SetSpeedOffset", tr("Offset Set Speed by:"), tr("<b>Increase the set speed by the chosen offset.</b> For example, set +5 if you usually drive 5 over the limit."), ""},
|
||||
|
||||
@@ -34,7 +34,7 @@ private:
|
||||
QSet<QString> curveSpeedKeys = {"CalibratedLateralAcceleration", "CalibrationProgress", "ResetCurveData", "ShowCSCStatus"};
|
||||
QSet<QString> customDrivingPersonalityKeys = {"AggressivePersonalityProfile", "RelaxedPersonalityProfile", "StandardPersonalityProfile", "TrafficPersonalityProfile"};
|
||||
QSet<QString> longitudinalTuneKeys = {"AccelerationProfile", "DecelerationProfile", "HumanAcceleration", "HumanFollowing", "HumanLaneChanges", "LeadDetectionThreshold", "TacoTune"};
|
||||
QSet<QString> qolKeys = {"CustomCruise", "CustomCruiseLong", "ForceStops", "IncreasedStoppedDistance", "MapGears", "ReverseCruise", "SetSpeedOffset", "WeatherPresets"};
|
||||
QSet<QString> qolKeys = {"CustomCruise", "CustomCruiseLong", "ForceStops", "ForceStandstill", "IncreasedStoppedDistance", "MapGears", "ReverseCruise", "SetSpeedOffset", "WeatherPresets"};
|
||||
QSet<QString> relaxedPersonalityKeys = {"RelaxedFollow", "RelaxedFollowHigh", "RelaxedJerkAcceleration", "RelaxedJerkDeceleration", "RelaxedJerkDanger", "RelaxedJerkSpeed", "RelaxedJerkSpeedDecrease", "ResetRelaxedPersonality"};
|
||||
QSet<QString> speedLimitControllerKeys = {"SLCOffsets", "SLCFallback", "SLCOverride", "SLCPriority", "SLCQOL", "SLCVisuals"};
|
||||
QSet<QString> speedLimitControllerOffsetsKeys = {"Offset1", "Offset2", "Offset3", "Offset4", "Offset5", "Offset6", "Offset7"};
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user