DataFlash: added desired rate to PID logging

This commit is contained in:
Andrew Tridgell 2015-05-24 07:50:32 +10:00
parent 4512e408f7
commit b45ab52015
2 changed files with 6 additions and 4 deletions

View File

@ -439,6 +439,7 @@ struct PACKED log_Attitude {
struct PACKED log_PID {
LOG_PACKET_HEADER;
uint64_t time_us;
float desired;
float P;
float I;
float D;
@ -635,13 +636,13 @@ Format characters in the format string for binary log messages
{ LOG_COMPASS_MSG, sizeof(log_Compass), \
"MAG", "QhhhhhhhhhB", "TimeUS,MagX,MagY,MagZ,OfsX,OfsY,OfsZ,MOfsX,MOfsY,MOfsZ,Health" }, \
{ LOG_MODE_MSG, sizeof(log_Mode), \
"MODE", "QMB", "TimeUS,Mode,ModeNum" }
"MODE", "QMB", "TimeUS,Mode,ModeNum" } \
{ LOG_PIDR_MSG, sizeof(log_PID), \
"PIDR", "Qfffff", "TimeUS,P,I,D,FF,AFF" }, \
"PIDR", "Qffffff", "TimeUS,Des,P,I,D,FF,AFF" }, \
{ LOG_PIDP_MSG, sizeof(log_PID), \
"PIDP", "Qfffff", "TimeUS,P,I,D,FF,AFF" }, \
"PIDP", "Qffffff", "TimeUS,Des,P,I,D,FF,AFF" }, \
{ LOG_PIDY_MSG, sizeof(log_PID), \
"PIDY", "Qfffff", "TimeUS,P,I,D,FF,AFF" }
"PIDY", "Qffffff", "TimeUS,Des,P,I,D,FF,AFF" }
// messages for more advanced boards
#define LOG_EXTRA_STRUCTURES \

View File

@ -1334,6 +1334,7 @@ void DataFlash_Class::Log_Write_PID(uint8_t msg_type, const PID_Info &info)
struct log_PID pkt = {
LOG_PACKET_HEADER_INIT(msg_type),
time_ms : hal.scheduler->millis(),
desired : info.desired,
P : info.P,
I : info.I,
D : info.D,