If I wanted to include other data members into the data flash logs, how do i go about adding them into the logs with the rest of the logged data?
Can I just hijack a variable in the log.ino file and have it grab a different value to log?
For example, if i don’t care about logging the yaw error, could I just pick a different variable to assign to error_yaw in this function?:
// Write an attitude packet. Total length : 10 bytes
static void Log_Write_Attitude(void)
{
struct log_Attitude pkt = {
LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG),
time_ms : hal.scheduler->millis(),
roll : (int16_t)ahrs.roll_sensor,
pitch : (int16_t)ahrs.pitch_sensor,
yaw : (uint16_t)ahrs.yaw_sensor,
error_rp : (uint16_t)(ahrs.get_error_rp() * 100),
error_yaw : (uint16_t)(ahrs.get_error_yaw() * 100)
};
DataFlash.WriteBlock(&pkt, sizeof(pkt));
}