Commit Graph

268 Commits

Author SHA1 Message Date
Lorenz Meier
c94e54bbab Commander: Handle HITL state in all places consistently 2017-08-02 15:12:25 +02:00
Daniel Agar
d5a890041b commander RTL failsafe should be sticky 2017-07-30 01:51:27 +02:00
Lorenz Meier
61b0a81bf9 HITL startup: Further simplification of boot logic in commander 2017-07-29 23:06:50 +02:00
Lorenz Meier
5838556742 HITL handling: Enforce the use of the activation parameter for HITL configuration 2017-07-29 23:06:50 +02:00
Daniel Agar
625dc67f84 commander offboard loss rc act unreachable
- coverity fix 145492
2017-06-04 02:37:09 +08:00
Daniel Agar
64ed96d81a clang-tidy readability-simplify-boolean-expr 2017-06-02 19:35:18 -04:00
Simone Guscetti
6201fb5641 commander: arming with critical battery is not allowed 2017-05-29 18:40:57 +08:00
lovettchris
47faaa5d78 Add loiter option to COM_OBL_RC_ACT (#7170) 2017-05-08 14:17:29 -04:00
Paul Riseborough
00a42abc69 commander: Add parameter to control postal fallback after loss of navigation accuracy
Also remove else if branch that cannot be accessed.
2017-05-08 09:21:38 +02:00
priseborough
8ea0b2d3c5 commander: rework posvel validity checks
Move into functions.
Reset probation time and recalculate checks if a mode change is demanded to give the operator ability to regain control as soon as possible after nav performance is regained. (+11 squashed commits)
Squashed commits:
[a4bb800] commander: enable pilot to quickly recover from loss of position accuracy
[19e16a0] commander: rework postal probation time
[f96284e] commander: rework bad pos and vel test probation time
[00d5f0c] commander: Allow EKF preflight checks to pass with moving vehicle

Separates the 'is using GPS' and the GPS quality checks.
Uses a reasonable subset of the GPS quality checks which allows checks to pass if the vehicle is moving.
[4cdfb5c] commander: remove unused variable
[349385a] commander: add EKF GPS quality checks to pre-arm checking

Only perform check if GPs checking is activated by parameter setting.
Display fault messages that makes it clear if EKF quality checks are failing or the EKF is not using GPS for another reason. We do not want to confuse this with GPS lock.
[340ae29] commander: make position invalid fail-safe more sticky

Require check to pass for 7 seconds before exiting failsafe. This is required because if GPs is failing innovation tests for a prolonged period, the EKF will periodically reset to the GPS and report good accuracy at the time of reset.
Adding this delay gives time for an underlying error condition (eg bad IMU or compass) to be re-detected.
[b04ac95] commander: Increase RAM allocation to eliminate low stack warnings
[9dca12f] commander: add missing position invalid fail-safe responses
[69f264d] commander: Update position invalid fail-safe responses

Replace separate logic for each case with a generic function
Add velocity checks.
[8e8cef1] commander: rework position validity checks

Consolidate existing checks for global and local position validity and add checking of velocity accuracy.
Enable checks to be bypassed using the CBRK_VELPOSERR parameter.
2017-05-03 08:37:14 +02:00
Daniel Agar
1913b970d7 main state auto mission don't require valid mission 2017-04-20 11:18:32 -04:00
Daniel Agar
c1d9972244 commander add parameter COM_ARM_MIS_REQ
- arm without mission on by default
2017-04-20 11:18:32 -04:00
Lorenz Meier
08cf97c687 Commander: indicate failsafe reasons more clearly 2017-04-09 12:40:34 +02:00
Beat Küng
32995a5bc1 state_machine_helper: remove unneeded code to disable sensor publication
In HIL mode we do not start the sensors anymore, so this is not needed.

Also it did not work (I did not try to find the reason, just noticed the
sensors kept publishing in HIL mode)
2017-03-10 09:00:24 +01:00
Julian Oes
24819ce7b1 commander: no datalink failsafe on ground
On SITL startup we got a datalink lost failsafe message whenever home
was initialized. The reason that in standalone SITL, there is usually no
datalink connected. However, on ground, we shouldn't really failsafe,
therefore it makes sense not to enter the state in the first place.
2017-03-08 05:33:32 +08:00
Daniel Agar
e81e6a8296 fw_att_control add rattitude mode 2017-02-18 08:03:19 +01:00
Daniel Agar
c14c9c20eb commander tests allow FW ACRO 2017-02-18 08:03:19 +01:00
Andreas Antener
a5f3f65c2b Switch assignment: added manual and stabilized switch for a default stabilized switch scheme, let FW go into Acro 2017-02-18 08:03:19 +01:00
aivian
7a77e27a79 fixed wing offboard attitude setpoint fix (#6112) 2017-02-15 23:51:50 -05:00
ChristophTobler
0263ab8cd2 enable takeoff in gps denied areas and minor requested changes 2017-02-13 21:11:25 +01:00
ChristophTobler
1f7fdb2386 allow local position for takeoff (e.g. flow) 2017-02-13 21:11:25 +01:00
Daniel Agar
feda5caac2 commander state machine helper fix style and remove unused 2017-02-12 10:29:59 +01:00
Daniel Agar
d0b188f585 commander FW don't allow FOLLOW or OFFBOARD 2017-02-12 10:29:59 +01:00
Lorenz Meier
a92931fe84 Commander: Switch system off if in undervoltage condition and disarmed.
This is necessary to not have systems deep-discharge the battery while sitting idle. While at it we also deny arming in low battery conditions to ensure people who just landed with a low battery do not take off again and fail to get a successful RTL.
2017-02-04 21:06:21 +01:00
Daniel Agar
b33d49c77d state_machine_helper use static_assert 2017-02-01 22:15:50 -05:00
Daniel Agar
e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
David Sidrane
1c3ebadb85 Removed unused defines AVIONICS_ERROR_VOLTAGE and AVIONICS_WARN_VOLTAGE 2017-01-21 11:45:36 +01:00
Anton Matosov
3a17c07b1e Implement RC and DL failsafe action handling for multirotors
Move RC and DL failsafe actions handling from navigator to commander (credits to @AndreasAntener)
Separate manual kill switch handling via manual_lockdown to prevent override and release of software lockdown by RC switch

Other changes:
Add failsafe tune
Fix LED blinking for Pixracer
Return back support for rc inputs in simulator but now it is configurable via cmake
2016-12-27 00:38:13 +01:00
Julian Oes
e3aecc0762 state_machine_helper: remove unused const var 2016-12-15 10:17:03 +01:00
Julian Oes
0b02a6e0f7 state_machine_helper: warn about offboard lost, not RC
When offboard input stops and we're in OFFBOARD mode, we should complain
about offboard being lost and not RC because we probably never even had RC.
2016-12-15 10:17:03 +01:00
Andreas Antener
e9737d6f7a Preflight checks: made sure pre-flight check results are always reported first thing on the console and always on new or re-established telemetry links AFTER waiting for the hotplug timeout
(leads to double publishing on the console when a new link is established, but this is the best compromise between fixing and completely restructuring)
2016-12-02 22:56:48 +01:00
Andreas Antener
f772fc2d02 Airspeed: preflight check for bad offset, fixed calls to preflight checks (vtol & airspeed) 2016-12-02 22:56:48 +01:00
James Goppert
dbd94907c4 Only send failsafe info messages on state change. 2016-10-13 01:57:00 -04:00
James Goppert
43b665ae01 Fix gps circuit breaker logic in state machine. 2016-10-12 23:07:26 -05:00
Beat Küng
ce0d31b7d9 mavlink log: ensure all critical & emergency msgs are also logged to console & ulog
Critical messages that the user sees should also go to the log file, so
that the exact error (with time) can later be analyzed from the log file.
2016-09-30 13:50:51 +02:00
Sander Smeets
c4eabbd083 VTOL transition switch parameter checking (#5545)
* VTOL transition switch parameter checking

* Code style
2016-09-26 10:18:23 +02:00
lovettchris
11f8da5fc6 AUTO_LOITER respect disabled RC link loss param (#5499) 2016-09-23 18:14:32 -04:00
sander
bc7178c538 Allow mission with active DL and DLL failsafe off 2016-08-05 10:19:06 +02:00
sander
e8a87538b8 Code style 2016-08-05 10:19:06 +02:00
sander
95e80cc29b Only RTL when mission finishes mid air on DL Lost 2016-08-05 10:19:06 +02:00
Daniel Agar
99aa5f49fc FW ALTCTL requires altitude 2016-07-29 13:48:21 +02:00
Daniel Agar
6aa935fed6 FW don't allow ACRO or RATTITUDE 2016-07-29 13:48:21 +02:00
Beat Küng
7b52eced66 commander: write timestamp of commander_state topic on init and state change 2016-07-19 09:21:35 +02:00
Julian Oes
87e964ec10 commander: POSCTL with localpos for MC
Fixedwings need a global position estimate for POSCTL.
2016-07-15 14:43:36 +01:00
Julian Oes
f430c39f5b commander: allow POSCTL with local position
We want to allow flying POSCTL with optical flow only without GPS.
2016-07-15 14:43:36 +01:00
Julian Oes
314ee6b7e0 commander: remove some if confusion
This is a try to simplify the if statements a bit. Also, a check of
new_arming_state which was impossible, is removed.
2016-07-13 10:10:45 +02:00
Julian Oes
91127d51c0 commander: stay in failsafe even when landed
If the failsafe state is ended when landed, we would switch back to
POSCTL and therefore take off again, however, all we want is stay on
ground and wait for the auto disarm.
2016-06-21 10:21:34 +02:00
dong.chen
5ad671ed4c Solve the problem When lost rc signal, it will rtl repeated. 2016-06-21 10:21:34 +02:00
Julian Oes
c7ec07be70 commander: properly use new param
The param COM_ARM_WO_GPS is set to 1 by default to allow arming without
GPS. This then sets a bool arm_without_gps which translates to
!GNSS_check in preflightCheck.
2016-06-21 10:21:34 +02:00
Julian Oes
f67e74935e commander: remove leftover printf 2016-06-21 10:21:34 +02:00