Visuals - Quality of Life - Camera View

Choose your preferred camera view for the onroad UI. This is purely a visual change and doesn't impact how openpilot drives.
This commit is contained in:
FrogAi 2024-05-11 15:06:50 -07:00
parent 87e11e5bc4
commit 66f8878ba8
4 changed files with 9 additions and 2 deletions

View File

@ -628,7 +628,7 @@ void AnnotatedCameraWidget::paintGL() {
// Wide or narrow cam dependent on speed // Wide or narrow cam dependent on speed
bool has_wide_cam = available_streams.count(VISION_STREAM_WIDE_ROAD); bool has_wide_cam = available_streams.count(VISION_STREAM_WIDE_ROAD);
if (has_wide_cam) { if (has_wide_cam && cameraView == 0) {
if ((v_ego < 10) || available_streams.size() == 1) { if ((v_ego < 10) || available_streams.size() == 1) {
wide_cam_requested = true; wide_cam_requested = true;
} else if (v_ego > 15) { } else if (v_ego > 15) {
@ -638,7 +638,9 @@ void AnnotatedCameraWidget::paintGL() {
// for replay of old routes, never go to widecam // for replay of old routes, never go to widecam
wide_cam_requested = wide_cam_requested && s->scene.calibration_wide_valid; wide_cam_requested = wide_cam_requested && s->scene.calibration_wide_valid;
} }
CameraWidget::setStreamType(wide_cam_requested ? VISION_STREAM_WIDE_ROAD : VISION_STREAM_ROAD); CameraWidget::setStreamType(cameraView == 1 ? VISION_STREAM_DRIVER :
cameraView == 3 || wide_cam_requested ? VISION_STREAM_WIDE_ROAD :
VISION_STREAM_ROAD);
s->scene.wide_cam = CameraWidget::getStreamType() == VISION_STREAM_WIDE_ROAD; s->scene.wide_cam = CameraWidget::getStreamType() == VISION_STREAM_WIDE_ROAD;
if (s->scene.calibration_valid) { if (s->scene.calibration_valid) {
@ -811,6 +813,8 @@ void AnnotatedCameraWidget::paintFrogPilotWidgets(QPainter &painter, const UISce
blindSpotLeft = scene.blind_spot_left; blindSpotLeft = scene.blind_spot_left;
blindSpotRight = scene.blind_spot_right; blindSpotRight = scene.blind_spot_right;
cameraView = scene.camera_view;
compass = scene.compass; compass = scene.compass;
bool enableCompass = compass && !hideBottomIcons; bool enableCompass = compass && !hideBottomIcons;
compass_img->setVisible(enableCompass); compass_img->setVisible(enableCompass);

View File

@ -142,6 +142,7 @@ private:
float unconfirmedSpeedLimit; float unconfirmedSpeedLimit;
int alertSize; int alertSize;
int cameraView;
int conditionalSpeed; int conditionalSpeed;
int conditionalSpeedLead; int conditionalSpeedLead;
int conditionalStatus; int conditionalStatus;

View File

@ -420,6 +420,7 @@ void ui_update_frogpilot_params(UIState *s, Params &params) {
bool quality_of_life_visuals = params.getBool("QOLVisuals"); bool quality_of_life_visuals = params.getBool("QOLVisuals");
scene.big_map = quality_of_life_visuals && params.getBool("BigMap"); scene.big_map = quality_of_life_visuals && params.getBool("BigMap");
scene.full_map = scene.big_map && params.getBool("FullMap"); scene.full_map = scene.big_map && params.getBool("FullMap");
scene.camera_view = quality_of_life_visuals ? params.getInt("CameraView") : 0;
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController"); scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset"); scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");

View File

@ -225,6 +225,7 @@ typedef struct UIScene {
int alert_size; int alert_size;
int bearing_deg; int bearing_deg;
int camera_view;
int conditional_speed; int conditional_speed;
int conditional_speed_lead; int conditional_speed_lead;
int conditional_status; int conditional_status;