HomePosition: Home position only changes on ground after minimum horizontal and vertical displacement
Solved Problem
When the vehicle is not yet armed and on the ground, the home position is allowed to change when it is detected that the vehicle position has changed. When the EKF estimator is initialized the home position is changed if the local position change is higher than the estimated deviations in eph and epv. Those can be pretty small number ( <15cm in my tests) although the altitude might change more. This leads to a lot of new home position changes before taking off. However those changes are unnecessary, as the home position is set again when taking off. Changing the home position that often can negatively influence other modules depending on the home position (as the e.g. the mission validity).
Solution
- Add a minimum horizontal distance of 1m needed horizontally and 1.5m vertically before changing the home position.
- Refactor ...
Changelog Entry
For release notes:
Feature: Home position only changes on ground after minimum horizontal and vertical displacement.
Test coverage
- simulation tests: using make px4_sitl gazebo-classic_standard_vtol and observing the home_position uOrb topic
The other thing you could do is only update it here if not moving.
The other thing you could do is only update it here if not moving.
And how would you do that? Alo check on the velocity? Could still lead to the same issue i guess.
Also here for completeness a plot from the home position changes before this PR, you can see, that the home position does change several times although the vehicle did not move and according the the eph and epv position converged already.w
The other thing you could do is only update it here if not moving.
And how would you do that? Alo check on the velocity? Could still lead to the same issue i guess.
https://github.com/PX4/PX4-Autopilot/blob/664a0f2cda1a5379c554fecef811ac127d9e0320/msg/VehicleLandDetected.msg#L19