2222 Commits

Author SHA1 Message Date
Matthias Grob
3d87982bba Commander: reintroduce last stick position 2021-03-04 10:41:21 +01:00
Julian Kent
cdadfabccc Bring back RC throttle override with a parameter to disable it 2021-03-04 10:41:21 +01:00
Matthias Grob
c2151cb4fa Commander: remove unused arm mode command residue 2021-02-26 07:38:02 -05:00
Beat Küng
46b9acac6d mag_calibration: fix typo 2021-02-24 17:27:31 +01:00
Lorenz Meier
1b8a3079e6 Update commander_params.c
Better documentation boolean settings, removed duplicate boolean.
2021-02-22 11:17:16 -05:00
Lorenz Meier
90f5d7338c Commander: Relax pre-arm check for EKF
The previous testing ratios could lead to extremely tight pre-arm acceptance.
2021-02-22 11:17:16 -05:00
Lorenz Meier
f12d368a64 Commander: Document arming check params 2021-02-22 11:17:16 -05:00
Lorenz Meier
87f98f096f Commander: Respect position circuit breaker
This ensures that commander respects the position check circuit breaker and allows arming without position.
2021-02-22 11:17:16 -05:00
Julian Oes
e6b1775bb6 vmount/navigator/mavlink: gimbal v2 changes
This is a collection of commits all having to do with changes in the
Mavlink gimbal v2 protocol as described in:
https://mavlink.io/en/services/gimbal_v2.html
2021-02-17 13:54:34 -05:00
Daniel Agar
5abf29d93c
commander: auto TAKEOFF to LOITER/MISSION minor fix to avoid failsafe confusion
- base on nav_state rather than main_state
2021-02-16 13:02:14 -05:00
Daniel Agar
0618f048f2
commander: use control mode flags and cleanup arm_disarm
- keep `vehicle_control_mode` last state in commander and use appropriate flags in place of various main_state and nav_state checks
 - consolidate scattered arming requirements in `arm_disarm()`
   - there were a number of different requirements from arming via RC vs Mavlink that don't make any sense
        - if geofence enabled require valid home before arming
        - throttle requirements for manual modes
 - remove unnecessary mavlink feedback that differs between arming interfaces (mavlink vs RC)
      - let the preflight/prearm checks respond directly in most cases 

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2021-02-15 12:03:21 -05:00
Matthias Grob
a002a07ed5 sdcardCheck: minor refactor
I was late for the review.
2021-02-12 00:17:43 -05:00
bresch
9d3ff12a94 commander: reword nav failure message 2021-02-11 16:20:30 -05:00
bresch
5726e8e0a3 commander: do not fail nav check on GPS position glitch
In case of a diverge of the nav filter, both position and velocity test
ratios are large. If only one of them is too large, the nav filter is
most likely not diverging but is encountering a GNSS position reset and
it is still safe to fly in position mode.
2021-02-11 16:20:30 -05:00
bresch
b1b032d6e1 commander: rework nav failure check
Allows to recover from a failed test with a stricter test
2021-02-11 16:20:30 -05:00
David Sidrane
ef444da689 BUGFIX Hardfault Commander Calibration 2021-02-09 15:20:50 +01:00
Claudio Micheli
d4bea8323f PreFlightCheck: Detect missing FMU SD card
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-02-05 20:14:48 +01:00
Daniel Agar
6633ff5089 commander: vehicle_status_flags add attitude and angular velocity 2021-02-05 20:11:13 +01:00
Matthias Grob
f13c3a7d44 state_machine_helper: stop mission on RC loss
This allows to still fly missions completely without RC
but reacts if RC is lost during the mission because
the safety pilot expects to be able to take over.
2021-02-04 10:54:52 +01:00
Matthias Grob
f87dbe57c2 state_machine_helper: don't finish mission if all links are lost except for when no reaction is configured 2021-02-04 10:54:52 +01:00
Matthias Grob
cd51cf2996 state_machine_helper: handle zero failsafe_timestamp 2021-02-04 10:54:52 +01:00
Matthias Grob
b44b770972 commander: RC loss delay renaming/reordering 2021-02-04 10:54:52 +01:00
Matthias Grob
e2e5fc85f8 state_machine_helper: fix infinite delay with intermittent failsafes 2021-02-04 10:54:52 +01:00
Matthias Grob
1736be41cf state_machine_helper: only apply delay on manual piloted rc loss cases 2021-02-04 10:54:52 +01:00
Matthias Grob
e65cc6bd6f state_machine_helper: do failsafe delay for all modes 2021-02-04 10:54:52 +01:00
Matthias Grob
26d74bf57d Commander: enable failsafe delay for position and mission mode
Instead of directly doing the link loss reaction which by default is RTL a delay
can be configured such that the drone first switches to hold and waits
for the link to be regained.
2021-02-04 10:54:52 +01:00
Antonio Sanjurjo Cortés
fa45eacea3 Fix and unify the maximum allowed PDOP references 2021-02-04 10:20:22 +01:00
Claudio Micheli
c2154df2f6 ekf2checks: split GPS checks from AHRS checks - minor cleanup
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-02-01 09:02:19 +01:00
Chungkyeong Lee
834ac38841 fix condition in ekf2Check 2021-02-01 08:55:41 +01:00
Julian Kent
e96e028327 Refactor LM mag calibration routines 2021-01-28 09:14:08 +01:00
Julian Kent
a9fc104387 Add inline to avoid double definition errors 2021-01-28 09:14:08 +01:00
bresch
c79bd033c0 mag test: add ellipsoid test 2021-01-28 09:14:08 +01:00
bresch
1da2cd5b4d mag test: add magnetometer calibration unit tests 2021-01-28 09:14:08 +01:00
bresch
a8a8819060 mag cal: move sphere and ellipsoid regression algirithms 2021-01-28 09:14:08 +01:00
Daniel Agar
d1dfa26903 consume all available queued vehicle_commands 2021-01-26 12:00:18 -05:00
bresch
d7812f83f1 mag_cal: fix race condition causing invalid mag calibration
In some cases, the fitness of the optimizer does not shrink at each
iteration, causing the "decreasing fitness check" to fail. This stops
the optimization and returns with sub-optimal, or unrealistic results.
2021-01-20 10:50:35 -05:00
Mathieu Bresciani
8d8b58efc3
Add logging of mag calibration data (mag_worker_data)
Co-authored-by: Julian Kent <julian@auterion.com>
2021-01-20 09:44:45 -05:00
Julian Kent
af8d178ae5 Fix spurious RTL triggers
Two sources:
1. global to local conversion was sometimes giving issues, so do everything in global
2. on startup the RTL didn't check if the home position was valid before processing it
2021-01-18 16:26:53 +01:00
Julian Kent
7482413005 Add Range-based RTL 2021-01-18 16:26:53 +01:00
Silvan Fuhrer
cee4016665 Preflight checks: Airspeed checks update
-check for valid airspeed_validated (declared valid plus updated less than 1s ago)
-added param (COM_ARM_ARSP_EN) to enable/disable check for max airspeed for arming set max
airspeed limit to half of stall airspeed

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-16 10:26:55 -05:00
Daniel Agar
48f125f150 estimated IMU bias preflight checks
- commander preflightcheck use estimator_sensor_bias message instead of EKF state index magic number
 - ekf2 publish estimated bias limits in estimator_sensor_bias
 - preflightcheck only error if bias estimate exceeds half of configured limit (delete COM_ARM_EKF_AB and COM_ARM_EKF_GB parameters)
