Reset origin to make local_position 0


I was wondering if it is possible to reset the origin to match the current local_position of the robot.

e.g. If you turn on the robot and it drifts away, can you reset the new position to be the origin so that the local_position is all 0.


Hi @cpcp,

The short answer:

The longer answer:
This issue is probably the best starting point for that rabbit-hole, but basically, you can set/override the current location multiple times if you have want to update it, but you can only set the actual global origin once (per vehicle reboot).

From previous discussions with other ArduPilot developers it’s very unlikely that will be changed, which has to do with what it actually represents and is used for within the autopilot firmware (which is the origin of the vehicle’s EKF position estimator).

The EKF origin is technically unrelated to where the vehicle is at any particular moment (e.g. it’s not about where you start a dive), and is instead the central reference that all positions are based around (at every moment), so for optimal accuracy it should be set to where you expect the average position of your dive to be, or to the centre of the area you expect to need the most accuracy during a dive. Of course, if that’s not known in advance, somewhere near the starting position is often a reasonable guess that’s at least better than nothing.

1 Like