From 1e1bf7e4bbb038fb1aff35afad44602f561b5ebb Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 16 Oct 2016 21:35:31 +0200 Subject: [PATCH] ekf2 reset: fix sign of delta altitude for global position topic Signed-off-by: Roman --- src/modules/ekf2/ekf2_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 978350af00..d6bdd53f74 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -889,6 +889,8 @@ void Ekf2::task_main() global_pos.alt = -pos[2] + lpos.ref_alt; // Altitude AMSL in meters _ekf.get_posD_reset(&global_pos.delta_alt, &global_pos.alt_reset_counter); + // global altitude has opposite sign of local down position + global_pos.delta_alt *= -1.0f; global_pos.vel_n = velocity[0]; // Ground north velocity, m/s global_pos.vel_e = velocity[1]; // Ground east velocity, m/s