I am using a Vicon indoor positioning system as a positioning feedback for my quad, equipped with Pixhawk 1 (3DR) and ArduCopter 4.0 (parameters attached). In general I am following the indoor positioning setup discussed in https://discuss.ardupilot.org/t/position-hold-with-vision-position-estimate-and-att-pos-mocap-for-indoor-localization/29626/40 over mavros middleware. The pose message from /vrpn_client_node/quad/pose is fed to topic /mavros/vision_pose/pose at 10Hz and I get the “GPS glitch” and the “EKF using external nav data” messages.
Finally, I set the SET_GPS_GLOBAL_ORIGIN and SET_HOME_POSITION using https://github.com/thien94/vision_to_mavros/blob/master/scripts/set_origin.py.
The drone green trace is depicted in Mission Planner and the EKF status is the one in image :
Now the problem is that after 2-5 seconds the position variance is zeroed in the EKF and the pos_horiz_abs parameter switches to off as in image . From that point I am unable to switch POS_HOLD mode:
The problem occurs randomly in 8 out of 10 position hold attempts, whereas in 2 out of 10 I can switch to POS_HOLD mode and fly normally. I experimented with the EXTNAV_DELAY parameter but I don’t seem to get a definite solution for this. Any suggestions would be appreciated.
Thank you in advance,
params.param (17.2 KB)