FlightTaskAuto: landing position updates for precision landing (#20951)

- precision landing works incorrectly, target position is not updated during the descent above target
 - _prepareLandSetpoints needs to update _land_position continuously

Co-authored-by: kapacheuski <kapacheuski@gmail.com>
This commit is contained in:
alessandro 2023-02-07 18:07:26 +01:00 committed by GitHub
parent deb6053d56
commit 3e149ee6c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,12 +229,14 @@ void FlightTaskAuto::_prepareLandSetpoints()
}
if (_type_previous != WaypointType::land) {
// initialize xy-position and yaw to waypoint such that home is reached exactly without user input
_land_position = Vector3f(_target(0), _target(1), NAN);
// initialize yaw
_land_heading = _yaw_setpoint;
_stick_acceleration_xy.resetPosition(Vector2f(_target(0), _target(1)));
}
// Update xy-position in case of landing position changes (etc. precision landing)
_land_position = Vector3f(_target(0), _target(1), NAN);
// User input assisted landing
if (_param_mpc_land_rc_help.get() && _sticks.checkAndUpdateStickInputs()) {
// Stick full up -1 -> stop, stick full down 1 -> double the speed