|
|
|
@ -38,6 +38,7 @@
@@ -38,6 +38,7 @@
|
|
|
|
|
#include <AP_MSP/msp.h> |
|
|
|
|
#include <AP_OLC/AP_OLC.h> |
|
|
|
|
#include <AP_VideoTX/AP_VideoTX.h> |
|
|
|
|
#include <AP_Terrain/AP_Terrain.h> |
|
|
|
|
#if APM_BUILD_TYPE(APM_BUILD_Rover) |
|
|
|
|
#include <AP_WindVane/AP_WindVane.h> |
|
|
|
|
#endif |
|
|
|
@ -712,7 +713,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
@@ -712,7 +713,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
|
|
|
|
|
// @Description: Vertical position on screen
|
|
|
|
|
// @Range: 0 15
|
|
|
|
|
AP_SUBGROUPINFO(clk, "CLK", 43, AP_OSD_Screen, AP_OSD_Setting), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAL_MSP_ENABLED |
|
|
|
|
// @Param: SIDEBARS_EN
|
|
|
|
|
// @DisplayName: SIDEBARS_EN
|
|
|
|
@ -721,7 +722,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
@@ -721,7 +722,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
|
|
|
|
|
|
|
|
|
|
// @Param: SIDEBARS_X
|
|
|
|
|
// @DisplayName: SIDEBARS_X
|
|
|
|
|
// @Description: Horizontal position on screen (MSP OSD only)
|
|
|
|
|
// @Description: Horizontal position on screen (MSP OSD only)
|
|
|
|
|
// @Range: 0 29
|
|
|
|
|
|
|
|
|
|
// @Param: SIDEBARS_Y
|
|
|
|
@ -737,7 +738,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
@@ -737,7 +738,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
|
|
|
|
|
|
|
|
|
|
// @Param: CRSSHAIR_X
|
|
|
|
|
// @DisplayName: CRSSHAIR_X
|
|
|
|
|
// @Description: Horizontal position on screen (MSP OSD only)
|
|
|
|
|
// @Description: Horizontal position on screen (MSP OSD only)
|
|
|
|
|
// @Range: 0 29
|
|
|
|
|
|
|
|
|
|
// @Param: CRSSHAIR_Y
|
|
|
|
@ -846,7 +847,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
@@ -846,7 +847,7 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
|
|
|
|
|
#if HAL_PLUSCODE_ENABLE |
|
|
|
|
// @Param: PLUSCODE_EN
|
|
|
|
|
// @DisplayName: PLUSCODE_EN
|
|
|
|
|
// @Description: Displays pluscode (OLC) element
|
|
|
|
|
// @Description: Displays pluscode (OLC) element
|
|
|
|
|
// @Values: 0:Disabled,1:Enabled
|
|
|
|
|
|
|
|
|
|
// @Param: PLUSCODE_X
|
|
|
|
@ -911,6 +912,23 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
@@ -911,6 +912,23 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
|
|
|
|
|
// @Range: 0 15
|
|
|
|
|
AP_SUBGROUPINFO(vtx_power, "VTX_PWR", 55, AP_OSD_Screen, AP_OSD_Setting), |
|
|
|
|
|
|
|
|
|
#if AP_TERRAIN_AVAILABLE |
|
|
|
|
// @Param: TER_HGT_EN
|
|
|
|
|
// @DisplayName: TER_HGT_EN
|
|
|
|
|
// @Description: Displays Height above terrain
|
|
|
|
|
// @Values: 0:Disabled,1:Enabled
|
|
|
|
|
|
|
|
|
|
// @Param: TER_HGT_X
|
|
|
|
|
// @DisplayName: TER_HGT_X
|
|
|
|
|
// @Description: Horizontal position on screen
|
|
|
|
|
// @Range: 0 29
|
|
|
|
|
|
|
|
|
|
// @Param: TER_HGT_Y
|
|
|
|
|
// @DisplayName: TER_HGT_Y
|
|
|
|
|
// @Description: Vertical position on screen
|
|
|
|
|
// @Range: 0 15
|
|
|
|
|
AP_SUBGROUPINFO(hgt_abvterr, "TER_HGT", 56, AP_OSD_Screen, AP_OSD_Setting), |
|
|
|
|
#endif |
|
|
|
|
AP_GROUPEND |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -1274,7 +1292,7 @@ void AP_OSD_Screen::draw_speed(uint8_t x, uint8_t y, float angle_rad, float magn
@@ -1274,7 +1292,7 @@ void AP_OSD_Screen::draw_speed(uint8_t x, uint8_t y, float angle_rad, float magn
|
|
|
|
|
static const int32_t interval = 36000 / SYM_ARROW_COUNT; |
|
|
|
|
char arrow = SYM_ARROW_START + ((int32_t(angle_rad*DEGX100) + interval / 2) / interval) % SYM_ARROW_COUNT; |
|
|
|
|
if (u_scale(SPEED, magnitude) < 10.0) { |
|
|
|
|
backend->write(x, y, false, "%c%3.1f%c", arrow, u_scale(SPEED, magnitude), u_icon(SPEED));
|
|
|
|
|
backend->write(x, y, false, "%c%3.1f%c", arrow, u_scale(SPEED, magnitude), u_icon(SPEED)); |
|
|
|
|
} else { |
|
|
|
|
backend->write(x, y, false, "%c%3d%c", arrow, (int)u_scale(SPEED, magnitude), u_icon(SPEED)); |
|
|
|
|
} |
|
|
|
@ -1851,6 +1869,19 @@ void AP_OSD_Screen::draw_vtx_power(uint8_t x, uint8_t y)
@@ -1851,6 +1869,19 @@ void AP_OSD_Screen::draw_vtx_power(uint8_t x, uint8_t y)
|
|
|
|
|
} |
|
|
|
|
backend->write(x, y, false, "%4hu%c", powr, SYM_MW); |
|
|
|
|
} |
|
|
|
|
#if AP_TERRAIN_AVAILABLE |
|
|
|
|
void AP_OSD_Screen::draw_hgt_abvterr(uint8_t x, uint8_t y) |
|
|
|
|
{ |
|
|
|
|
AP_Terrain &terrain = AP::terrain(); |
|
|
|
|
|
|
|
|
|
float terrain_altitude; |
|
|
|
|
if (terrain.height_above_terrain(terrain_altitude,true)) { |
|
|
|
|
backend->write(x, y, terrain_altitude < osd->warn_terr, "%4d%c", (int)u_scale(ALTITUDE, terrain_altitude), u_icon(ALTITUDE)); |
|
|
|
|
} else { |
|
|
|
|
backend->write(x, y, false, " ---%c", u_icon(ALTITUDE)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#define DRAW_SETTING(n) if (n.enabled) draw_ ## n(n.xpos, n.ypos) |
|
|
|
|
|
|
|
|
@ -1868,6 +1899,11 @@ void AP_OSD_Screen::draw(void)
@@ -1868,6 +1899,11 @@ void AP_OSD_Screen::draw(void)
|
|
|
|
|
DRAW_SETTING(horizon); |
|
|
|
|
DRAW_SETTING(compass); |
|
|
|
|
DRAW_SETTING(altitude); |
|
|
|
|
|
|
|
|
|
#if AP_TERRAIN_AVAILABLE |
|
|
|
|
DRAW_SETTING(hgt_abvterr); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
DRAW_SETTING(waypoint); |
|
|
|
|
DRAW_SETTING(xtrack_error); |
|
|
|
|
DRAW_SETTING(bat_volt); |
|
|
|
|