345 Commits

Author SHA1 Message Date
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
Daniel Agar
d1dfa26903 consume all available queued vehicle_commands 2021-01-26 12:00:18 -05:00
Julian Kent
af8d178ae5 Fix spurious RTL triggers
Two sources:
1. global to local conversion was sometimes giving issues, so do everything in global
2. on startup the RTL didn't check if the home position was valid before processing it
2021-01-18 16:26:53 +01:00
Julian Kent
7482413005 Add Range-based RTL 2021-01-18 16:26:53 +01:00
Jaeyoung-Lim
d2b0f63e1f Handle offboard mode with acceleration setpoints
The case when acceleration setpoints were being passed in offboard mode was triggering control_climbrate_mode. This prevented the vehicle from taking off, since it made the vehicle skip the rampup phase of the takeoff
This commit fixes this by handling the case properly
2021-01-06 20:38:18 +01:00
Lorenz Meier
4237c8be25 Commander: Do not acknowledge binding
This is now done in the respective modules directly and based on implementation and execution state.
2020-12-31 13:22:52 +01:00
Daniel Agar
49d4cc7d5b commander: CMD_NAV_LAND/CMD_NAV_PRECLAND reply RESULT_ACCEPTED unless transition is denied 2020-12-30 12:05:41 +01:00
Daniel Agar
91f5f26618 commander: main_state_transition call trivial style fixes 2020-12-30 00:26:14 +01:00
Nicolas MARTIN
e06d218ff2
commander: disable arm_auth request for prearm status continuous publication 2020-12-27 16:23:05 -05:00
Lorenz Meier
4b0d8efbc1 Commander: move static overload_start to class 2020-12-27 13:44:32 -05:00
Daniel Agar
336176b2f0 Mavlink FLIGHT_INFORMATION fix arming time (ms -> us) and add takeoff time
- fixes https://github.com/PX4/PX4-Autopilot/issues/16393
2020-12-16 09:38:05 -05:00
Daniel Agar
ae2b1a265c commander: POSCTL optical flow aiding continue updating GPOS validity
- updating the global position validity should happen regardless of
being in manual position control mode with only optical flow
 - condition_global_position_valid needs to be accurate to adjudicate
main state changes (eg going into AUTO MISSION)
2020-12-11 15:33:50 -05:00
Daniel Agar
6bda8af97c commander: merge duplicated position and velocity validity checks 2020-12-11 15:33:50 -05:00
Daniel Agar
5cd4a9c73f commander: global position validity respect local position xy_valid 2020-12-11 15:33:50 -05:00
Daniel Agar
ef6209ba03
new manual_control_switches msg (split out of manual_control_setpoint) (#16270)
- split out switches from manual_control_setpoint into new message manual_control_switches
 - manual_control_switches published at minimal rate (~ 1 Hz) or immediately on change
 - simple switch debounce in rc_update (2 consecutive identical decodes required)
 - manual_control_switches logged at full rate rather than sampled at (5-10% of messages logged)
 - manual_control_setpoint publish at minimal rate unless changing
 - commander handle landing gear switch for manual modes
 - processing of mode_slot and mode_switch is now split so we only do one or the other (not both)
     - a future step will be to finally drop mode_switch and accompanying switches entirely

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2020-12-11 12:11:35 -05:00
Igor Campos
c316af6ec7 update to match new feature as a new mavlink command Oblique Survey 260 2020-12-09 17:54:53 +01:00
Daniel Agar
cd1ffa63cd
commander: auto transition to LOITER if disarmed with no RC only requires a valid global position 2020-12-08 18:26:03 -05:00
bresch
711bd2ce87 Commander: use helper to set home position 2020-12-07 10:24:23 -05:00