PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

HomePosition: Home position only changes on ground after minimum horizontal and vertical displacement

Open KonradRudin opened this issue 1 year ago • 3 comments

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

KonradRudin avatar Apr 17 '24 12:04 KonradRudin

The other thing you could do is only update it here if not moving.

dagar avatar Apr 19 '24 01:04 dagar

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.

KonradRudin avatar Apr 19 '24 14:04 KonradRudin

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 Screenshot from 2024-04-19 16-31-05

KonradRudin avatar Apr 19 '24 14:04 KonradRudin

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

dagar avatar May 21 '24 12:05 dagar