Autonomous flight using ekf2 and vision_pose

Hi all,

Im currently working on performing an autonomous flight based on fiducial markers. I have an algorithm that gives me pose estimates of the drone. Im using a pixhawk 6c and raspi 4. I am publishing these estimates to the topic “/mavros/vision_pose/pose” without covariance matrix and i publish with a frequency of 10hz. However, im not sure if ekf2 is using the information as the docs says “The messages should be streamed at between 30Hz (if containing covariances) and 50 Hz. If the message rate is too low, EKF2 will not fuse the external vision messages.”. Should i publish it at a higher rate? i feel like the computational load will increase much.

The main issue i noticed is that the drone starts to oscilate hence i want to look at what information ekf2 uses.

The parameters i changed are: EK2_HGT_REF=3, EKF2_GPS_CTRL=0, EKF2_IMU_CTRL=0, EKF2_MAG_TYPE=5(none).

To simulate this behaviour, i simulated the code in gazebo. I tried to change these parameters above with “rosrun mavros mavparam set … …” but when i look at the log file these parameters have not been adjusted. I am publishing at 10hz, but still the log file also says that the estimator used is ekf2. Moreover, how do i know which sensors it used in the simulation? How am i sure it is not using gps.

Here the log file of simulation. The aim is just to go up and down.

Does anyone have experience with ekf2, publishing to “/mavros/vision_pose/pose” and what parameters to use?