Indoor auto navigation

Hi, unfortunately, I didn’t find the error inside the Beacon Libraries. However, I downgrade from EKF3 to EKF2. With the last one there is no shift problem from the origin.
Maybe in terms of position is not as good as EKF3, but at least there isn’t the major problem we are facing. I will search on the code for some differences. The main idea (for what i know) is that EKF3 refresh many times its origin (or something similar), feature not present in the EKF2. I suggest you to give it a try. Let me know

Hi, Chris!

Thanks for the suggestion. Right now I have this topic on hold because I’m still stuck with this problem. But of course I will try to use EK2 instead of EK3.

I will let you know the results when I try it.

Thx

1 Like

I’ve given a first look to EKF2 and EKF3 code. I’ll write here what I’ve noticed. I think the problem could be at the end of NavEKF3_core::FuseRngBcnStatic(); I think that the fusion update must be deleted, otherwise there is the shift during the Alignment part. In fact in EKF2 there is not. I’ll try to build it with this change later. Just to let you know
Have a good day

1 Like

The problem wasn’t the one I thought. However, until now I’ve used EKF2.
The other day, the drone flew well, and accomplished a mission with the anchors, outside. Indoor it has still problem with the magnetometer, which leads to compass variance and unstable flight. Today a tried again an outdoor flight, with beacon instead of gps (with same parameters of the first flight), but I encountered GPS glitch (which I do not think creates to much problems) and the UAV wasn’t neither able to mantain loiter position autonomously. In particular, these are the messages:

Mission: 1 TakeOff
Mission: 2 Loit Time
EKF variance

and here I noticed the drone moved to much (2-3 meters away) and thus:

EKF Failsafe: changed to LAND Mode

Do you have any suggestions? Moreover, I just connected the magnetometer in a plug and play way, and calibrated it with the setup menu option from mission planner. Is there something more I can do to improve indoor behaviour? such as Tune some parameters of the filter?
Thank you very much

have you tried compassmot?
https://ardupilot.org/copter/docs/common-compass-setup-advanced.html

Not yet, but i’ll try it later
Thank you

Hi, an update. I managed to solve the problem. As i think we noticed time ago, the EKF3 does the moveEKFOrign function to move the filter origin and compensate for Earth distortions. This wasn’t realized in EKF2. Until now, i just commented this funciton (line 712 in AP_NavEKF3_core.cpp). Tried some flights, seems working good. if i have more time in the future, i’ll try to optimize the bug without commenting this function but exploiting the common_valid_origin bool instead of bcnOriginEstInit, but for the moment i’m ok with it.

Moreover, just for knowledge, I manage to improve a bit the indoor navigation decreasing the WP speed, and decreasing the Process noise covariances of the mag_body and mag_earth fields. At the same time I increasd the Mag measurement variance. This should give more reliability to the prediciton instead of the measurement. Could be interest to implement a dynamical adaptation to the Q and R matrices, but i am not sure i will manage to do it.

1 Like