I am building my first Booz quad and studying it's code. One thing that puzzles me is the implementation of the Complementary Euler Attitude Filter.
On lines 159 and 160 in sw/airborne/booz/ahrs/booz2_filter_attitude_cmpl_euler.c we estimate the body attitude angles based on the accelerometer measurements:
Quadrotor flight dynamics dictate that x and y acceleration in
the body coordinate system (imu) are always zero. Non-zero values are
only produced by sensor noise, external wind force, IMU not in the center of gravity etc. Additionally, IMU measurements can directly be used for attitude estimation only when the system is not accelerating (in hover or constant speed condition). If we ignore the extreme cases this condition can only be achieved when phi and theta are 0.
Based on this I can not see the value of direct attitude estimation based only on the accelerometer data.
I would really appreciate if somebody can explain the purpose of this part of the code or show me if I have missed something.