mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
Rover: Change Attitude logging to use DataFlash library method.
This commit is contained in:
parent
8da62107fa
commit
7254de4e23
@ -298,26 +298,13 @@ static void Log_Write_Nav_Tuning()
|
||||
DataFlash.WriteBlock(&pkt, sizeof(pkt));
|
||||
}
|
||||
|
||||
struct PACKED log_Attitude {
|
||||
LOG_PACKET_HEADER;
|
||||
uint32_t time_ms;
|
||||
int16_t roll;
|
||||
int16_t pitch;
|
||||
uint16_t yaw;
|
||||
};
|
||||
|
||||
|
||||
// Write an attitude packet
|
||||
static void Log_Write_Attitude()
|
||||
{
|
||||
struct log_Attitude pkt = {
|
||||
LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG),
|
||||
time_ms : millis(),
|
||||
roll : (int16_t)ahrs.roll_sensor,
|
||||
pitch : (int16_t)ahrs.pitch_sensor,
|
||||
yaw : (uint16_t)ahrs.yaw_sensor
|
||||
};
|
||||
DataFlash.WriteBlock(&pkt, sizeof(pkt));
|
||||
Vector3f targets(0,0,0); // Rover does not have attitude targets, use place-holder for commonality with Dataflash Log_Write_Attitude message
|
||||
|
||||
DataFlash.Log_Write_Attitude(ahrs, targets);
|
||||
|
||||
#if AP_AHRS_NAVEKF_AVAILABLE
|
||||
#if OPTFLOW == ENABLED
|
||||
DataFlash.Log_Write_EKF(ahrs,optflow.enabled());
|
||||
@ -483,8 +470,6 @@ static void Log_Write_Baro(void)
|
||||
|
||||
static const struct LogStructure log_structure[] PROGMEM = {
|
||||
LOG_COMMON_STRUCTURES,
|
||||
{ LOG_ATTITUDE_MSG, sizeof(log_Attitude),
|
||||
"ATT", "IccC", "TimeMS,Roll,Pitch,Yaw" },
|
||||
{ LOG_PERFORMANCE_MSG, sizeof(log_Performance),
|
||||
"PM", "IIHIhhhBH", "TimeMS,LTime,MLC,gDt,GDx,GDy,GDz,I2CErr,INSErr" },
|
||||
{ LOG_STARTUP_MSG, sizeof(log_Startup),
|
||||
|
@ -67,7 +67,6 @@ enum mode {
|
||||
#define LOG_PERFORMANCE_MSG 0x03
|
||||
#define LOG_STARTUP_MSG 0x06
|
||||
#define LOG_SONAR_MSG 0x07
|
||||
#define LOG_ATTITUDE_MSG 0x08
|
||||
#define LOG_MODE_MSG 0x09
|
||||
#define LOG_COMPASS_MSG 0x0A
|
||||
#define LOG_COMPASS2_MSG 0x0C
|
||||
|
Loading…
Reference in New Issue
Block a user