mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 08:33:34 +08:00
Added crosshairs to MSP OSD driver
This commit is contained in:
committed by
Daniel Agar
parent
a46ef72fff
commit
36877b9efc
@@ -36,12 +36,26 @@ parameters:
|
|||||||
15: (unused) ESC_TMP
|
15: (unused) ESC_TMP
|
||||||
16: (unused) PITCH_ANGLE
|
16: (unused) PITCH_ANGLE
|
||||||
17: (unused) ROLL_ANGLE
|
17: (unused) ROLL_ANGLE
|
||||||
18: (unused) CROSSHAIRS
|
18: CROSSHAIRS
|
||||||
19: AVG_CELL_VOLTAGE
|
19: AVG_CELL_VOLTAGE
|
||||||
20: (unused) HORIZON_SIDEBARS
|
20: (unused) HORIZON_SIDEBARS
|
||||||
21: POWER
|
21: POWER
|
||||||
default: 16383
|
default: 16383
|
||||||
|
|
||||||
|
# OSD Crosshairs Vertical Position
|
||||||
|
OSD_CH_HEIGHT:
|
||||||
|
description:
|
||||||
|
short: OSD Crosshairs Height
|
||||||
|
long: |
|
||||||
|
Controls the vertical position of the crosshair display.
|
||||||
|
Resolution is limited by OSD to 15 discrete values. Negative
|
||||||
|
values will display the crosshairs below the horizon
|
||||||
|
type: int32
|
||||||
|
default: 0
|
||||||
|
min: -8
|
||||||
|
max: 8
|
||||||
|
|
||||||
|
|
||||||
# OSD Log Level
|
# OSD Log Level
|
||||||
OSD_LOG_LEVEL:
|
OSD_LOG_LEVEL:
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ const uint16_t osd_mah_drawn_pos = 2449;
|
|||||||
|
|
||||||
// Bottom Row 3
|
// Bottom Row 3
|
||||||
const uint16_t osd_craft_name_pos = 2480;
|
const uint16_t osd_craft_name_pos = 2480;
|
||||||
|
const uint16_t osd_crosshairs_pos = 2319;
|
||||||
|
|
||||||
// Right
|
// Right
|
||||||
const uint16_t osd_main_batt_voltage_pos = 2073;
|
const uint16_t osd_main_batt_voltage_pos = 2073;
|
||||||
@@ -170,13 +171,18 @@ void MspOsd::SendConfig()
|
|||||||
msp_osd_config.osd_avg_cell_voltage_pos = enabled(SymbolIndex::AVG_CELL_VOLTAGE) ? osd_avg_cell_voltage_pos :
|
msp_osd_config.osd_avg_cell_voltage_pos = enabled(SymbolIndex::AVG_CELL_VOLTAGE) ? osd_avg_cell_voltage_pos :
|
||||||
LOCATION_HIDDEN;
|
LOCATION_HIDDEN;
|
||||||
|
|
||||||
|
// the location of our crosshairs can change
|
||||||
|
msp_osd_config.osd_crosshairs_pos = LOCATION_HIDDEN;
|
||||||
|
|
||||||
|
if (enabled(SymbolIndex::CROSSHAIRS)) {
|
||||||
|
msp_osd_config.osd_crosshairs_pos = osd_crosshairs_pos - 32 * _param_osd_ch_height.get();
|
||||||
|
}
|
||||||
|
|
||||||
// possibly available, but not currently used
|
// possibly available, but not currently used
|
||||||
msp_osd_config.osd_flymode_pos = LOCATION_HIDDEN;
|
msp_osd_config.osd_flymode_pos = LOCATION_HIDDEN;
|
||||||
msp_osd_config.osd_esc_tmp_pos = LOCATION_HIDDEN;
|
msp_osd_config.osd_esc_tmp_pos = LOCATION_HIDDEN;
|
||||||
msp_osd_config.osd_pitch_angle_pos = LOCATION_HIDDEN;
|
msp_osd_config.osd_pitch_angle_pos = LOCATION_HIDDEN;
|
||||||
msp_osd_config.osd_roll_angle_pos = LOCATION_HIDDEN;
|
msp_osd_config.osd_roll_angle_pos = LOCATION_HIDDEN;
|
||||||
msp_osd_config.osd_crosshairs_pos = LOCATION_HIDDEN;
|
|
||||||
|
|
||||||
msp_osd_config.osd_horizon_sidebars_pos = LOCATION_HIDDEN;
|
msp_osd_config.osd_horizon_sidebars_pos = LOCATION_HIDDEN;
|
||||||
|
|
||||||
// Not implemented or not available
|
// Not implemented or not available
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ private:
|
|||||||
// parameters
|
// parameters
|
||||||
DEFINE_PARAMETERS(
|
DEFINE_PARAMETERS(
|
||||||
(ParamInt<px4::params::OSD_SYMBOLS>) _param_osd_symbols,
|
(ParamInt<px4::params::OSD_SYMBOLS>) _param_osd_symbols,
|
||||||
|
(ParamInt<px4::params::OSD_CH_HEIGHT>) _param_osd_ch_height,
|
||||||
(ParamInt<px4::params::OSD_SCROLL_RATE>) _param_osd_scroll_rate,
|
(ParamInt<px4::params::OSD_SCROLL_RATE>) _param_osd_scroll_rate,
|
||||||
(ParamInt<px4::params::OSD_DWELL_TIME>) _param_osd_dwell_time,
|
(ParamInt<px4::params::OSD_DWELL_TIME>) _param_osd_dwell_time,
|
||||||
(ParamInt<px4::params::OSD_LOG_LEVEL>) _param_osd_log_level
|
(ParamInt<px4::params::OSD_LOG_LEVEL>) _param_osd_log_level
|
||||||
|
|||||||
Reference in New Issue
Block a user