2259 Commits

Author SHA1 Message Date
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
Daniel Agar
18be1bacdc state_machine_helper: automatically initialize to assist mode if using mavlink manual control 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
Michael Schaeuble
f9af1bbe2d PreFlightCheck: Check if SD card is present only once and store the result
statfs accesses the file-system and can be blocking for an extended period. Since the SD card check is part of the preflight checks in the main thread of commander, it could block its execution and cause various issues. The SD card is only mounted in rcS during boot so the state will not change after the first check.
2021-03-30 08:20:49 +02:00
Daniel Agar
c2350c06c1 commander: ManualControl avoid unnecessary copy 2021-03-30 08:19:07 +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
Beat Küng
629f7ba15b params: ensure short description is only a single line
So a UI can display it properly
2021-03-23 12:55:11 -04:00
Julian Oes
a13459858d commander: improve logic for ekf2 preflight check
With this change we prevent the case where arming silently fails within
the first 10 seconds after boot.

Also, we now set the sensors as healthy as soon as the ekf is healthy,
and don't wait 10 seconds without actually checking.
2021-03-19 15:58:14 -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
Daniel Agar
2257c3767e simple gyro auto calibration module 2021-03-15 09:46:47 +01: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
Daniel Agar
bb12fce66c delete RATTITUDE flight mode 2021-03-09 10:47:00 -05:00
Daniel Agar
263b00b65f
ekf2 support SET_GPS_GLOBAL_ORIGIN and remove globallocalconverter usage
- vehicle_command cmd extended from uint16 to support PX4 internal commands that don't map to mavlink
2021-03-05 18:25:14 -05:00
Nicolas MARTIN
66beffa2f3 Enable pre-arm checks in HIL modes
by airframe parameters HIL mode will still disable:
 - usb check
 - power checks
 - safety switch
2021-03-05 21:23:31 +01:00
Daniel Agar
077afdf9aa
commander: extend reliant on opt flow to ALTCTL (degraded from POSCTL)
If you're flying in manual position control mode and lose position the state machine will put you in altitude control mode. Extending the reliant on optical flow relaxed position validity thresholds allows you to potential get back into position control mode with flow alone.
2021-03-05 10:07:36 -05:00
Daniel Agar
d0c9a5fc93
OFFBOARD mode architecture overhaul (#16739)
- handle SET_POSITION_TARGET_LOCAL_NED and SET_POSITION_TARGET_GLOBAL_INT with ORB_ID(trajectory_setpoint)
 - FlightTaskOffboard not needed at all
 - bypass position_setpoint_triplet entirely (start removing extraneous fields)
 - simplify offboard_control_mode to map to supported control modes
2021-03-05 09:39:46 -05:00
Matthias Grob
5bbc66f3af ManualControl: name, message, comment, const qualifier improvements
addressing review from @bresch, @julianoes and @JonasVautherin
2021-03-04 10:41:21 +01:00
Matthias Grob
2f39651f77 ManualControl: use current sample for timeout check 2021-03-04 10:41:21 +01:00
Matthias Grob
a43a829fdf Commander: gate manual control setpoint processing on new data 2021-03-04 10:41:21 +01:00
Matthias Grob
935423b563 ManualControl: start to distinguish rc arming methods 2021-03-04 10:41:21 +01:00
Matthias Grob
c16b48fd2c Commander: Replace manual_control_setpoint use 2021-03-04 10:41:21 +01:00
Matthias Grob
49c240f49e Commander: simplify rc arming disabling logic 2021-03-04 10:41:21 +01:00
Matthias Grob
ca3bfb5ea1 ManualControl: simplify multicopter manual thrust logic 2021-03-04 10:41:21 +01:00
Matthias Grob
a796903e21 ManualControl: fix arm button use case 2021-03-04 10:41:21 +01:00
Matthias Grob
37ea78a7ff Commander: move rc arming to ManualControl class
Separating the different arming methods is the next step.
2021-03-04 10:41:21 +01:00
Matthias Grob
00a4133042 ManualControl: make members private again 2021-03-04 10:41:21 +01:00
Matthias Grob
ee2d408edc Commander: move rc availability to ManualControl 2021-03-04 10:41:21 +01:00
Matthias Grob
0e1f1a9f57 Commander: use parameters directly in ManualControl 2021-03-04 10:41:21 +01:00
Matthias Grob
dda895c94b Commander: split out rc override logic into ManualControl 2021-03-04 10:41:21 +01:00
Matthias Grob
a4da15edf5 Commander: RC override back to stick change
Instead of deflection mainly because:
- Spring loaded throttle -> bad user experience
- Stale RC data -> Vehicle not savable
2021-03-04 10:41:21 +01:00
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