312 Commits

Author SHA1 Message Date
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
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
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
a43a829fdf Commander: gate manual control setpoint processing on new data 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
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
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
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
bresch
9d3ff12a94 commander: reword nav failure message 2021-02-11 16:20:30 -05:00
bresch
5726e8e0a3 commander: do not fail nav check on GPS position glitch
In case of a diverge of the nav filter, both position and velocity test
ratios are large. If only one of them is too large, the nav filter is
most likely not diverging but is encountering a GNSS position reset and
it is still safe to fly in position mode.
2021-02-11 16:20:30 -05:00
bresch
b1b032d6e1 commander: rework nav failure check
Allows to recover from a failed test with a stricter test
2021-02-11 16:20:30 -05:00
Daniel Agar
6633ff5089 commander: vehicle_status_flags add attitude and angular velocity 2021-02-05 20:11:13 +01:00
Matthias Grob
b44b770972 commander: RC loss delay renaming/reordering 2021-02-04 10:54:52 +01:00
Matthias Grob
26d74bf57d Commander: enable failsafe delay for position and mission mode
Instead of directly doing the link loss reaction which by default is RTL a delay
can be configured such that the drone first switches to hold and waits
for the link to be regained.
2021-02-04 10:54:52 +01:00
Claudio Micheli
c2154df2f6 ekf2checks: split GPS checks from AHRS checks - minor cleanup
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-02-01 09:02:19 +01:00