1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 01:35:35 +03:00

add setting to disable ahi camera uptilt compensation.

This commit is contained in:
Alexander van Saase 2021-05-23 16:11:34 +02:00
parent 072d5ba761
commit cee8b2cc83
4 changed files with 12 additions and 4 deletions

View file

@ -391,6 +391,7 @@
| opflow_hardware | NONE | | | Selection of OPFLOW hardware. |
| opflow_scale | 10.5 | 0 | 10000 | |
| osd_ahi_bordered | OFF | | | Shows a border/corners around the AHI region (pixel OSD only) |
| osd_ahi_camera_uptilt_comp | ON | | | When set to `ON`, the AHI position is adjusted by `osd_camera_uptilt`. For example, with a cammera uptilt of 30 degrees and this setting set to `ON`, the AHI will appear in the middle of the OSD when the aircraft is pitched forward 30 degrees. |
| osd_ahi_height | 162 | | 255 | AHI height in pixels (pixel OSD only) |
| osd_ahi_max_pitch | 20 | 10 | 90 | Max pitch, in degrees, for OSD artificial horizon |
| osd_ahi_reverse_roll | OFF | | | |
@ -402,7 +403,7 @@
| osd_baro_temp_alarm_min | -200 | -550 | 1250 | Temperature under which the baro temperature OSD element will start blinking (decidegrees centigrade) |
| osd_camera_fov_h | 135 | 60 | 150 | Horizontal field of view for the camera in degres |
| osd_camera_fov_v | 85 | 30 | 120 | Vertical field of view for the camera in degres |
| osd_camera_uptilt | 0 | -40 | 80 | Set the camera uptilt for the FPV camera in degres, positive is up, negative is down, relative to the horizontal |
| osd_camera_uptilt | 0 | -40 | 80 | Set the camera uptilt for the FPV camera in degres, positive is up, negative is down, relative to the horizontal. Used for correct display of HUD items and AHI (when enabled). |
| osd_coordinate_digits | 9 | 8 | 11 | |
| osd_crosshairs_style | DEFAULT | | | To set the visual type for the crosshair |
| osd_crsf_lq_format | TYPE1 | | | To select LQ format |

View file

@ -3177,11 +3177,16 @@ groups:
min: -2
max: 2
- name: osd_camera_uptilt
description: "Set the camera uptilt for the FPV camera in degres, positive is up, negative is down, relative to the horizontal"
description: "Set the camera uptilt for the FPV camera in degres, positive is up, negative is down, relative to the horizontal. Used for correct display of HUD items and AHI (when enabled)."
default_value: 0
field: camera_uptilt
min: -40
max: 80
- name: osd_ahi_camera_uptilt_comp
description: "When set to `ON`, the AHI position is adjusted by `osd_camera_uptilt`. For example, with a cammera uptilt of 30 degrees and this setting set to `ON`, the AHI will appear in the middle of the OSD when the aircraft is pitched forward 30 degrees."
default_value: ON
field: ahi_camera_uptilt_comp
type: bool
- name: osd_camera_fov_h
description: "Horizontal field of view for the camera in degres"
default_value: 135

View file

@ -194,7 +194,7 @@ static bool osdDisplayHasCanvas;
#define AH_MAX_PITCH_DEFAULT 20 // Specify default maximum AHI pitch value displayed (degrees)
PG_REGISTER_WITH_RESET_TEMPLATE(osdConfig_t, osdConfig, PG_OSD_CONFIG, 3);
PG_REGISTER_WITH_RESET_TEMPLATE(osdConfig_t, osdConfig, PG_OSD_CONFIG, 4);
PG_REGISTER_WITH_RESET_FN(osdLayoutsConfig_t, osdLayoutsConfig, PG_OSD_LAYOUTS_CONFIG, 0);
static int digitCount(int32_t value)
@ -2030,7 +2030,7 @@ static bool osdDrawSingleElement(uint8_t item)
rollAngle = DECIDEGREES_TO_RADIANS(attitude.values.roll);
pitchAngle = DECIDEGREES_TO_RADIANS(attitude.values.pitch);
#endif
pitchAngle -= DEGREES_TO_RADIANS(osdConfig()->camera_uptilt);
pitchAngle -= osdConfig()->ahi_camera_uptilt_comp ? DEGREES_TO_RADIANS(osdConfig()->camera_uptilt) : 0;
if (osdConfig()->ahi_reverse_roll) {
rollAngle = -rollAngle;
}
@ -2897,6 +2897,7 @@ PG_RESET_TEMPLATE(osdConfig_t, osdConfig,
.crosshairs_style = SETTING_OSD_CROSSHAIRS_STYLE_DEFAULT,
.horizon_offset = SETTING_OSD_HORIZON_OFFSET_DEFAULT,
.camera_uptilt = SETTING_OSD_CAMERA_UPTILT_DEFAULT,
.ahi_camera_uptilt_comp = SETTING_OSD_AHI_CAMERA_UPTILT_COMP_DEFAULT,
.camera_fov_h = SETTING_OSD_CAMERA_FOV_H_DEFAULT,
.camera_fov_v = SETTING_OSD_CAMERA_FOV_V_DEFAULT,
.hud_margin_h = SETTING_OSD_HUD_MARGIN_H_DEFAULT,

View file

@ -332,6 +332,7 @@ typedef struct osdConfig_s {
uint8_t crosshairs_style; // from osd_crosshairs_style_e
int8_t horizon_offset;
int8_t camera_uptilt;
bool ahi_camera_uptilt_comp;
uint8_t camera_fov_h;
uint8_t camera_fov_v;
uint8_t hud_margin_h;