Sending VISION_POSITION_ESTIMATE to drone but not work correctly

Hello guys,

Currently, I’m working on drone position holding when GPS is not available.

  • My system uses a drone with a monocular camera mounted facing downward at -90°. The firmware is the latest PX4 version.
  • The goal is to use object tracking results from the camera to estimate the drone’s position. When GPS is lost, the drone should hold its current position using vision-based estimation.
  • I’ve set the following PX4 parameters:
    • EKF2_EV_CTRL = 1 (fuse horizontal position from vision)
    • EKF2_HGT_REF = Barometer
  • I’m not using yaw estimation from vision because I only want the drone to move forward, left, or right — no yaw control.
  • I’m currently testing this in Gazebo.

Here’s what I observed:

  • I take off the drone and disable GPS using the command failure gps off. GPS gets disabled, and I can see VISION_POSITION_ESTIMATE messages arriving in QGroundControl.
  • Initially, the drone holds position for a few seconds, but then it starts drifting far from the target object.
  • At that point, I noticed the drone’s pitch and roll angles are quite large — meaning the drone is tilting a lot.
    I’m not sure what i missed, please help me

@JulianOes If you could help us with this, that would be greatly appreciated. Thank you

I’m afraid I’m flooded with paid work already, and I haven’t done this myself in a long time.

No worries. Thanks for getting back to us. Perhaps there is someone else we could nudge to assist?

@dakejahl or @Jaeyoung-Lim might have some input.

In general, devs will monitor the forum and respond where they have something to say, so it’s not a “push your issue onto someone’s plate” sort of system.

If you need urgent help, you’d have to consider paid consulting.

There’s not enough information to offer any suggestions. A log file is the bare minimum for something like this. You should use plot juggler to analyze the uorb data. Look at vehicle_visual_odometry. You can read through the docs to figure out how to do log analysis. I don’t mean to be harsh but it’s hard to offer help when it’s clear the OP hasn’t spent much time to investigate the problem themselves. But even that doesn’t guarantee someone will help you, I wish Dronecode would pay developers to write code and review the issues… everything in this project is charity… :disappointed_face: Anyway, my guess is that the Odometry data isn’t being filled out correctly – missing fields or incorrect coordinate transform. Would need to look at the log.

1 Like

Hi @dakejahl
Sorry for the late reply, i’ve working on some improve the estimator controller so can’t reply to you soon. i’m quite new on debug this so still lacking many experiment on debug.
btw, here is an flight log example.

i would be good if you can help me pls.


PlotJuggler showing that the visual_dom position is jumping quite crazy as i dont know what i’m might be wrong.
For estimator algorithms, the software capture the tracked box init position and the translation and rotation matrix of it over frames, drone NED init position is input. the output is the relative position of (camera center) to the tracked box.

So we just feed the relative position X,Y to the VISION_POSITION_ESTIMATE to the drone and let the onboard IMU to solve the RPY inside flight controller.

Please upload the log to logs.px4.io and share the link here.