2021-01-12 09:09:42 +01:00
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
bazooka joe
9b9163813d avoid re-initiate RTL or land in battery emergency
if the mode is already running
2021-01-10 21:19:52 +01:00
Matthias Grob
3cc8e7a210 commander_params: Make multicopter only COM_RC_OVERRIDE more visible 2021-01-10 21:12:09 +01:00
Daniel Agar
88f8da27ef
save learned mag bias per sensor (Multi-EKF support)
- handle saving the mag bias per sensor (across all estimator instances using that mag) in sensors/vehicle_magnetometer
 - this is now saving back to the actual mag calibration CAL_MAGn_OFF{X,Y,Z}
 - ekf2 reset mag mag bias on any magnetometer or calibration change
 - use Kalman filter scheme to update stored mag bias parameters using all available bias estimates for that sensor

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2021-01-07 09:54:13 -05:00
Matthias Grob
f435bea57c state_machine_helper: orbit failsafe just with data link loss
RC is like the comment says not required.
2021-01-07 13:31:05 +01:00
Jaeyoung-Lim
d2b0f63e1f Handle offboard mode with acceleration setpoints
The case when acceleration setpoints were being passed in offboard mode was triggering control_climbrate_mode. This prevented the vehicle from taking off, since it made the vehicle skip the rampup phase of the takeoff
This commit fixes this by handling the case properly
2021-01-06 20:38:18 +01:00
Lorenz Meier
4237c8be25 Commander: Do not acknowledge binding
This is now done in the respective modules directly and based on implementation and execution state.
2020-12-31 13:22:52 +01:00
Daniel Agar
49d4cc7d5b commander: CMD_NAV_LAND/CMD_NAV_PRECLAND reply RESULT_ACCEPTED unless transition is denied 2020-12-30 12:05:41 +01:00
Daniel Agar
91f5f26618 commander: main_state_transition call trivial style fixes 2020-12-30 00:26:14 +01:00