Commit Graph

14 Commits

Author SHA1 Message Date
Matthias Grob
9daff24e79 FlightTasks: move stick handling into library 2020-07-14 18:07:09 +02:00
Matthias Grob
17d4fd064f FlightTaskManualAltitude: add an optional stick tilt input filter 2020-05-20 19:30:19 +02:00
Mathieu Bresciani
be2bb4a479 FlightTask: Fix ekf2 reset race condition during task switch (#14692)
* FlightTask: Fix ekf2 reset race condition during task switch

During a loss of GPS data when using GPS as primary height source,
the height is reset to baro and the local position gets invalid at the
same time. This triggers a switch to altitude flight task and a setpoint
reset.
This combination of events had the effect to ignore the height reset,
the large sudden height error could create an abrupt change of altitude
or even a crash.
The ekf2 reset is now done at the beginning of each update call.
2020-04-22 13:18:35 +02:00
Matthias Grob
809b45eac8 FlightTasks: do not adjust tilt limit of the position control
Adjusting the tilt limit can lead to diverging position control
and should only be used by setting a sanity limit for the controller
and not to adjust during the descent phase of a Land or RTL.
Otherwise it leads to flyaways in important failsafe modes when
there's stronger disturbance e.g. wind.
2020-04-21 09:35:52 +02:00
Matthias Grob
b79b095ce7 FlightTasks: adapt to acceleration based control 2020-03-30 09:58:39 +02:00
Morten Fyhn Amundsen
86bf4b2289 FlightTaskManualAltitude: Fix sign error in terrain hold setpoint reset
The modified statements are intended to

1. Set a new Z position setpoint that is equivalent to the current distance
to ground setpoint,

and

2. Set a new distance to ground setpoint that is equivalent to the current Z
position setpoint.

They are only called in terrain hold mode, when activating/deactivating the
holding (typically when coming to a stop and when starting to move again).

The setpoints take the current control error into account, but because the
control error is added, not subtracted, the result is that the new setpoint
is 2 times the control error off from the old setpoint, instead of being
at the same spot as the old setpoint.
2020-02-17 15:18:04 +01:00
bresch
c80593a144 FlightTaskManualAltitude: Rename _min_speed_down -> _max_speed_down as it is the maximum allowed downward speed 2020-02-03 18:05:17 +01:00
bresch
c0d1aa1654 FlightTaskManualAltitude: Follow altitude limit given by the estimator 2020-02-03 18:05:17 +01:00
Matthias Grob
5bd8da2286 PositionControl: temporarily remove direct thrust setpoint support
This commit temporarily breaks direct horizontal thrust setpoint execution
which is used by FlightTaskManualAltitude. This is necessary to allow for
PositionControl cleanup namely calculating the whole velocity PID in one
Vector3f formula.

Having this in a separate commit is useful since it reduces indentation
of a bigger code block.
2020-01-30 07:28:18 -05:00
bresch
4ba672a7ba ManualPosition: Limit horizontal speed during landing 2019-12-11 14:03:16 +01:00
Matthias Grob
4a28c8180b FlightTaskManualAltitude: yawspeed filter remove line with no effect, comments
FlightTaskManualAltitude: declaration order

Addressing @bkueng's review comments.
2019-11-25 11:55:47 +01:00
bresch
cd2b5e7479 FlightTaskManualAltitude: Use dedicated member variable for yawspeed filter state insted of using the previous setpoint 2019-11-25 11:55:47 +01:00
bresch
ffee103ae0 FlightTask: add 1st order lpf on yawrate satepoint for smooth motion 2019-11-25 11:55:47 +01:00
Daniel Agar
7996ee496c lib: name folders consistently 2019-11-13 09:29:21 -05:00