Copter: move read_AHRS() before run_rate_controllers()

this ensures the rate controllers use the latest data
This commit is contained in:
Andrew Tridgell 2013-01-11 16:32:40 +11:00
parent 4a9e3a068a
commit 49a5b664cc

View File

@ -1034,13 +1034,6 @@ void loop()
// Main loop - 100hz
static void fast_loop()
{
// run low level rate controllers that only require IMU data
run_rate_controllers();
// write out the servo PWM values
// ------------------------------
set_servos_4();
// IMU DCM Algorithm
// --------------------
read_AHRS();
@ -1049,6 +1042,13 @@ static void fast_loop()
// --------------------------------------------------------------------
update_trig();
// run low level rate controllers that only require IMU data
run_rate_controllers();
// write out the servo PWM values
// ------------------------------
set_servos_4();
// Inertial Nav
// --------------------
read_inertia();