2325 Commits

Author SHA1 Message Date
Daniel Agar
d35cf78e4a commander: PX4_ERR if attitude or angular velocity become invalid 2021-10-14 09:17:50 -04:00
Jukka Laitinen
5509235517 commander: Fix implicit NaN conversion from double to float compiler warning
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-10-13 15:01:26 -04:00
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
Silvan Fuhrer
31a599f303 Commander: add comment in COM_RC_OVERRIDE that it's always enabled in Descend mdoe
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-06 11:32:23 -04:00
Silvan Fuhrer
eeb6244c6b Commander: add wind speed warning
Publishes periodically (max every 1 min) a warning if the current wind estimate
is above COM_WIND_WARN.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-06 11:31:13 -04:00
Julian Oes
6b8840a01b commander: fix switch to ALTCTL when RC regained
This fixes the case where we sometimes switch to altitude control
instead of position control when RC is regained.

What happens is that we detect that the pilot wants to take over control
right when RC comes back. This means that we try to go in position
control in main_state_transition, however, we are already in position
control because we come back from the failsafe state. The result of
main_state_transition is then TRANSITION_NOT_CHANGED, and therefore we
"fall back" to altitude control even though being already in position
control would have been fine.

This fix checks the return result of main_state_transition correctly and
only reacts to TRANSITION_CHANGED and TRANSITION_DENIED but ignores
TRANSITION_NOT_CHANGED.
2021-10-06 10:30:08 +02:00
Julian Oes
75b8e11b90 commander: make LAND failsafe stick
By default we would leave the LAND failsafe as soon as a link comes
back. With this change, we switch to the LAND failsafe like a proper
mode change, immediately disabling the failsafe as such.
This is as the same that is done for RTL in fact.

This is not optimal but a workaround for the problem where we switch out
of failsafe right on landing and then discover takeoff again and start
looping through it again and again without ever disarming.
2021-10-05 14:02:22 +02:00
Daniel Agar
6d78054f50
mavlink USB auto start/stop on boards with VBUS
- no longer start sercon or mavlink usb by default
 - on USB connection (VBUS) monitor serial USB at low rate and start Mavlink if there's a HEARTBEAT or nshterm on 3 consecutive carriage returns
 - the mavlink USB instance is automatically stopped and serdis executed if USB is disconnected
 - skipping Mavlink USB (and sercon) saves a considerable amount of memory on older boards
