Position Horizontal Variance error with Vicon system

Hi all,

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 [2]:

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 [3]. 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)

It’s hard to say but two guesses are:

  • the position estimates are not arriving reliably. They must be fed into the EKF at at least 4hz. Sometimes due to telemetry issues or CPU performance issues on the companion computer they are not delivered reliably.
  • the heading is incorrect. So either it’s not being provided in the mocap message or perhaps it doesn’t agree with the movements of the vehicle

If possible it would be good to include an onboard log.

We also have a gitter discussion area here: https://gitter.im/ArduPilot/VisionProjects

Thank you for the response rmackay9,

After experimenting with the points you mentioned I think I figured out a solution.

Indeed the heading seems to be the issue. What I did is offset every new orientation quaternion by a value equal to the initial orientation quaternion of the Vicon system (taken when the IMU was initializing on the ground). This did the trick.

Thank you and regards,