Commit Graph

30514 Commits

Author SHA1 Message Date
Dennis Mannhart ab1ae1fb4e mc_pos_control_main: trigger failsafe if no setpoint along D-direction is valid 2018-07-20 09:26:18 +02:00
ChristophTobler 9362f844f4 position control: fix failsafe thrust
invert direction to point upwards and increase to 70% of throttle range between min and hover
2018-07-20 09:26:18 +02:00
ChristophTobler 7cc85885a4 position control: set _skip_controller before calling _interfaceMapping()
Without this failsafe will be overwritten
2018-07-20 09:26:18 +02:00
ChristophTobler 80867343ab mc_pos_control: trigger failsafe if no pos, vel or thrust pair is valid 2018-07-20 09:26:18 +02:00
Dennis Mannhart 260284571d mc_pos_control: move failsafe logic into method 2018-07-20 09:26:18 +02:00
Dennis Mannhart ac2c49218d mc_pos_control: remove mavlink_log_info 2018-07-20 09:26:18 +02:00
Dennis Mannhart f11a65a74f mc_pos_control: fix overwrite for state velocity 2018-07-20 09:26:18 +02:00
Dennis Mannhart f2d559a4c2 mc_pos_control: minor refactor 2018-07-20 09:26:18 +02:00
Matthias Grob cc0bc05156 mc_att_control: remove useless parameter MC_YAW_FF
It scales the yawspeed setpoint arbitrarily by default with 0.5.
This makes no sense because when you give a setpoint of 1rad/s then
you expect the setpoint to get executed. If you want manual yawspeed
response to be less agressive on the stick use the scaling parameter
for the stick MPC_MAN_Y_MAX.
2018-07-20 09:26:18 +02:00
Dennis Mannhart b5731e0ccd FlightTaskOffboard: only start task if control mode flags are met 2018-07-20 09:26:18 +02:00
Dennis Mannhart bf4ac7a9d6 mc_pos_control: for terrain following use range sensor climbrate for velocity estimate 2018-07-20 09:26:18 +02:00
Dennis Mannhart eb7139bc56 FlightTaskManualAltitude: respect maximum altitude if there is a valid distance sensor 2018-07-20 09:26:18 +02:00
Dennis Mannhart c907e7a9dc FlighttaskManualAlititude: replace SENS_FLOW_MINRNG with hagl_min 2018-07-20 09:26:18 +02:00
Dennis Mannhart 4af9d79986 FlighttaskManualPosition: check if estimator velocity maximum is finite
before applying limits
2018-07-20 09:26:18 +02:00
MaEtUgR efed766919 FlightTasks: small rebase naming and typo fixes 2018-07-20 09:26:18 +02:00
Dennis Mannhart e51e1bbe74 mc_pos_control: replace legacy refactor
Until now we replaced legacy position controller functionality inside
the flight task architecture to split up the huge position control
module into the different tasks and have a modular setup with a clear
setpoint interface. This commit removes all the legacy code and hard
switches to using the flight task architecture for multicopter.

