Disable openpilot longitudinal control
Added toggle to disable openpilot longitudinal control.
This commit is contained in:
@@ -245,6 +245,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
{"CydiaTune", PERSISTENT},
|
{"CydiaTune", PERSISTENT},
|
||||||
{"DecelerationProfile", PERSISTENT},
|
{"DecelerationProfile", PERSISTENT},
|
||||||
{"DeviceShutdown", PERSISTENT},
|
{"DeviceShutdown", PERSISTENT},
|
||||||
|
{"DisableOpenpilotLongitudinal", PERSISTENT},
|
||||||
{"DisengageVolume", PERSISTENT},
|
{"DisengageVolume", PERSISTENT},
|
||||||
{"DriveStats", PERSISTENT},
|
{"DriveStats", PERSISTENT},
|
||||||
{"DynamicPathWidth", PERSISTENT},
|
{"DynamicPathWidth", PERSISTENT},
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
ret.experimentalLongitudinalAvailable = True
|
ret.experimentalLongitudinalAvailable = True
|
||||||
if experimental_long:
|
if experimental_long:
|
||||||
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_LONG_CONTROL
|
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_LONG_CONTROL
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
|
|
||||||
if candidate in CANFD_CAR:
|
if candidate in CANFD_CAR:
|
||||||
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_CANFD
|
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_CANFD
|
||||||
|
|||||||
6
selfdrive/car/gm/interface.py
Executable file → Normal file
6
selfdrive/car/gm/interface.py
Executable file → Normal file
@@ -124,7 +124,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
|
|
||||||
if experimental_long:
|
if experimental_long:
|
||||||
ret.pcmCruise = False
|
ret.pcmCruise = False
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM_LONG
|
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM_LONG
|
||||||
|
|
||||||
elif candidate in SDGM_CAR:
|
elif candidate in SDGM_CAR:
|
||||||
@@ -137,7 +137,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_SDGM
|
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_SDGM
|
||||||
|
|
||||||
else: # ASCM, OBD-II harness
|
else: # ASCM, OBD-II harness
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.networkLocation = NetworkLocation.gateway
|
ret.networkLocation = NetworkLocation.gateway
|
||||||
ret.radarUnavailable = RADAR_HEADER_MSG not in fingerprint[CanBus.OBSTACLE] and not docs
|
ret.radarUnavailable = RADAR_HEADER_MSG not in fingerprint[CanBus.OBSTACLE] and not docs
|
||||||
ret.pcmCruise = False # stock non-adaptive cruise control is kept off
|
ret.pcmCruise = False # stock non-adaptive cruise control is kept off
|
||||||
@@ -322,7 +322,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
ret.radarUnavailable = True
|
ret.radarUnavailable = True
|
||||||
ret.experimentalLongitudinalAvailable = False
|
ret.experimentalLongitudinalAvailable = False
|
||||||
ret.minEnableSpeed = 24 * CV.MPH_TO_MS
|
ret.minEnableSpeed = 24 * CV.MPH_TO_MS
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.pcmCruise = False
|
ret.pcmCruise = False
|
||||||
|
|
||||||
ret.longitudinalTuning.deadzoneBP = [0.]
|
ret.longitudinalTuning.deadzoneBP = [0.]
|
||||||
|
|||||||
4
selfdrive/car/honda/interface.py
Executable file → Normal file
4
selfdrive/car/honda/interface.py
Executable file → Normal file
@@ -49,12 +49,12 @@ class CarInterface(CarInterfaceBase):
|
|||||||
# WARNING: THIS DISABLES AEB!
|
# WARNING: THIS DISABLES AEB!
|
||||||
# If Bosch radarless, this blocks ACC messages from the camera
|
# If Bosch radarless, this blocks ACC messages from the camera
|
||||||
ret.experimentalLongitudinalAvailable = True
|
ret.experimentalLongitudinalAvailable = True
|
||||||
ret.openpilotLongitudinalControl = experimental_long
|
ret.openpilotLongitudinalControl = experimental_long and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.pcmCruise = not ret.openpilotLongitudinalControl
|
ret.pcmCruise = not ret.openpilotLongitudinalControl
|
||||||
else:
|
else:
|
||||||
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaNidec)]
|
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaNidec)]
|
||||||
ret.enableGasInterceptor = 0x201 in fingerprint[0]
|
ret.enableGasInterceptor = 0x201 in fingerprint[0]
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
|
|
||||||
ret.pcmCruise = not ret.enableGasInterceptor
|
ret.pcmCruise = not ret.enableGasInterceptor
|
||||||
|
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
ret.longitudinalTuning.kpV = [0.5]
|
ret.longitudinalTuning.kpV = [0.5]
|
||||||
ret.longitudinalTuning.kiV = [0.0]
|
ret.longitudinalTuning.kiV = [0.0]
|
||||||
ret.experimentalLongitudinalAvailable = candidate not in (UNSUPPORTED_LONGITUDINAL_CAR | CAMERA_SCC_CAR)
|
ret.experimentalLongitudinalAvailable = candidate not in (UNSUPPORTED_LONGITUDINAL_CAR | CAMERA_SCC_CAR)
|
||||||
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable
|
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.pcmCruise = not ret.openpilotLongitudinalControl
|
ret.pcmCruise = not ret.openpilotLongitudinalControl
|
||||||
|
|
||||||
ret.stoppingControl = True
|
ret.stoppingControl = True
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
raise ValueError(f"unknown car: {candidate}")
|
raise ValueError(f"unknown car: {candidate}")
|
||||||
|
|
||||||
ret.experimentalLongitudinalAvailable = candidate not in (GLOBAL_GEN2 | PREGLOBAL_CARS | LKAS_ANGLE | HYBRID_CARS)
|
ret.experimentalLongitudinalAvailable = candidate not in (GLOBAL_GEN2 | PREGLOBAL_CARS | LKAS_ANGLE | HYBRID_CARS)
|
||||||
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable
|
ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
|
|
||||||
if candidate in GLOBAL_GEN2 and ret.openpilotLongitudinalControl:
|
if candidate in GLOBAL_GEN2 and ret.openpilotLongitudinalControl:
|
||||||
ret.flags |= SubaruFlags.DISABLE_EYESIGHT.value
|
ret.flags |= SubaruFlags.DISABLE_EYESIGHT.value
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
# Check if we have messages on an auxiliary panda, and that 0x2bf (DAS_control) is present on the AP powertrain bus
|
# Check if we have messages on an auxiliary panda, and that 0x2bf (DAS_control) is present on the AP powertrain bus
|
||||||
# If so, we assume that it is connected to the longitudinal harness.
|
# If so, we assume that it is connected to the longitudinal harness.
|
||||||
if (CANBUS.autopilot_powertrain in fingerprint.keys()) and (0x2bf in fingerprint[CANBUS.autopilot_powertrain].keys()):
|
if (CANBUS.autopilot_powertrain in fingerprint.keys()) and (0x2bf in fingerprint[CANBUS.autopilot_powertrain].keys()):
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.safetyConfigs = [
|
ret.safetyConfigs = [
|
||||||
get_safety_config(car.CarParams.SafetyModel.tesla, Panda.FLAG_TESLA_LONG_CONTROL),
|
get_safety_config(car.CarParams.SafetyModel.tesla, Panda.FLAG_TESLA_LONG_CONTROL),
|
||||||
get_safety_config(car.CarParams.SafetyModel.tesla, Panda.FLAG_TESLA_LONG_CONTROL | Panda.FLAG_TESLA_POWERTRAIN),
|
get_safety_config(car.CarParams.SafetyModel.tesla, Panda.FLAG_TESLA_LONG_CONTROL | Panda.FLAG_TESLA_POWERTRAIN),
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
# - TSS2 radar ACC cars w/o smartDSU installed (disables radar)
|
# - TSS2 radar ACC cars w/o smartDSU installed (disables radar)
|
||||||
# - TSS-P DSU-less cars w/ CAN filter installed (no radar parser yet)
|
# - TSS-P DSU-less cars w/ CAN filter installed (no radar parser yet)
|
||||||
ret.openpilotLongitudinalControl = use_sdsu or ret.enableDsu or candidate in (TSS2_CAR - RADAR_ACC_CAR) or bool(ret.flags & ToyotaFlags.DISABLE_RADAR.value)
|
ret.openpilotLongitudinalControl = use_sdsu or ret.enableDsu or candidate in (TSS2_CAR - RADAR_ACC_CAR) or bool(ret.flags & ToyotaFlags.DISABLE_RADAR.value)
|
||||||
|
ret.openpilotLongitudinalControl &= not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.autoResumeSng = ret.openpilotLongitudinalControl and candidate in NO_STOP_TIMER_CAR
|
ret.autoResumeSng = ret.openpilotLongitudinalControl and candidate in NO_STOP_TIMER_CAR
|
||||||
ret.enableGasInterceptor = 0x201 in fingerprint[0] and ret.openpilotLongitudinalControl
|
ret.enableGasInterceptor = 0x201 in fingerprint[0] and ret.openpilotLongitudinalControl
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
ret.experimentalLongitudinalAvailable = ret.networkLocation == NetworkLocation.gateway or docs
|
ret.experimentalLongitudinalAvailable = ret.networkLocation == NetworkLocation.gateway or docs
|
||||||
if experimental_long:
|
if experimental_long:
|
||||||
# Proof-of-concept, prep for E2E only. No radar points available. Panda ALLOW_DEBUG firmware required.
|
# Proof-of-concept, prep for E2E only. No radar points available. Panda ALLOW_DEBUG firmware required.
|
||||||
ret.openpilotLongitudinalControl = True
|
ret.openpilotLongitudinalControl = True and not params.get_bool("DisableOpenpilotLongitudinal")
|
||||||
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_VOLKSWAGEN_LONG_CONTROL
|
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_VOLKSWAGEN_LONG_CONTROL
|
||||||
if ret.transmissionType == TransmissionType.manual:
|
if ret.transmissionType == TransmissionType.manual:
|
||||||
ret.minEnableSpeed = 4.5
|
ret.minEnableSpeed = 4.5
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
#include "selfdrive/frogpilot/ui/vehicle_settings.h"
|
#include "selfdrive/frogpilot/ui/vehicle_settings.h"
|
||||||
|
|
||||||
FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(SettingsWindow *parent) : FrogPilotListWidget(parent) {
|
FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(SettingsWindow *parent) : FrogPilotListWidget(parent) {
|
||||||
|
ParamControl *disableOpenpilotLong = new ParamControl("DisableOpenpilotLongitudinal", "Disable Openpilot Longitudinal Control", "Disables openpilot longitudinal control to use stock ACC.", "", this);
|
||||||
|
addItem(disableOpenpilotLong);
|
||||||
|
|
||||||
|
QObject::connect(disableOpenpilotLong, &ToggleControl::toggleFlipped, [=]() {
|
||||||
|
if (started) {
|
||||||
|
if (FrogPilotConfirmationDialog::toggle("Reboot required to take effect.", "Reboot Now", this)) {
|
||||||
|
Hardware::reboot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
std::vector<std::tuple<QString, QString, QString, QString>> vehicleToggles {
|
std::vector<std::tuple<QString, QString, QString, QString>> vehicleToggles {
|
||||||
{"LongitudinalTune", "Longitudinal Tune", "Use a custom Toyota longitudinal tune.\n\nCydia = More focused on TSS-P vehicles but works for all Toyotas\n\nDragonPilot = Focused on TSS2 vehicles\n\nFrogPilot = Takes the best of both worlds with some personal tweaks focused around my 2019 Lexus ES 350", ""},
|
{"LongitudinalTune", "Longitudinal Tune", "Use a custom Toyota longitudinal tune.\n\nCydia = More focused on TSS-P vehicles but works for all Toyotas\n\nDragonPilot = Focused on TSS2 vehicles\n\nFrogPilot = Takes the best of both worlds with some personal tweaks focused around my 2019 Lexus ES 350", ""},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user