@ -932,7 +932,7 @@ void DataFlash_Class::Log_Write_IMU(const AP_InertialSensor &ins)
@@ -932,7 +932,7 @@ void DataFlash_Class::Log_Write_IMU(const AP_InertialSensor &ins)
}
// Write an accel/gyro delta time data packet
void DataFlash_Class : : Log_Write_IMUDT ( const AP_InertialSensor & ins , uint64_t time_us )
void DataFlash_Class : : Log_Write_IMUDT ( const AP_InertialSensor & ins , uint64_t time_us , uint8_t imu_mask )
{
float delta_t = ins . get_delta_time ( ) ;
float delta_vel_t = ins . get_delta_velocity_dt ( 0 ) ;
@ -954,7 +954,9 @@ void DataFlash_Class::Log_Write_IMUDT(const AP_InertialSensor &ins, uint64_t tim
@@ -954,7 +954,9 @@ void DataFlash_Class::Log_Write_IMUDT(const AP_InertialSensor &ins, uint64_t tim
delta_vel_y : delta_velocity . y ,
delta_vel_z : delta_velocity . z
} ;
WriteBlock ( & pkt , sizeof ( pkt ) ) ;
if ( imu_mask & 1 ) {
WriteBlock ( & pkt , sizeof ( pkt ) ) ;
}
if ( ( ins . get_gyro_count ( ) < 2 & & ins . get_accel_count ( ) < 2 ) | | ! ins . use_gyro ( 1 ) ) {
return ;
}
@ -980,7 +982,9 @@ void DataFlash_Class::Log_Write_IMUDT(const AP_InertialSensor &ins, uint64_t tim
@@ -980,7 +982,9 @@ void DataFlash_Class::Log_Write_IMUDT(const AP_InertialSensor &ins, uint64_t tim
delta_vel_y : delta_velocity . y ,
delta_vel_z : delta_velocity . z
} ;
WriteBlock ( & pkt2 , sizeof ( pkt2 ) ) ;
if ( imu_mask & 2 ) {
WriteBlock ( & pkt2 , sizeof ( pkt2 ) ) ;
}
if ( ( ins . get_gyro_count ( ) < 3 & & ins . get_accel_count ( ) < 3 ) | | ! ins . use_gyro ( 2 ) ) {
return ;
@ -1006,7 +1010,9 @@ void DataFlash_Class::Log_Write_IMUDT(const AP_InertialSensor &ins, uint64_t tim
@@ -1006,7 +1010,9 @@ void DataFlash_Class::Log_Write_IMUDT(const AP_InertialSensor &ins, uint64_t tim
delta_vel_y : delta_velocity . y ,
delta_vel_z : delta_velocity . z
} ;
WriteBlock ( & pkt3 , sizeof ( pkt3 ) ) ;
if ( imu_mask & 4 ) {
WriteBlock ( & pkt3 , sizeof ( pkt3 ) ) ;
}
}
void DataFlash_Class : : Log_Write_Vibration ( const AP_InertialSensor & ins )