Commit Graph

68 Commits

Author SHA1 Message Date
Daniel Agar
f9794e99f8 move hover_thrust_estimator to new module (mc_hover_thrust_estimator)
* MC_HTE: unitialize with hover_thrust parameter
* MC_HTE: constrain hover thrust setter between 0.1 and 0.9
* MC_HTE: integrate with land detector and velocity controller
* MCHoverThrustEstimator: Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.

* MC_HTE: use altitude agl threshold to start the estimator
local_position.z is relative to the origin of the EKF while dist_bottom
is above ground

Co-authored-by: bresch <brescianimathieu@gmail.com>
2020-03-11 21:20:54 -04:00
Daniel Agar
380cae18d1 clang-tidy: partially fix modernize-use-equals-default 2019-10-27 19:19:07 -04:00
Mark Sauder
e9c9fb8239 fix multicopter land detector: do not update parameters every cycle (#13212)
And add updateParams() call in LandDetector::_update_params().
2019-10-18 09:25:41 +02:00
Mark Sauder
0cbb693a8d Add return INFINITY; to the LandDetector class _get_max_altitude() method declaration (#12343) 2019-10-15 08:19:53 +02:00
mcsauder
fb12ddb69a Cherry pick the directory and voted_sensors_update.h from PR #9756.
Consolidate _update_params() methods for improved inheritance from the LandDetector base class.
Move common uORB::Subscriptions to the base class for inheritance.
Deprecate redundant override methods.
2019-10-14 21:25:57 +02:00
mcsauder
f9a5c91f8c Deprecate vehicle_attitude_sub from MulticopterLandDetector as it is no longer utilized. 2019-10-09 09:48:17 +02:00
Mark Sauder
60e5e0821a land_detector: Add and max_altitude and timestamp validity checks to MulticopterLandDetector class. (#12681)
* Rename local camelCase vars to snake_case and control_mode -> vehicle_control_mode to match typdef with established class convention.
2019-09-02 00:30:46 -04:00
mcsauder
9e055e9b21 Implement ModuleParams inheritance in the VtolLandDetector class. Requires PR #12356. 2019-08-14 11:58:14 -04:00
Mark Sauder
056c8000a1 MultiCopterLandDetector: Implement ModuleParams inheritance (#12356) 2019-08-09 07:57:42 +02:00
Daniel Agar
a917f22b65 sensors: create vehicle_acceleration module (#12597) 2019-08-07 05:05:48 -04:00
Daniel Agar
2ad12d7977 sensors: create vehicle_angular_velocity module (#12596)
* split out filtered sensor_gyro aggregation from mc_att_control and move to wq:rate_ctrl
2019-08-06 12:55:25 -04:00
Mark Sauder
1466d11acc land_detector: cleanup actuator_armed and battery_status naming
* Rename _arming -> _actuator_armed
 * Rename _battery -> _battery_status in the MulticopterLandDetector class.
2019-06-27 12:02:14 -04:00
mcsauder
6e9f706b12 Standardize remaining class member variable naming convention in the MulticopterLandDetector class. 2019-06-26 14:06:56 -04:00
mcsauder
6b6d82447e Standardize class member variable naming convention in the MulticopterLandDetector class. 2019-06-26 14:06:56 -04:00
bresch
d19614a94f MC Lnd detector - Remove double include 2019-06-05 16:53:08 +02:00
Daniel Agar
53aa4130a8 land_detector move orb subscriptions to uORB::Subscription 2019-06-04 18:10:21 -04:00
Roman
6c1399b328 multicopter land detector: make threshold for _has_low_thrust
configurable

Signed-off-by: Roman <bapstroman@gmail.com>
2019-04-03 08:49:46 +02:00
Elia Tarasov
04a486f13d enable ground effect zone when land detector is updated 2019-03-21 10:07:12 +01:00
Matthias Grob
aa36fa2dfd replace camel case by snake case.
Co-Authored-By: EliaTarasov <elias.tarasov@gmail.com>
2019-03-21 10:07:12 +01:00
Roman
ecc8a696d0 added ground effect reporting to land detector
Signed-off-by: Roman <bapstroman@gmail.com>
2019-03-21 10:07:12 +01:00
Beat Küng
a9def8be93 MC land detector: remove LNDMC_THR_RANGE param
- no airframe changes the default
- it does not make much sense to be able to configure the 0.1 threshold
  but the 0.3 threshold for ground contact detection cannot be configured.
2018-10-09 12:09:07 +02:00
Daniel Agar
ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Beat Küng
123f11fcdd land_detector: use user-defined literals for time constants 2018-04-14 13:45:57 +02:00
Daniel Agar
354584acfc MulticopterLandDetector initialize all class members 2018-03-05 15:46:24 -05:00
Beat Küng
a0afc370d0 land detector: move arming state into base class & set param when disarming
Before that, different modules (ekf2, commander & land detector) changed
params upon different events:
- ekf2 & commander set params after disarm
- land detector set params on land detected
If the 2 events were several 100ms appart, it led to 2 param saves, and
the latter param set could have been blocked by an ongoing save. And if
the land detector was blocked, it could lead to mag timeouts.

This patch makes all modules use the same event, thus only a single param
save will happen.

If we want to have guarantees to never block, we should introduce a
param_try_set() API method.
2017-12-07 11:55:51 +00:00
Julian Oes
7229ec2a37 Move throttle check from land detector to posctrl
This commit is an attempt to fix a race condition happening on takeoff
between the land detector and the multicopter position controller.

Previously, an auto-takeoff leads to the following events:

1. A takeoff setpoint is given.
2. The thrust setpoint spikes because we don't enter smooth takeoff yet.
3. The land detector detects a takeoff because of the high thrust.
4. The position controller sees the landed state transition and
   initiates the smooth takeoff. Thrust goes back down.
5. Depending on control gains the takeoff is successful or fails
   if the smoothing takes too long which causes thrust to be too low, so
   the land detector detects land again.

The two obvious problems with this are:
- The intermittent spike.
- The failed takeoff because of the smoothing leads to a delay..

With this change, the logic for a takeoff detection is moved from the
land detector to the position controller.

The events are now:

1. A takeoff setpoint is given.
2. The position controller detects the takeoff setpoint and initiates
   the smooth takeoff.
3. As thrust ramps up, the land detector detects the take off.

In the same way, we now detect the intent to takeoff in manual,
altitude, control, position control in the position controller instead
of in the land detector.
2017-10-09 19:05:15 +02:00
Daniel Agar
b4755297ec delete control_state and cleanup vehicle_attitude (#7882) 2017-09-21 16:24:53 -04:00
Daniel Agar
90819b2852 land detector move hysteresis constants into FW and MC 2017-08-31 22:49:44 -04:00
Dennis Mannhart
f50052f290 landdetector mc: widen acceptance threshold after landing instead of arming 2017-08-15 10:30:29 +02:00
sanderux
6ee24a0c80 Move land detector changes to vtol 2017-08-09 08:12:54 +02:00
sanderux
49d2e8a3ff Land detector fix for VTOL in FW mode 2017-08-09 08:12:54 +02:00
Dennis Mannhart
bc46f13d90 landdetector: use control mode, add minimum speed to detect hit-ground 2017-08-01 19:31:34 +02:00
Dennis Mannhart
549d8da6ee landdetector: hit ground logic 2017-08-01 19:31:34 +02:00
Dennis Mannhart
f8e9f380d0 landdetector: add additional landdetection state 2017-08-01 19:31:34 +02:00
Matthias Grob
caecdbd60b land_detector: treat altitude mode like position mode with vertical checks but without horizontal checks
because in altitude mode we have a baro available and can therefore check vertical movement
we can not check horizontal movement but I consider the checks for landing still pretty safe
unlike in manual mode we are not allowed to disarm before land detection in altitude mode
2017-04-20 13:20:01 +02:00
Matthias Grob
2b90224075 land_detector: added parameter for manual position stick takeoff threshold 2017-02-28 13:05:33 +01:00
Dennis Mannhart
a1982e0392 land_detector: battery level status to adjust maximum altitude possible 2017-02-27 22:54:19 +01:00
Matthias Grob
e6031a97fa land_detector: added a parameter for the manual land detection stick throshold
because it is definitely something that needs to be allowed to tune or disable for different application scenarios
2017-02-23 13:18:49 +01:00
Matthias Grob
9963cf532d land_detector: refactored helper method names 2017-02-13 11:34:10 +01:00
Matthias Grob
480dd0922b Land detector: revision of the 2 stage landing mechanism
Ground detect: pilot want down or we are on minimum thrust by auto land but no vertical movement
-> Controller should relax x,y corrections and even ramp down desired thrust
Landed: All other conditions are eventually met
2017-01-28 16:23:04 +01:00
Lorenz Meier
9ef97b78c8 Land detector: Turn throttle range parameter into proper user-configurable parameter 2017-01-28 16:23:04 +01:00
Lorenz Meier
9448b8cb52 Land detector: Fix hover throttle detection 2017-01-28 16:23:04 +01:00
Dennis Mannhart
2f164602b4 LandDetector:
- constructor initalization fix
- set trigger time for ground contact hysteresis
- updated ground_contact_state logic
MulticopterLandDetector:
- added hysteresis for ground_contact
VtolLandDetector:
- get_ground_contact_state function that return the one form MultcopterLandDetector
FixedWingLandDetector:
- get_ground_contact_state with a return false: requires implementation
2017-01-28 16:23:04 +01:00
Lorenz Meier
9e9e0e23ad Land detector: Detect ground contact separately
This allows to detect ground contact before concluding the system is landed. This allows to disable some parts of the horizontal control system and only control the vertical position to avoid tipping over.
;
2017-01-28 16:23:04 +01:00
Matthias Grob
f95fb0f20f land detector: commented takeoff throttle values for each mode 2017-01-16 08:25:26 -08:00
Matthias Grob
7ab2958757 land_detector: added takeoff throttle threshold
if we control manually and are still landed, we want to stay idle until the pilot rises the throttle
2017-01-16 08:25:26 -08:00
Matthias Grob
03d7b65299 land detector: refactoring ff to freefall 2016-12-26 15:36:43 +01:00
Matthias Grob
808dedf441 land detector: small refactor while studying 2016-12-26 15:36:43 +01:00
Julian Oes
50cac88e5b land_detector: big refactor, share update function
This is a big refactor and general cleanup of the land detector. The
main functional change is to share the hysteresis lib across all land
detectors.
2016-07-30 12:26:56 +02:00
Julian Oes
740bfc0b32 MulticopterLandDetector: use hysteresis lib
The hysteresis was not properly implemented in the land detector and is
therefore replaced by the library call, both for the freefall detector
and the land detector.
2016-07-30 12:26:56 +02:00