From 09547c40cbe55d97e4a03d9288d54238be703af7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Nov 2014 13:33:16 +1100 Subject: [PATCH] DataFlash: added staticmode to EKF4 message useful when diagnosing logs --- libraries/DataFlash/DataFlash.h | 3 ++- libraries/DataFlash/LogFile.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index 4916dd8891..a9f9a7cace 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -338,6 +338,7 @@ struct PACKED log_EKF4 { int8_t offsetNorth; int8_t offsetEast; uint8_t faults; + uint8_t staticmode; }; struct PACKED log_Cmd { @@ -474,7 +475,7 @@ struct PACKED log_Ubx3 { { LOG_EKF3_MSG, sizeof(log_EKF3), \ "EKF3","Icccccchhhc","TimeMS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IVT" }, \ { LOG_EKF4_MSG, sizeof(log_EKF4), \ - "EKF4","IcccccccbbB","TimeMS,SV,SP,SH,SMX,SMY,SMZ,SVT,OFN,EFE,FS" }, \ + "EKF4","IcccccccbbBB","TimeMS,SV,SP,SH,SMX,SMY,SMZ,SVT,OFN,EFE,FS,StaticMode" }, \ { LOG_TERRAIN_MSG, sizeof(log_TERRAIN), \ "TERR","IBLLHffHH","TimeMS,Status,Lat,Lng,Spacing,TerrH,CHeight,Pending,Loaded" }, \ { LOG_UBX1_MSG, sizeof(log_Ubx1), \ diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index 89de3e4a6e..fedcc7d264 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -987,7 +987,8 @@ void DataFlash_Class::Log_Write_EKF(AP_AHRS_NavEKF &ahrs) sqrtvarVT : (int16_t)(100*tasVar), offsetNorth : (int8_t)(offset.x), offsetEast : (int8_t)(offset.y), - faults : (uint8_t)(faultStatus) + faults : (uint8_t)(faultStatus), + staticmode : (uint8_t)(ahrs.get_NavEKF().getStaticMode()) }; WriteBlock(&pkt4, sizeof(pkt4)); }