Drone position Hold non GPS using Aruco detection

Hello guys, i’m new in px4 with mavlink and now i doing an drone application.
The application is using drone with only downwarded camera and aruco marker

  • the first stage is takeoff drone as normal and move it to above the tag
  • then turn of GPS, and using aruco pose estimation to estimate the drone position
  • The purpose is Hold the drone above the tag when no gps available.

I have some research and i found that if i keep send VISION_ESTIMATE_POSITION message then can supply an position to the drone so it can keep at position.
however, its not work as expected. Here is my code position_estimator/send_mavsdk.py at 499c4fea860f4bed8a4ce58fbfb479a087fc69b1 · long-senpai/position_estimator · GitHub

i uploaded the flight log here:

i can see the VISION_ESTIMATE_POSITION message come to drone but it just driff. So i wonder only send VISION_ESTIMATE_POSITION is enough?
i saw in some Ros source that also use mavros to control the drone based aruco tag. and they not only publish '/mavros/vision_pose/pose" and also /mavros/setpoint_position/local. so i’m not sure how to do it correctly.

anyone with experiment in this fields please give me some advice!!

testing enviroment Gazebo simulator

  • PX4 latest version:
  • parameter:
    EKF2_EV_CTRL = 1 (For xy control)
    EKF2_HGT_MODE = Baro

can anyone help me please !!

It seem that you are in the correct way, but you are sending just where the px4 is located. Additionaly the mode should be on offboard and you should send desired setpoint with set_position_target_local_ned_send.

Thank you for the reply, so that mean to HOLD the drone above the tag i’m not only send the estimate drone position but need to control the drone to some setpoint?

because i thought similar when GPS is available, the drone has the stable position local NED. and now when no gps i just need to supply a correct NED position for drone to hold

In HOLD mode, the Px4 takes the initial position (longitude, latitude) as the desired set point when GPS is available, so it receives the current position and compares it with the desired position in each loop to keep the error close to zero. Now you are replacing the GPS with vision-based relative positioning, so you need to determine the position as well as the set point, which is the desired position relative to the marker.