2012-11-07 06:03:30 -04:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2012-08-16 21:50:02 -03:00
|
|
|
|
2012-11-07 06:03:30 -04:00
|
|
|
// read_inertia - read inertia in from accelerometers
|
|
|
|
static void read_inertia()
|
2012-06-26 02:17:04 -03:00
|
|
|
{
|
2012-11-28 10:31:02 -04:00
|
|
|
#if INERTIAL_NAV_XY == ENABLED || INERTIAL_NAV_Z == ENABLED
|
2012-11-07 06:03:30 -04:00
|
|
|
static uint8_t log_counter_inav = 0;
|
|
|
|
|
|
|
|
// inertial altitude estimates
|
|
|
|
inertial_nav.update(G_Dt);
|
|
|
|
|
|
|
|
if( motors.armed() && g.log_bitmask & MASK_LOG_INAV ) {
|
|
|
|
log_counter_inav++;
|
|
|
|
if( log_counter_inav >= 10 ) {
|
|
|
|
log_counter_inav = 0;
|
2012-12-28 03:21:13 -04:00
|
|
|
Log_Write_INAV();
|
2012-11-07 06:03:30 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|