From 2b43c6aeedbd8bf4c601b8c765975bef585c783c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 27 Feb 2017 10:31:59 +0900 Subject: [PATCH] DataFlash: log range finder orientation --- libraries/DataFlash/LogFile.cpp | 4 +++- libraries/DataFlash/LogStructure.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index 7f12fddcd2..75a3b98ed0 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -754,7 +754,9 @@ void DataFlash_Class::Log_Write_RFND(const RangeFinder &rangefinder) LOG_PACKET_HEADER_INIT((uint8_t)(LOG_RFND_MSG)), time_us : AP_HAL::micros64(), dist1 : rangefinder.distance_cm(0), - dist2 : rangefinder.distance_cm(1) + orient1 : rangefinder.get_orientation(0), + dist2 : rangefinder.distance_cm(1), + orient2 : rangefinder.get_orientation(1) }; WriteBlock(&pkt, sizeof(pkt)); } diff --git a/libraries/DataFlash/LogStructure.h b/libraries/DataFlash/LogStructure.h index 2e0eaf06f2..cc6a936c48 100644 --- a/libraries/DataFlash/LogStructure.h +++ b/libraries/DataFlash/LogStructure.h @@ -512,7 +512,9 @@ struct PACKED log_RFND { LOG_PACKET_HEADER; uint64_t time_us; uint16_t dist1; + uint8_t orient1; uint16_t dist2; + uint8_t orient2; }; /* @@ -823,7 +825,7 @@ Format characters in the format string for binary log messages { LOG_MODE_MSG, sizeof(log_Mode), \ "MODE", "QMBB", "TimeUS,Mode,ModeNum,Rsn" }, \ { LOG_RFND_MSG, sizeof(log_RFND), \ - "RFND", "QCC", "TimeUS,Dist1,Dist2" }, \ + "RFND", "QCBCB", "TimeUS,Dist1,Orient1,Dist2,Orient2" }, \ { LOG_DF_MAV_STATS, sizeof(log_DF_MAV_Stats), \ "DMS", "IIIIIBBBBBBBBBB", "TimeMS,N,Dp,RT,RS,Er,Fa,Fmn,Fmx,Pa,Pmn,Pmx,Sa,Smn,Smx" }