Offboard mode local_position/pose initial values

Hi,
I am trying to perform some basic flight using offboard mode. Similar to the very basic example I send the points to the mavros/setpoint_position/local topic. When I send the position [0,0,1] I expect the drone to fly to one meter altitude. In simulation this works great but on the real drone the /mavros/local_position/pose initializes with values far from [0,0,0]. I assume it is receiving its postion from the ekf and if gps is enabled these are values like [-15, 5, -1], which is very bad as the drone would fly 15 meter in a very wrong direction to reach the setpoint [0,0,1]. If I disable GPS by setting EKF2_AID_MASK to 0, I get values reasonable close to zero.

But disabling GPS is not always what I want as I have to reboot the drone, so is there a way to init the local_position always to [0,0,0] or do I have to fetch the current local pose and calculate the relative offset myself and set the offboard points accordingly?

Thank you!

1 Like

If you can read the GPS/EKF output and then add your vector to it.

Yes I could do that but it requires to constantly read the position topic and build a feedback control system to prevent “jumps” in the local position coming from the gps measurements. I thought I could use the local_position topic to send relative setpoints.

I don’t think you can disable GPS and then give position reference. Did you try that and it works? I think you will need a positioning feedback to do so.

Hi, were you able to solve this?