338 Commits

Author SHA1 Message Date
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
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
ad534561d3 commander: only play safety change tunes if initialized 2021-05-27 10:13:49 +02: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
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
Igor Mišić
d631a5d39f Commander: checking COM_ARM_CHK_ESCS param for ESCs telemetry
COM_ARM_CHK_ESCS set to 0. The user will need to enable it manually.
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2021-04-22 13:46:08 +02:00
Claudio Micheli
bff99f9794 Commander:esc_checks minor improvements
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-04-22 13:46:08 +02:00
Claudio Micheli
371fa98579 Commander/preflight checks: Add monitoring to ESC failures
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-04-22 13:46:08 +02:00
Igor Mišić
bd4839e855 commander: changed msg "connection to GCS lost" from critical to info
update
2021-04-15 11:29:02 -04:00
Lorenz Meier
82f319a84a
Commander: Add support for pairing via commandline 2021-04-01 09:56:09 -04:00
TSC21
7abce87ae4 commander: add COM_OBC_LOSS_T for setting onboard computer loss time-out 2021-03-31 13:25:01 +02:00
Matthias Grob
b7600f4e4d Commander: check_posvel_validity use return value 2021-03-30 22:33:01 -04:00
Matthias Grob
29e1e0905c Commander: switch main_state functions to pass by reference 2021-03-30 22:33:01 -04:00
Matthias Grob
531de5c588 Commander: switch all state_machine_helper functions to pass by reference 2021-03-30 22:33:01 -04:00
Matthias Grob
d97fba67e5 Commander: switch helper functions to pass by reference 2021-03-30 22:33:01 -04:00
Daniel Agar
0fa91f7cb0 commander: centralize main_state strings and simplify main state change attempts
* commander: centralize main_state strings and simplify main state change attempts
2021-03-30 17:56:28 +02:00
Claudio Micheli
b001865e5c Commander: clean up logic for flight mode transitions and add joystick mode initialization
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-03-30 17:56:28 +02:00
bresch
ace6f81c93 commander: report estimator mag fault detection to ground station 2021-03-25 12:57:36 -04:00
bresch
2c5342acd4 commander: increase nav_test_failed hysteresis time
This is to avoid race condition with the yaw emergency estimator having
the same trigger delay of 1 second. Commander will now give more time to
EKF2 to reset itself before switching to altitude mode.
2021-03-25 12:57:36 -04:00
Julian Oes
2f024a9a8a commander: pass in correct time since boot
This fixes the case where the preflight check fail right after the start
and report "sensors unstable".
2021-03-19 15:58:14 -04:00
garfieldG
e9725a5fa7
Merge pull request #17089 from garfieldG/pr-safety_switch_status
send safety switch status to ground
2021-03-17 05:23:31 +01:00
Inhwan Wee
c67d85945b [commander] more detailed print_status 2021-03-16 01:00:55 -04:00
Matthias Grob
ceb445caa0 Run mc_pos_control for acceleration control mode flag 2021-03-11 10:37:03 -05:00
Daniel Agar
a11d2207e4 commander: simplify failure detector is attitude stabilized check 2021-03-09 10:47:00 -05:00