Closed mdouglas90 closed 8 years ago
@ndousse do you have a documentation for the ekf equations you used (or better how you derived them)?
In the mean time, I've written the code that sends the ahrs quaternion to the drone from the motion capture system. It currently works by writing over the ahrs quaternion every time the message is received. This also allows us to completely bypass the strange magnetic field that is in the dronedome. The code still calls the ekf update function so there is still some decay but it will jump back when it receives the next mocap message. If this decay is still not wanted and the update rate is not important, you can comment out the body of Ahrs_ekf::update()
and the drone will just update the ahrs quaternion at 10 Hz.
The branch locations for this code are:
dronedome_ahrs
dronedome_ahrs
I opened #266 as the mocap does not really fix this issue.
Here is the two files (especially the first one) that I used to derive the equations for the EKF: Development_of_a_Planar_Low_Cost_Inertial_Measurement_Unit_for_UAVs_andMAVs(Fux2008).pdf
The attitude estimation seems to decay to an incorrect value once it changes. For example, if you tilt the drone so that it has a roll of 90 degrees, the roll will change to around 90 degrees and then decay to around 40-50 degrees over a few seconds. If you set it to 45 degrees, it will decay to around 20-30 degrees.
This does not appear to be the result of the weird magnetic field inside this building as it still occurs outside. In addition, the decay still occurs when the magnetometer update is commented out in ahrs_ekf.cpp.