From 6328a7233f24f0ef72d0e6d7499defe901356d40 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2018 13:12:49 +1000 Subject: [PATCH] AP_OSD: cope with no EKF for vspeed --- libraries/AP_OSD/AP_OSD_Screen.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/AP_OSD/AP_OSD_Screen.cpp b/libraries/AP_OSD/AP_OSD_Screen.cpp index 7e3bc9247b..2d8b735c7a 100644 --- a/libraries/AP_OSD/AP_OSD_Screen.cpp +++ b/libraries/AP_OSD/AP_OSD_Screen.cpp @@ -629,8 +629,12 @@ void AP_OSD_Screen::draw_aspeed(uint8_t x, uint8_t y) void AP_OSD_Screen::draw_vspeed(uint8_t x, uint8_t y) { Vector3f v; - AP::ahrs().get_velocity_NED(v); - float vspd = -v.z; + float vspd; + if (AP::ahrs().get_velocity_NED(v)) { + vspd = -v.z; + } else { + vspd = AP::baro().get_climb_rate(); + } char sym; if (vspd > 3.0f) { sym = SYM_UP_UP;