This is done because maintaining and testing everything in parallel is
not sustainable. The architecture is by now tested to cover all basic
legacy functionality and missing corner cases can be fixed a lot easier
with the new architecture.
2018-07-20 09:26:18 +02:00
Dennis Mannhart 29fb5089bd FlightTasks: construct all tasks in constructor 2018-07-20 09:26:18 +02:00
Dennis Mannhart b1530d1a81 FlightTasks: create struct that contains FlightTask and FlightTaskIndex 2018-07-20 09:26:18 +02:00
Dennis Mannhart 83cc2b0e72 FlightTaskAuto: reset lock position to NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart c12dcb4eed FlightTaskAuto: take care of case when triplet.lat/lon are invalid, which corresponds
to position lock.
2018-07-20 09:26:18 +02:00
Dennis Mannhart 65ad6edaf0 ManualSmoothingXY: remove empty lines 2018-07-20 09:26:18 +02:00
Dennis Mannhart b9d5189fe5 ManualSmoothing: direction change with maximum acceleration 2018-07-20 09:26:18 +02:00
Dennis Mannhart a5e8eb23ad PositionControl: saturate thrust integral 2018-07-20 09:26:18 +02:00
Dennis Mannhart 5ffcb6af01 PositionControl: set vel_dot to 0 if NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart 33d0a4e8ed FlightTaskAuto: replace target with destination for checks 2018-07-20 09:26:18 +02:00
Dennis Mannhart 92e93639d3 FlightTaskAuto: require valid position in 3D 2018-07-20 09:26:18 +02:00
Dennis Mannhart c4c01358b9 FlightTaskManualAltitude: do terrain following when distance sensor active and
below minimum distance to ground.
2018-07-20 09:26:18 +02:00
Dennis Mannhart bd85f5f993 FlightTask: set min_distance_to_ground to NAN as default and when
distance sensor is used to SENS_FLOW_MINRNG
2018-07-20 09:26:18 +02:00
Dennis Mannhart 80775d588b vehicle constraints: minimum distance to ground. currently used when distance sensor
is available
2018-07-20 09:26:18 +02:00
Dennis Mannhart ee7d5c3f38 FlightTaskAuto: remove unused member variable 2018-07-20 09:26:18 +02:00
Dennis Mannhart 7b13803e2c PositionControl: for thrust setpoints only use MPC_MANTHR_MIN for minimum thrust 2018-07-20 09:26:18 +02:00
Dennis Mannhart f30bf215db MulticopterLanddetector: adjust minimum throttle if climb-reate is not enabled 2018-07-20 09:26:18 +02:00
Dennis Mannhart e408870857 FlightTaskManual: remove unused override 2018-07-20 09:26:18 +02:00
Dennis Mannhart be6f3a5b48 FlightTaskOffboard: valid position and velocity is required 2018-07-20 09:26:18 +02:00
Dennis Mannhart bd2de0e585 FlightTaskAuto: valid target is required and valid reference 2018-07-20 09:26:18 +02:00
Dennis Mannhart 4713f47668 FlightTaskManualPosition: valid position/velocity in xy required 2018-07-20 09:26:18 +02:00
Dennis Mannhart 72a213aff7 FlightTaskManualAltitude: valid altitude/climb-rate is required 2018-07-20 09:26:18 +02:00
Dennis Mannhart fc4fa169df FlightTaskManualStabilized: valid yaw is required 2018-07-20 09:26:18 +02:00
Dennis Mannhart 2af253fa9f FlightTaskManual: sticks not to be finite
activation method not needed
2018-07-20 09:26:18 +02:00
Dennis Mannhart 6a7a7d7ff7 FlightTask: check if states are valid. if not valid, set them to NAN 2018-07-20 09:26:18 +02:00
Dennis Mannhart e8620708b3 PositionControl: set states to zero if not valid 2018-07-20 09:26:18 +02:00
Dennis Mannhart b2af9c3f58 FlightTasks: error to char string message 2018-07-20 09:26:18 +02:00
Dennis Mannhart afd02aca92 FlightTask: fail activation if required states are not available 2018-07-20 09:26:18 +02:00
Dennis Mannhart e6f6e2085c ControlMath: remove false comment 2018-07-20 09:26:18 +02:00
Dennis Mannhart 3ea7f8783f FlightTaskManualAltitude: fix comment 2018-07-20 09:26:18 +02:00
Dennis Mannhart 414f38b677 test_controlmath: work around for internal compiler error: in trunc_int_for_mode, at explow.c:55 2018-07-20 09:26:18 +02:00
Dennis Mannhart c56ae130a7 test_controlmath remove static 2018-07-20 09:26:18 +02:00
Dennis Mannhart 9c7c60ddc8 remove mc_pos_control_tests 2018-07-20 09:26:18 +02:00
Dennis Mannhart 89c266e699 by value to reference 2018-07-20 09:26:18 +02:00
Dennis Mannhart a0c3c80b37 FlightTaskManualStabilized make reset counter for heading static 2018-07-20 09:26:18 +02:00