364 Commits

Author SHA1 Message Date
Matthias Grob
7a2ef4a917 Commander: don't publish RC_IN_MODE to vehicle_status
This just contains the content of the parameter which
is redundant and results in multiple sources of truth.
2021-11-09 16:05:25 +01:00
Matthias Grob
4dc165efd0 Commander: don't retry to reach the desired_main_state if we reached it 2021-11-09 16:05:25 +01:00
Matthias Grob
d48302c841 Commander: send out manual control lost event 2021-11-09 16:05:25 +01:00
Matthias Grob
93bed7f670 vehicle_command: shorten arming action/origin enum names 2021-11-09 16:05:25 +01:00
Julian Oes
b3a5072de5 commander/manual_control: use msg enum for params
Instead of using a private enum class we should define the enum in the
vehicle_command message and then use it consistently.
2021-11-09 16:05:25 +01:00
Julian Oes
f1b1068824 commander: remove unused mode/main_state methods
With the previous changes these seem no longer required.
2021-11-09 16:05:25 +01:00
Julian Oes
53bd254502 commander: add valid check
Better checking once too much than once too little.
2021-11-09 16:05:25 +01:00
Julian Oes
93c505b163 commander: force arming is not an option from RC 2021-11-09 16:05:25 +01:00
Julian Oes
6a6b8d49fc msg: re-use manual_control_input in setpoint
This way we avoid duplication between manual_control_input and
manual_control_setpoint.
2021-11-09 16:05:25 +01:00
Julian Oes
5ae76bdc17 commander: fix potentially wrong user message 2021-11-09 16:05:25 +01:00
Julian Oes
bd0c1014d9 manual_control: support arming button
The arming button required some refactoring in order to support to
toggle arm/disarm using the vehicle_command. Otherwise manual_control
would have to subscribe to the arming topic and we would spread out the
logic again, and risk race conditions.
2021-11-09 16:05:25 +01:00
Julian Oes
2e9edfcd89 commander: only override according to param
This got lost in the refactor earlier.
2021-11-09 16:05:25 +01:00
Julian Oes
97d01f200e commander: move manual_control and switches out
This moves the remaining handling of the manual control stuff out
of commander. All communication between manual control now goes through
vehicle commands, and the landing gear topic.
2021-11-09 16:05:25 +01:00
Julian Oes
e49b596edc commander: add desired main state
This is an intermediate solution to carry forward the initial state of
the mode slot. Basically, it allows that we start up in Stabilized but
switch to POSCTL as soon we have the required GPS.
2021-11-09 16:05:25 +01:00
Julian Oes
b6af068f25 commander: always reset posvel validity
I assume reseting posvel validity is ok for any case, not just all cases
except manual, acro, stabilized.
2021-11-09 16:05:25 +01:00
Julian Oes
52563264e6 commander: move valid mission check inside
I think it makes more sense to move this check inside of
main_state_transition.
2021-11-09 16:05:25 +01:00
Julian Oes
a91fa7f3c1 commander: only move to POSCTL when armed
I don't think we want to switch to POSCTL when the sticks are moved when
armed.
2021-11-09 16:05:25 +01:00
Julian Oes
66b069e788 commander: move main_state_transition out
This is a first step to having a desired main state.
2021-11-09 16:05:25 +01:00
Julian Oes
97aa06cc19 commander: move switch handling to manual_control 2021-11-09 16:05:25 +01:00
Julian Oes
08e58a44e9 Fix style 2021-11-09 16:05:25 +01:00
Julian Oes
1c15cc11d8 manual_control: implement (dis)arming via command 2021-11-09 16:05:25 +01:00
JaeyoungLim
cda7c6ceaa
Enable offboard actuator setpoints 2021-11-07 15:38:42 -05:00
bresch
1e94512719 FD: use flags union instead of bitmask 2021-11-05 09:45:52 -04:00
bresch
3f1025fb1e FD: add dedicated topic to log more internal states
log imbalanced propeller check metric

add failure_detector_status message
2021-11-05 09:45:52 -04:00
bresch
b8ed457371 Commander: trigger failsafe action if imbalanced propeller detected 2021-11-05 09:45:52 -04:00
Silvan Fuhrer
f02786d112 Navigator/Commander: make GPS failsafe consitent: switch to Descend also for FW and VTOL
- remove GPS failsafe mode
- for VTOL: transition to hover in Descend (unless NAV_FORCE_VT is not set)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-05 12:09:39 +03:00
Thomas Debrunner
32be88404a
commander: Only run estimator navigation checks when armed 2021-10-28 12:06:31 -04:00
RomanBapst
d84b0296d2 support orbit command in fixed wing mode
Signed-off-by: RomanBapst <bapstroman@gmail.com>

commander: support orbit mode for fixed wings

Signed-off-by: RomanBapst <bapstroman@gmail.com>

FwPositionControl: publish orbit status

Signed-off-by: RomanBapst <bapstroman@gmail.com>

commander:reject orbit mode while doing a vtol transition

Signed-off-by: RomanBapst <bapstroman@gmail.com>

FixedWingPositionControl: explicitly cast waypoint for Orbit status

FixedwingPositionControl: fill missing orbit_status fields

navigator_main: handle reposition/orbit corner cases

- set orbit rotation direction correctly
- send mavlink message when orbit is rejected

FixedWingPositionControl: correctly report rotation direction in orbit_status

navigator: hack to not break orbit while doing altitude changes

Signed-off-by: RomanBapst <bapstroman@gmail.com>

navigator: set cruise throttle for orbit command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-25 09:48:27 +02:00
Beat Küng
ad1bcfd77c commander: correct lockdown CLI description 2021-10-18 18:45:19 -04:00
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
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
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
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
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
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
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
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04: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
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