From 31f20db139dbee917ecddaafbb884cc8cb98d0b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 21 Aug 2015 20:59:53 +1000 Subject: [PATCH] AP_GPS: provide hdop and speed accuracy with UAVCAN GPS --- libraries/AP_GPS/AP_GPS_PX4.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_GPS/AP_GPS_PX4.cpp b/libraries/AP_GPS/AP_GPS_PX4.cpp index 21c9d490dc..6a8896aa41 100644 --- a/libraries/AP_GPS/AP_GPS_PX4.cpp +++ b/libraries/AP_GPS/AP_GPS_PX4.cpp @@ -64,6 +64,7 @@ AP_GPS_PX4::read(void) state.ground_speed = _gps_pos.vel_m_s; state.ground_course_cd = int32_t(double(_gps_pos.cog_rad) / M_PI * 18000. +.5); + state.hdop = _gps_pos.eph*100; // convert epoch timestamp back to gps epoch - evil hack until we get the genuine // raw week information (or APM switches to Posix epoch ;-) ) @@ -83,6 +84,8 @@ AP_GPS_PX4::read(void) state.velocity.x = _gps_pos.vel_n_m_s; state.velocity.y = _gps_pos.vel_e_m_s; state.velocity.z = _gps_pos.vel_d_m_s; + state.speed_accuracy = _gps_pos.s_variance_m_s; + state.have_speed_accuracy = true; } else { state.have_vertical_velocity = false;