Offboard mode with only vision positioning (No GPS)

I am trying to control the drone via MAVSDK using Offboard mode in a GPS denied environment, but I encountered a problem. For position estimation I am using ArUco markers. I am sending the position information via MAVSDK using VISION_POSITION_ESTIMATE. I also set EKF2_AID_MASK and EKF2_HGT_MODE to Vision. I can see the position estimation that I am sending from MAVSDK in a QGroundControl, but I can not activate the Offboard mode nor any other mode that requires global position as I get information “No GPS Lock”. I tried to set global origin (mentioned here as necessary step to use auto modes Using Vision or Motion Capture Systems for Position Estimation | PX4 User Guide) and use “commander set_ekf_origin” in MAVLink shell from QGC, but it did not help. So at the moment I can see correct position sent to the drone via VISION_POSITION_ESTIMATE, but I can not switch to Offboard mode and get green color on the status LEDs.

Could you suggest any possible steps to try in order to enable Offboard mode without GPS in current situation? Maybe there is a necessary step that I am missing here or some other parameters need to be adjusted in PX4 via QGC.

Hm, so does PX4 reject offboard mode, or MAVSDK? I would assume PX4 rejects it, even though it should allow local control without GPS. What’s the error or statustext message from PX4?

If the check is just on the MAVSDK (either library, or your user code) then we should be able to fix that.

Any sample code that you could share to reproduce this? Maybe I could try to disable GPS in SITL with flow.


@Artur0 Were you able to resolve the problem? I’m attempting an Offboard flight using MAVROS with a similar setup and am encountering the same issue. I cannot get the global coordinate pose even after commander set_ekf_origin and I get 'Switching to mode “Offboard” currently not possible.