From 9983bf23646bf6df3f066dc1b804d0acbc4fe4b6 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Wed, 28 Dec 2016 10:50:27 +1100 Subject: [PATCH] ekf2: fix errors in publishing of local position origin validity flags --- src/modules/ekf2/ekf2_main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index b88a2b85be..f4cfd99a49 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -829,10 +829,8 @@ void Ekf2::task_main() // Position of local NED origin in GPS / WGS84 frame struct map_projection_reference_s ekf_origin = {}; - // true if position (x, y) is valid and has valid global reference (ref_lat, ref_lon) - _ekf.get_ekf_origin(&lpos.ref_timestamp, &ekf_origin, &lpos.ref_alt); - lpos.xy_global = _ekf.global_position_is_valid(); - lpos.z_global = true; // true if z is valid and has valid global reference (ref_alt) + // true if position (x,y,z) has a valid WGS-84 global reference (ref_lat, ref_lon, alt) + lpos.xy_global = lpos.z_global = _ekf.get_ekf_origin(&lpos.ref_timestamp, &ekf_origin, &lpos.ref_alt); lpos.ref_lat = ekf_origin.lat_rad * 180.0 / M_PI; // Reference point latitude in degrees lpos.ref_lon = ekf_origin.lon_rad * 180.0 / M_PI; // Reference point longitude in degrees