DataFlash: Log the ground temperature used for baro calculations

This commit is contained in:
Michael du Breuil 2017-03-23 22:00:22 -07:00 committed by Andrew Tridgell
parent c37209a8d5
commit 16433cbf7a
2 changed files with 6 additions and 1 deletions

View File

@ -829,6 +829,7 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro, uint64_t time_us)
}
float climbrate = baro.get_climb_rate();
float drift_offset = baro.get_baro_drift_offset();
float ground_temp = baro.get_ground_temperature();
struct log_BARO pkt = {
LOG_PACKET_HEADER_INIT(LOG_BARO_MSG),
time_us : time_us,
@ -838,6 +839,7 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro, uint64_t time_us)
climbrate : climbrate,
sample_time_ms: baro.get_last_update(0),
drift_offset : drift_offset,
ground_temp : ground_temp,
};
WriteBlock(&pkt, sizeof(pkt));
@ -851,6 +853,7 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro, uint64_t time_us)
climbrate : climbrate,
sample_time_ms: baro.get_last_update(1),
drift_offset : drift_offset,
ground_temp : ground_temp,
};
WriteBlock(&pkt2, sizeof(pkt2));
}
@ -865,6 +868,7 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro, uint64_t time_us)
climbrate : climbrate,
sample_time_ms: baro.get_last_update(2),
drift_offset : drift_offset,
ground_temp : ground_temp,
};
WriteBlock(&pkt3, sizeof(pkt3));
}

View File

@ -191,6 +191,7 @@ struct PACKED log_BARO {
float climbrate;
uint32_t sample_time_ms;
float drift_offset;
float ground_temp;
};
struct PACKED log_AHRS {
@ -805,7 +806,7 @@ Format characters in the format string for binary log messages
{ LOG_RSSI_MSG, sizeof(log_RSSI), \
"RSSI", "Qf", "TimeUS,RXRSSI" }, \
{ LOG_BARO_MSG, sizeof(log_BARO), \
"BARO", "QffcfIf", "TimeUS,Alt,Press,Temp,CRt,SMS,Offset" }, \
"BARO", "QffcfIff", "TimeUS,Alt,Press,Temp,CRt,SMS,Offset,GndTemp" }, \
{ LOG_POWR_MSG, sizeof(log_POWR), \
"POWR","QffH","TimeUS,Vcc,VServo,Flags" }, \
{ LOG_CMD_MSG, sizeof(log_Cmd), \