2021-10-03 15:32:54 -04:00
Julian Oes
9290ea974e commander: allow force disarming
Allows to do commander disarm -f to disarm no matter what.
2021-09-27 09:58:03 -04:00
Daniel Agar
089c962d92 px4io: moving mixing to FMU side
Using mixers on the IO side had a remote benefit of being able to
override all control surfaces with a radio remote on a fixed wing.
This ended up not being used that much and since the original design
10 years ago (2011) we have been able to convince ourselves that the
overall system stability is at a level where this marginal benefit,
which is not present on multicopters, is not worth the hazzle.

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-09-25 19:15:05 -04:00
Daniel Agar
7af5a33ff3 commander: don't play failsafe tune if disarmed 2021-09-16 09:17:00 -04:00
Matthias Grob
d1f1e02afb Refactor mode button changes 2021-09-14 09:52:32 +02:00
Claudio Micheli
05d40f40d4 Handle rc toggle mode buttons to initialize flight modes
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-09-14 09:52:32 +02:00
David Jablonski
7d7200cf2f Added yaw to CMD_DO_SET_HOME 2021-09-11 15:14:01 -04:00
Beat Küng
5ac43e7236 commander: switch to events 2021-09-11 14:08:41 -04:00
bresch
aad11ecc65 PreFltCheck: do not force to report ekf2 failures on GCS connection
EKF2 has a grace period of 10 seconds after boot where it doesn't need
to warn the user while the sensors (especially GNSS) are still
converging.
A connection to a GCS shouldn't skip this grace period but
an arming request should.
2021-09-08 14:41:26 -04:00
benjinne
06a91ec752
Improve offboard failsafe (#18160)
* state_machine_helper: improve offboard failsafe

* state_machine_helper: add missing parameter to set_link_loss_nav_state

* state_machine_helper: fix no rc and offboard reason

* Fix offboard test by enabling rcl_except

* mavros_test fix offboard_posctl_test with rcl_except

* autopilot_tester make RcLossException bits explicit

Co-authored-by: Julian Oes <julian@oes.ch>

* autopilot_tester change rcl_except to rc_loss_exception

Co-authored-by: Julian Oes <julian@oes.ch>

* autopilot_tester fix rc_loss_exception renaming errors

Co-authored-by: Julian Oes <julian@oes.ch>
2021-09-08 18:19:53 +02:00
Julian Oes
6cb0259b79 commander: improve progress output
Instead of outputting progress at weird percentages and dropping 100%,
this now sends the progress every 10 %.
2021-08-30 21:05:40 -04:00
Daniel Agar
61702d0d97 sensors: always start baro/GPS/mag aggregators if SYS_HAS_* set
- add new SYS_HAS_GPS parameter
2021-08-23 10:59:58 -04:00
Claudio Micheli
2607527d63 Commander: improve user notification for yaw emergency
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-08-18 10:16:02 -04:00
Daniel Agar
ff39e27e2d sensor calibration: save temperature at calibration time for monitoring 2021-08-15 11:19:24 -04:00
Silvan Fuhrer
40f9b53b90 Remove a couple of unnecessary reboot_required from parameter meta data
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-08-13 10:35:43 -04:00
Beat Küng
72bc8647a9 commander: add sensors reset to factory calibration 2021-08-12 10:20:33 -04:00
bresch
741f9c6d1a Commander: change attitude quaternion check to avoid numerical issues 2021-08-08 11:41:23 -04:00
bresch
01d0b8800e commander: report GNSS yaw fault to user 2021-08-05 11:10:02 +02:00
Daniel Agar
fb3b7a4649 mavlink: receiver handle RC_CHANNELS if from MAV_COMP_ID_SYSTEM_CONTROL 2021-08-04 17:15:24 -04:00
Daniel Agar
e900f2ea54 boards: Advanced Technology Labs (ATL) Mantis EDU support and airfarme (SYS_AUTOSTART 4061)
Co-authored-by: Julian Oes <julian@oes.ch>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-08-04 17:15:24 -04:00
Daniel Agar
12ad7b17ce Makefile: add all_variants_@ helper target and consolidate github actions builds 2021-07-15 21:09:50 -04:00
Daniel Agar
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04:00
Daniel Agar
fedf8f0266 world_magnetic_model: move from ecl 2021-07-15 10:38:24 -04:00
Daniel Agar
dbaed99626
cmake remove git_ecl target 2021-07-13 10:03:06 -04:00
Matthias Grob
055c9db178 state_machine_helper: allow takeoff and hold without any link 2021-06-25 10:46:43 +02:00
Matthias Grob
15096ead5f state_machine_helper: explicitly notify about rca and data link loss 2021-06-25 10:46:43 +02:00
Matthias Grob
bec9eef5b0 state_machine_helper: react on link losses during takeoff
The same way like in loiter. This should be further unified in the code
but at least we can increase safety in the case the takeoff altitude is
very high and the vehicle never reaches it but looses links.
2021-06-25 10:46:43 +02:00
Matthias Grob
11556d4e9a Commander: allow disabling RC loss failsafe for mission, hold, offboard independently 2021-06-25 10:46:43 +02:00
Matthias Grob
933d31b476 commander_params: correct parameter group from Mission to Commander 2021-06-25 10:46:43 +02:00
Matthias Grob
6ee8f7be0f Commander: switch to static_cast<> for set_nav_state parameters 2021-06-25 10:46:43 +02:00
Thomas
a264541861 explicitly set param2 to 0 in existing *DO_VTOL_TRANSITION commands. add a guard against NaNs. 2021-06-21 22:39:54 +02:00
David Sidrane
ed474794cc commander:Use inttypes 2021-06-16 17:07:47 +02:00
Julian Oes
e828ba4288
commander: send parachute command on termination (#17564)
* commander: send parachute command on termination

This sends the DO_PARACHUTE command to parachute component.

* commander: fix lying comments and printf

* commander: use one flag for termination triggered

This merges the duplicate flags _flight_termination_triggered and
_flight_flight_termination_printed.

* commander: correct variable name

* commander: always send tune with parachute

* commander: fix target_component for parachute cmd

The previous changes were wrong in that all commands were now sent to
the parachute component which doesn't make any sense. Of course only the
parachute command should be sent there.
2021-06-15 11:50:30 +02:00
Julian Oes
8415692f2a commander: enable user override when GPS is lost
When user override using the RC sticks is allowed, I would expect this
feature to also work in the case where GPS is lost and the vehicle goes
into a blind land/descent.

Without this commit, the vehicle would switch to Land mode and a pilot
could not take over control unless they switch to Altitude control in
a ground station.

With this commit, user override works as I would expect it and it will
switch to Altitude control allowing a pilot to recover in this
situation.
2021-06-15 10:36:11 +02:00
bresch
514845592b en-/disable mc position controller using explicit control mode flag 2021-06-09 18:10:22 +02:00
Daniel Agar
4f850c7cd0 sensors: preserve all valid calibration parameters even if sensor currently missing
- mark calibration slots active for first N sensors found
 - calibration procedure don't bother resetting unused slots
2021-06-07 08:50:32 -04:00
Daniel Agar
ad534561d3 commander: only play safety change tunes if initialized 2021-05-27 10:13:49 +02:00
Daniel Agar
af71b2e3ab
commander: fix COM_DISARM_PRFLT parameter description typos 2021-05-26 21:48:41 -04:00
Julian Oes
90a33d59e4 commander: blink red on invalid mission
It doesn't make sense to blink green when something is not good.
2021-05-20 10:50:54 -04:00
Julian Oes
4ccc60e2b0 commander: neutral beep on mission with warning
When a mission is uploaded we should beep consistenly:
- valid -> positive
- warn -> neutral
- invalid -> negative

Before this, it was:
- valid -> positive
- warn -> negative
- invalid -> negative
2021-05-20 10:50:54 -04:00
Silvan Fuhrer
c8ec6b3d08 Airspeed selector: remove ASPD_STALL and replace by FW_AIRSPD_STALL
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-10 13:43:05 +02:00
RomanBapst
3ac8c23dd0 commander: added prearm check for geofence violation
- if geofence action is not none, then don't allow arming outside of geofence

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-05-10 10:46:49 +03:00
Daniel Agar
c49c8932de commander: mag_calibration fail immediately if no mags available 2021-05-08 13:03:42 +02:00