AP_OSD: add rangefinder panel
@ -183,6 +183,7 @@ private:
|
||||
AP_OSD_Setting vtx_power{false, 0, 0};
|
||||
AP_OSD_Setting hgt_abvterr{false, 23, 7};
|
||||
AP_OSD_Setting fence{false, 14, 9};
|
||||
AP_OSD_Setting rngf{false, 0, 0};
|
||||
#if HAL_PLUSCODE_ENABLE
|
||||
AP_OSD_Setting pluscode{false, 0, 0};
|
||||
#endif
|
||||
@ -254,6 +255,7 @@ private:
|
||||
void draw_vtx_power(uint8_t x, uint8_t y);
|
||||
void draw_hgt_abvterr(uint8_t x, uint8_t y);
|
||||
void draw_fence(uint8_t x, uint8_t y);
|
||||
void draw_rngf(uint8_t x, uint8_t y);
|
||||
|
||||
|
||||
struct {
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <AP_OLC/AP_OLC.h>
|
||||
#include <AP_VideoTX/AP_VideoTX.h>
|
||||
#include <AP_Terrain/AP_Terrain.h>
|
||||
#include <AP_RangeFinder/AP_RangeFinder.h>
|
||||
#if APM_BUILD_TYPE(APM_BUILD_Rover)
|
||||
#include <AP_WindVane/AP_WindVane.h>
|
||||
#endif
|
||||
@ -976,6 +977,22 @@ const AP_Param::GroupInfo AP_OSD_Screen::var_info[] = {
|
||||
// @Description: Vertical position on screen
|
||||
// @Range: 0 15
|
||||
AP_SUBGROUPINFO(fence, "FENCE", 59, AP_OSD_Screen, AP_OSD_Setting),
|
||||
|
||||
// @Param: RNGF_EN
|
||||
// @DisplayName: RNGF_EN
|
||||
// @Description: Displays a rangefinder's distance in cm
|
||||
// @Values: 0:Disabled,1:Enabled
|
||||
|
||||
// @Param: RNGF_X
|
||||
// @DisplayName: RNGF_X
|
||||
// @Description: Horizontal position on screen
|
||||
// @Range: 0 29
|
||||
|
||||
// @Param: RNGF_Y
|
||||
// @DisplayName: RNGF_Y
|
||||
// @Description: Vertical position on screen
|
||||
// @Range: 0 15
|
||||
AP_SUBGROUPINFO(rngf, "RNGF", 60, AP_OSD_Screen, AP_OSD_Setting),
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
||||
@ -1074,6 +1091,7 @@ AP_OSD_Screen::AP_OSD_Screen()
|
||||
#define SYM_TERALT 0xEF
|
||||
#define SYM_FENCE_ENABLED 0xF5
|
||||
#define SYM_FENCE_DISABLED 0xF6
|
||||
#define SYM_RNGFD 0xF7
|
||||
|
||||
|
||||
void AP_OSD_AbstractScreen::set_backend(AP_OSD_Backend *_backend)
|
||||
@ -1967,6 +1985,18 @@ void AP_OSD_Screen::draw_fence(uint8_t x, uint8_t y)
|
||||
}
|
||||
}
|
||||
|
||||
void AP_OSD_Screen::draw_rngf(uint8_t x, uint8_t y)
|
||||
{
|
||||
RangeFinder *rangefinder = RangeFinder::get_singleton();
|
||||
if (rangefinder == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (rangefinder->status_orient(ROTATION_PITCH_270) <= RangeFinder::Status::NoData) {
|
||||
backend->write(x, y, false, "%cNO DATA", SYM_RNGFD);
|
||||
} else {
|
||||
backend->write(x, y, false, "%c%2.2f%c", SYM_RNGFD, u_scale(DISTANCE, (rangefinder->distance_cm_orient(ROTATION_PITCH_270) * 0.01f)), u_icon(DISTANCE));
|
||||
}
|
||||
}
|
||||
|
||||
#define DRAW_SETTING(n) if (n.enabled) draw_ ## n(n.xpos, n.ypos)
|
||||
|
||||
@ -1989,6 +2019,7 @@ void AP_OSD_Screen::draw(void)
|
||||
DRAW_SETTING(hgt_abvterr);
|
||||
#endif
|
||||
|
||||
DRAW_SETTING(rngf);
|
||||
DRAW_SETTING(waypoint);
|
||||
DRAW_SETTING(xtrack_error);
|
||||
DRAW_SETTING(bat_volt);
|
||||
|
@ -15822,33 +15822,33 @@ MAX7456
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10101000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10100010
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00100000
|
||||
10000010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00010010
|
||||
00000000
|
||||
00000000
|
||||
00010000
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@ -15825,33 +15825,33 @@ MAX7456
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10101000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10100010
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00100000
|
||||
10000010
|
||||
00010000
|
||||
00100000
|
||||
00100010
|
||||
00010010
|
||||
00000001
|
||||
00000000
|
||||
00010000
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@ -15831,33 +15831,33 @@ MAX7456
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10101000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10100010
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00100000
|
||||
10000010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
@ -15831,33 +15831,33 @@ MAX7456
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10101000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10100010
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00100000
|
||||
10000010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@ -15828,33 +15828,33 @@ MAX7456
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10101000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000000
|
||||
00101010
|
||||
10000010
|
||||
10100010
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00100000
|
||||
10000010
|
||||
00000000
|
||||
00100000
|
||||
00100010
|
||||
00000010
|
||||
00000000
|
||||
00000000
|
||||
00000000
|
||||
01010101
|
||||
01010101
|
||||
01010101
|
||||
|
Before Width: | Height: | Size: 502 KiB After Width: | Height: | Size: 14 KiB |