diff --git a/libraries/AP_DAL/AP_DAL_Compass.cpp b/libraries/AP_DAL/AP_DAL_Compass.cpp index 3dfa6a0b6f..13bc1c24b5 100644 --- a/libraries/AP_DAL/AP_DAL_Compass.cpp +++ b/libraries/AP_DAL/AP_DAL_Compass.cpp @@ -17,6 +17,7 @@ void AP_DAL_Compass::start_frame() const auto &compass = AP::compass(); const log_RMGH old = _RMGH; + _RMGH.available = compass.available(); _RMGH.count = compass.get_count(); _RMGH.auto_declination_enabled = compass.auto_declination_enabled(); _RMGH.declination = compass.get_declination(); diff --git a/libraries/AP_DAL/AP_DAL_Compass.h b/libraries/AP_DAL/AP_DAL_Compass.h index b7ee867c95..39bfb66445 100644 --- a/libraries/AP_DAL/AP_DAL_Compass.h +++ b/libraries/AP_DAL/AP_DAL_Compass.h @@ -38,6 +38,10 @@ public: return _RMGH.declination; } + bool available() const { + return _RMGH.available; + } + // return the number of enabled sensors uint8_t get_num_enabled(void) const { return _RMGH.num_enabled; } diff --git a/libraries/AP_DAL/LogStructure.h b/libraries/AP_DAL/LogStructure.h index 488e058b26..65b199af63 100644 --- a/libraries/AP_DAL/LogStructure.h +++ b/libraries/AP_DAL/LogStructure.h @@ -240,6 +240,7 @@ struct log_RASI { // @Description: Replay Data Magnetometer Header struct log_RMGH { float declination; + bool available; uint8_t count; bool auto_declination_enabled; uint8_t num_enabled; @@ -402,7 +403,7 @@ struct log_RBOH { { LOG_RGPJ_MSG, RLOG_SIZE(RGPJ), \ "RGPJ", "IffffffIiiiffHB", "TS,VX,VY,VZ,SA,Y,YA,YT,Lat,Lon,Alt,HA,VA,HD,I", "--------------#", "---------------" }, \ { LOG_RMGH_MSG, RLOG_SIZE(RMGH), \ - "RMGH", "BBfBBBB", "Dec,NumInst,AutoDec,NumEna,LOE,C,FUsable", "-------", "-------" }, \ + "RMGH", "BBBfBBBB", "Dec,Avail,NumInst,AutoDec,NumEna,LOE,C,FUsable", "--------", "--------" }, \ { LOG_RMGI_MSG, RLOG_SIZE(RMGI), \ "RMGI", "IffffffBBBB", "LU,OX,OY,OZ,FX,FY,FZ,UFY,H,HSF,I", "----------#", "-----------" }, \ { LOG_RBCH_MSG, RLOG_SIZE(RBCH), \