POSITION Mode not holding position with VIO data

I’m using a ZED 2i to send VIO data to the Pixhawk Cube Orange, I am successfully sending it in the ENU frame to /mavros/vision_pose/pose_cov, with manual static covariances set, which the Cube is receiving and I can see this in QGroundcontrol when I go to the MAVLink console and type “listener vehicle_visual_odometry”, which I can confirm, MAVROS transforms this into the NED frame, from bench tests of moving the drone in each direction etc to confirm movements.

My problem is that the drone is not holding position when in flight in POSITION flight mode, does anyone have any suggestions as to why this might be?

odometry might be received, but then need to check if it’s actually used by the ECL.
next things to check would be, in uorb topics:

estimator_aid_src_ev_pos
listener estimator_status_flags (cs_ev_pos flag)
estimator_event_flags (reset_pos_to_vision)
estimator_innovation_test_ratios
estimator_innovations

might also check if
CONFIG_EKF2_EXTERNAL_VISION
is defined in the board config

Hi, thank you for your reply. I have checked each of these in the MAVLink console using listener before each. I tested before publishing the ROS code and then after.

As expected, when ROS is not initiated, listener vehicle_visual_odometry, estimator_aid_src_ev_pos are “never published”, within the rest, cs_ev_pos_flag is false, reset_pos_to_vision is false, and the rest have the positioning from ev set to 0.

When the ROS nodes are run, to publish the VIO data to the Pixhawk, listener vehicle_visual_odometry, estimator_aid_src_ev_pos publish data accordingly, cs_ev_pos_flag and reset_pos_to_vision are set to true, and the two remaining estimator_innovation/s have ev data present, see attached the link to the results copied for full set of data received: EV results.

For the CONFIG_EKF2_EXTERNAL_VISION do you mean the parameter set for the fimrware PX4 in QGC? Being EKF2_EV_CTRL? Which I have set to 9, so just for Horizontal position and yaw ticked.

If all this data is being published as it should be,what could be the issue? I’m not sure at this point how to troubleshoot it as I have been working endlessly as it and gotten nowhere.

Can you provide a log file? Would be the easiest way to quickly have a look and ask further questions.

Yes, I just did a quick bench test, here is a log file of going into POSITION mode using the VIO data: bench_test_log_file.

Is this enough or do you need one from in flight?

Here is another flight log from in flight a while back: in-flight log.

Also to note, I am not sending any vision velocity data, just the positioning and only using the horizontal position data on the PX4, setting the EKF2_EV_CTRL to use only horizontal positon and yaw, not vertical position and 3D velocity.

Have you had a chance to look at this yet?

Sorry, I forgot about it.
Can you create a log with SDLOG_PROFILE set to 3 (+EKF2) or 19 (+High rate). Then you also log topics which are really useful to debug potential estimation issues.

No worries. Yes, I have done, I performed a flight test inside with no props, just me lifting it, and holding POSITION and then performing an OFFBOARD flight mode mission I have coded to fly a square path (with yaws included) and then in POSITION mode again at the end, I held for sufficient time to hopefully give enough data.

I performed with the SDLOG_PROFILE set to 3 and 19:

Hopefully you can find the issue in these, thank you for your help.