I am using Marvelmind as an “indoor” gps.
The issue we are seeing is that the loitering mode causes the drone to oscillate around 2 feet.
We have tried many combinations on the advanced params, but nothing seems to fix it.
I have also changed code inside https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp, but is is very difficult to understand, I would like to see if someone can point me to the correct file so I can do the changes on my end.
This is what I changed:
I changed values from “0.05f, 5.0f” to “0.03f, 0.5f”
// calculate additional error in GPS velocity caused by manoeuvring R_OBS = sq(constrain_float(frontend->_gpsHorizVelNoise, 0.05f, 5.0f)) + sq(frontend->gpsNEVelVarAccScale * accNavMag); R_OBS = sq(constrain_float(frontend->_gpsVertVelNoise, 0.05f, 5.0f)) + sq(frontend->gpsDVelVarAccScale * accNavMag);
and changed “0.1f, 10.0f” to “0.1f, 0.5f”:
R_OBS = sq(constrain_float(frontend->_gpsHorizPosNoise, 0.1f, 10.0f)) + sq(posErr);
Decreasing it further makes the copter fly worse.
The goal is to have this drone fly autonomously and Marvelmind has an accuracy of ±2cm. So, something in the firmware is causing the drone to oscillate way too much.
Thanks! I am happy to answer any more questions you might have.