Disable Widecam Feature

Disable Widecam Feature

Disable Widecam Feature

Disable Widecam Feature

Disable Widecam Feature
This commit is contained in:
prabhaavp
2026-05-18 18:33:23 -04:00
committed by firestar5683
parent 3d6c55962b
commit 8846b907d7
9 changed files with 47 additions and 8 deletions
+1
View File
@@ -179,6 +179,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"CalibrationProgress", {PERSISTENT, FLOAT, "0.0", "0.0", 3}},
{"CameraView", {PERSISTENT, INT, "3", "0", 2}},
{"CancelDownloadMaps", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}},
{"DisableWideRoad", {PERSISTENT, BOOL, "0", "0", 3}},
{"CancelModelDownload", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}},
{"CancelThemeDownload", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}},
{"CarMake", {PERSISTENT, STRING, "mock", "mock", 0}},
@@ -576,7 +576,7 @@ class AugmentedRoadView(CameraView):
elif camera_view == CAMERA_VIEW_STANDARD:
target = ROAD_CAM
elif camera_view == CAMERA_VIEW_WIDE:
target = WIDE_CAM
target = WIDE_CAM if WIDE_CAM in self.available_streams else ROAD_CAM
elif sm['selfdriveState'].experimentalMode and WIDE_CAM in self.available_streams:
v_ego = sm['carState'].vEgo
if v_ego < WIDE_CAM_MAX_SPEED:
@@ -3141,5 +3141,18 @@
"options_endpoint": "/api/models/installed"
}
]
},
{
"name": "Developer",
"icon": "bi-exclamation-triangle",
"params": [
{
"key": "DisableWideRoad",
"label": "Disable Wide Road Camera",
"description": "Only enable this if the wide camera is broken or for development!\n\nDisabling the wide camera may degrade driving performance and cause instability.\n\nRequires a reboot to take effect.",
"data_type": "bool",
"ui_type": "toggle"
}
]
}
]
+2 -1
View File
@@ -49,6 +49,7 @@ StarPilotDevicePanel::StarPilotDevicePanel(StarPilotSettingsWindow *parent, bool
const std::vector<std::tuple<QString, QString, QString, QString>> deviceToggles {
{"DeviceManagement", tr("Device Settings"), tr("<b>Settings that control how the device runs, powers off, and manages driving data.</b>"), "../../starpilot/assets/toggle_icons/icon_device.png"},
{"DeviceShutdown", tr("Device Shutdown Timer"), tr("<b>Keep the device on for the set amount of time after a drive</b> before it shuts down automatically."), ""},
{"DisableWideRoad", tr("Disable Wide Road Camera"), QString("<b>%1</b><br><br>%2").arg(tr("WARNING: Only use this if the wide camera is malfunctioning or for development purposes. This may cause instability!")).arg(tr("Requires a reboot to take effect.")), ""},
{"NoLogging", tr("Disable Logging"), QString("<b>%1</b><br><br>%2").arg(tr("WARNING: This will prevent your drives from being recorded and all data will be unobtainable!")).arg(tr("<b>Prevent the device from saving driving data.</b>")), ""},
{"NoUploads", tr("Disable Uploads"), QString("<b>%1</b><br><br>%2").arg(tr("WARNING: This will prevent your drives from being uploaded to <b>comma connect</b> which will impact debugging and official support from comma!")).arg(tr("<b>Prevent the device from uploading driving data.</b>")), ""},
{"HigherBitrate", tr("High-Quality Recording"), tr("<b>Save drive footage in higher video quality.</b>"), ""},
@@ -178,7 +179,7 @@ StarPilotDevicePanel::StarPilotDevicePanel(StarPilotSettingsWindow *parent, bool
QObject::connect(static_cast<ToggleControl*>(toggles[key]), &ToggleControl::toggleFlipped, this, &StarPilotDevicePanel::updateToggles);
}
QSet<QString> rebootKeys = {"HigherBitrate", "UseKonikServer"};
QSet<QString> rebootKeys = {"DisableWideRoad", "HigherBitrate", "UseKonikServer"};
for (const QString &key : rebootKeys) {
QObject::connect(static_cast<ToggleControl*>(toggles[key]), &ToggleControl::toggleFlipped, [key, this](bool state) {
QString filePath;
+1 -1
View File
@@ -23,7 +23,7 @@ private:
std::map<QString, AbstractControl*> toggles;
QSet<QString> deviceManagementKeys = {"DeviceShutdown", "HigherBitrate", "IncreaseThermalLimits", "LowVoltageShutdown", "NoLogging", "NoUploads", "UseKonikServer"};
QSet<QString> deviceManagementKeys = {"DeviceShutdown", "DisableWideRoad", "HigherBitrate", "IncreaseThermalLimits", "LowVoltageShutdown", "NoLogging", "NoUploads", "UseKonikServer"};
QSet<QString> screenKeys = {"ScreenBrightness", "ScreenBrightnessOnroad", "ScreenRecorder", "ScreenTimeout", "ScreenTimeoutOnroad", "StandbyMode"};
QSet<QString> parentKeys;
+10 -1
View File
@@ -69,7 +69,9 @@ StarPilotVisualsPanel::StarPilotVisualsPanel(StarPilotSettingsWindow *parent, bo
{"QOLVisuals", tr("Quality of Life"), tr("<b>Miscellaneous visual changes</b> to fine-tune how the driving screen looks."), "../../starpilot/assets/toggle_icons/icon_quality_of_life.png"},
{"CameraView", tr("Camera View"), tr("<b>Select the active camera view.</b> This is purely a visual change and doesn't impact how openpilot drives!"), ""},
{"DriverCamera", tr("Show Driver Camera When In Reverse"), tr("<b>Show the driver camera feed</b> when the vehicle is in reverse."), ""},
{"StoppedTimer", tr("Stopped Timer"), tr("<b>Show a timer when stopped</b> in place of the current speed to indicate how long the vehicle has been stopped."), ""}
{"StoppedTimer", tr("Stopped Timer"), tr("<b>Show a timer when stopped</b> in place of the current speed to indicate how long the vehicle has been stopped."), ""},
{"DisableWideRoad", tr("Disable Wide Road Camera"), QString("<b>%1</b><br><br>%2").arg(tr("Only enable this if the wide camera is broken or for development!")).arg(tr("<b>Disabling the wide camera may degrade driving performance and cause instability.</b><br><br>Requires a reboot to take effect.")), "../../starpilot/assets/toggle_icons/icon_advanced_device.png"}
};
for (const auto &[param, title, desc, icon] : visualToggles) {
@@ -178,6 +180,13 @@ StarPilotVisualsPanel::StarPilotVisualsPanel(StarPilotSettingsWindow *parent, bo
QObject::connect(static_cast<ToggleControl*>(toggles[key]), &ToggleControl::toggleFlipped, this, &StarPilotVisualsPanel::updateToggles);
}
static_cast<ParamControl*>(toggles["DisableWideRoad"])->setConfirmation(true, false);
QObject::connect(static_cast<ToggleControl*>(toggles["DisableWideRoad"]), &ToggleControl::toggleFlipped, [this](bool state) {
if (StarPilotConfirmationDialog::toggleReboot(this)) {
Hardware::reboot();
}
});
openDescriptions(forceOpenDescriptions, toggles);
QObject::connect(parent, &StarPilotSettingsWindow::closeSubPanel, [visualsLayout, visualsPanel, this] {
+3 -3
View File
@@ -35,7 +35,7 @@ const CameraConfig WIDE_ROAD_CAMERA_CONFIG = {
.focal_len = 1.71,
.publish_name = "wideRoadCameraState",
.init_camera_state = &cereal::Event::Builder::initWideRoadCameraState,
.enabled = !getenv("DISABLE_WIDE_ROAD"),
.enabled = true, // Runtime check happens in SpectraCamera constructor
.phy = CAM_ISP_IFE_IN_RES_PHY_0,
.vignetting_correction = false,
.output_type = ISP_IFE_PROCESSED,
@@ -47,7 +47,7 @@ const CameraConfig ROAD_CAMERA_CONFIG = {
.focal_len = 8.0,
.publish_name = "roadCameraState",
.init_camera_state = &cereal::Event::Builder::initRoadCameraState,
.enabled = !getenv("DISABLE_ROAD"),
.enabled = true, // Runtime check happens in SpectraCamera constructor
.phy = CAM_ISP_IFE_IN_RES_PHY_1,
.vignetting_correction = true,
.output_type = ISP_IFE_PROCESSED,
@@ -59,7 +59,7 @@ const CameraConfig DRIVER_CAMERA_CONFIG = {
.focal_len = 1.71,
.publish_name = "driverCameraState",
.init_camera_state = &cereal::Event::Builder::initDriverCameraState,
.enabled = !getenv("DISABLE_DRIVER"),
.enabled = true, // Runtime check happens in SpectraCamera constructor
.phy = CAM_ISP_IFE_IN_RES_PHY_2,
.vignetting_correction = false,
.output_type = ISP_BPS_PROCESSED,
+11 -1
View File
@@ -234,8 +234,18 @@ void SpectraMaster::init() {
SpectraCamera::SpectraCamera(SpectraMaster *master, const CameraConfig &config)
: m(master),
enabled(config.enabled),
cc(config) {
// Runtime check for disable environment variables (must happen after main() sets them)
bool should_disable = false;
if (config.camera_num == 0 && getenv("DISABLE_WIDE_ROAD")) {
should_disable = true;
} else if (config.camera_num == 1 && getenv("DISABLE_ROAD")) {
should_disable = true;
} else if (config.camera_num == 2 && getenv("DISABLE_DRIVER")) {
should_disable = true;
}
enabled = !should_disable;
ife_buf_depth = VIPC_BUFFER_COUNT;
assert(ife_buf_depth < MAX_IFE_BUFS);
}
+5
View File
@@ -12,6 +12,11 @@ int main(int argc, char *argv[]) {
LOGW("camerad: set_core_affinity failed (%d), continuing", ret);
}
if (Params().getBool("DisableWideRoad")) {
setenv("DISABLE_WIDE_ROAD", "1", 1);
LOGW("camerad: DisableWideRoad param set, disabling wide road camera");
}
camerad_thread();
return 0;
}