mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 05:23:34 +08:00
UBlox: Only use time and date if flags are valid
This commit is contained in:
@@ -747,6 +747,10 @@ UBX::payload_rx_done(void)
|
||||
_gps_position->cog_rad = (float)_buf.payload_rx_nav_pvt.headMot * M_DEG_TO_RAD_F * 1e-5f;
|
||||
_gps_position->c_variance_rad = (float)_buf.payload_rx_nav_pvt.headAcc * M_DEG_TO_RAD_F * 1e-5f;
|
||||
|
||||
//Check if time and date fix flags are good
|
||||
if( (_buf.payload_rx_nav_pvt.valid & UBX_RX_NAV_PVT_VALID_VALIDDATE)
|
||||
&& (_buf.payload_rx_nav_pvt.valid & UBX_RX_NAV_PVT_VALID_VALIDTIME)
|
||||
&& (_buf.payload_rx_nav_pvt.valid & UBX_RX_NAV_PVT_VALID_FULLYRESOLVED))
|
||||
{
|
||||
/* convert to unix timestamp */
|
||||
struct tm timeinfo;
|
||||
|
||||
Reference in New Issue
Block a user