mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
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:
@@ -229,12 +229,14 @@ void FlightTaskAuto::_prepareLandSetpoints()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_type_previous != WaypointType::land) {
|
if (_type_previous != WaypointType::land) {
|
||||||
// initialize xy-position and yaw to waypoint such that home is reached exactly without user input
|
// initialize yaw
|
||||||
_land_position = Vector3f(_target(0), _target(1), NAN);
|
|
||||||
_land_heading = _yaw_setpoint;
|
_land_heading = _yaw_setpoint;
|
||||||
_stick_acceleration_xy.resetPosition(Vector2f(_target(0), _target(1)));
|
_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
|
// User input assisted landing
|
||||||
if (_param_mpc_land_rc_help.get() && _sticks.checkAndUpdateStickInputs()) {
|
if (_param_mpc_land_rc_help.get() && _sticks.checkAndUpdateStickInputs()) {
|
||||||
// Stick full up -1 -> stop, stick full down 1 -> double the speed
|
// Stick full up -1 -> stop, stick full down 1 -> double the speed
|
||||||
|
|||||||
Reference in New Issue
Block a user