205 Commits

Author SHA1 Message Date
Beat Küng
dcb9b712bb refactor commander: move vehicle control mode to ModeUtil 2022-09-01 17:07:23 -04:00
Beat Küng
f197c8884d commander: move esc checks to arming check 2022-09-01 17:07:23 -04:00
Beat Küng
c9037f115b refactor commander: split out home position 2022-09-01 17:07:23 -04:00
Beat Küng
f17f38197d commander: move estimator checks to arming check 2022-09-01 17:07:23 -04:00
Beat Küng
cfe3d793bf commander: move battery handling into arming checks 2022-09-01 17:07:23 -04:00
Beat Küng
13c93db11a commander: use circuit breaker params directly in arming checks 2022-08-25 22:02:15 -04:00
Beat Küng
4230eee24f commander: print 'ready for takeoff' to console for sitl after startup 2022-08-25 22:02:15 -04:00
Beat Küng
2fccb576ad commander: remove unused includes and variables 2022-08-25 22:02:15 -04:00
Beat Küng
b2cb164c12 commander: replace health flags with health_report from arming checks 2022-08-25 22:02:15 -04:00
Beat Küng
6d1fb92eb7 commander: rework arming checks to use the events interface 2022-08-25 22:02:15 -04:00
Beat Küng
04f7df3848 SubscriptionMultiArray: use Subscription instead of SubscriptionInterval
Saves ~3KB RAM on fmu-v5.
2022-08-25 22:02:15 -04:00
Daniel Agar
e99da22cbe delete CBRK_VELPOSERR circuit breaker 2022-07-12 13:51:13 -04:00
Daniel Agar
15223009d2 combine sensor_gps + vehicle_gps_position msgs (keeping separate topics) 2022-07-07 10:24:11 -04:00
Martina Rivizzigno
55563eba49 MPC_SPOOLUP_TIME -> COM_SPOOLUP_TIME 2022-06-24 19:44:43 +02:00
Matthias Grob
92b6862485 Commander: replace arm requirements 2022-06-16 10:25:32 -04:00
Matthias Grob
c59809b14a Commander: remove system_sensors_initialized
and system_hotplug_timeout. They're not in use for over 2 years.
Instead control LED with preflight checks.
2022-06-15 14:02:00 -04:00
Matthias Grob
f5e7b1e6a8 Commander: switch battery bitflied to dedicated datatype 2022-06-08 11:32:26 +02:00
Matthias Grob
44c4b8fa85 Style refactoring related to safety button 2022-06-08 05:12:05 -04:00
alessandro
29c4119e24
Match commander uORB var names to message names (#19707)
* match vehicle_status

* match home_position

* match vehicle_command_ack

* match actuator_armed

* match vehicle_control_mode

* match commander_state
2022-05-25 17:08:48 +02:00
Igor Misic
08dcc72e1f commander/safety: replace safety.msg with Safety class (#19558) 2022-05-23 06:54:37 +02:00
Daniel Agar
c40631c136
commander: handle RC loss timeout if manual_control_setpoint stops publishing (#19680)
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2022-05-20 19:37:30 -04:00
Alessandro Simovic
fb71e7587c failure_detector: add motor/ESC failure detection 2022-05-12 07:58:56 +02:00
Daniel Agar
c772e5230f
commander: remove compile time dependencies on non-commander parameters
- this allows builds with mavlink fully disabled
 - move commander MAN_ARM_GESTURE, RC_MAP_ARM_SW, MC_AIRMODE checks to manual_control
2022-05-11 10:14:23 -04:00
Silvan Fuhrer
5d6c8c986d Commander: high wind speed handling updates
- add logic for detecting high wind speed in Commander,
and handle it toghether with wind speed warning
- trigger and enforce RTL if COM_WIND_MAX is breached

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-09 19:09:40 +02:00
Silvan Fuhrer
1aad82f87d Commander: add max flight time RTL
Adds COM_FLT_TIME_MAX param and logic in Commander to enforce RTL when
flight time is above this value. User can only override to LAND mode,
but not proceed flight beyond that.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-09 19:09:40 +02:00
bresch
d2f2ba59a4 commander: refactor home position setter
- always try to set local or global home position when possible
- set global home with GNSS position if global pos from EKF isn't
  available
- reset home when significantly moved from home before takeoff (checking
  lpos or gpos or GNSS)
- reset home on takeoff transition
- reset home on mavlink arm command
- remove "home required accuracy" parameters, rely on validity flags
2022-04-19 15:29:25 +02:00
Matthias Grob
074080c816 Commander: separate out arm state machine to class
Pure refactoring and just the first step to avoid conflicts on the way.
2022-04-06 10:02:14 +02:00
Igor Misic
80aef942cd safety and safety button: refactoring #19413 2022-04-05 07:57:37 +02:00
Daniel Agar
875a2cc423 commander: remove loop counters and update UI LED control to use monotonic time 2022-03-24 22:43:26 -04:00
Daniel Agar
879622547c commander: only process one vehicle_command/action_request per cycle
- things like arming requests can be dependent on current nav state
that might requested by a previous command, but the state machine
transition will only happen after command processing
2022-03-24 22:43:26 -04:00
Jonas Perolini
e31304d7d5
Quadchute param update (#19351)
New parameter for actions after a quadchute (COM_QC_ACT)

Co-authored-by: Jonas <jonas.perolini@rigi.tech>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2022-03-24 10:27:32 +01:00
Matthias Grob
e6ed595651 Commander: make last_fail_time_us parameter a reference instead of pointer 2022-03-23 15:04:48 -04:00
Matthias Grob
eee4aaee4f Commander: remove dynamic position velocity probation period 2022-03-23 15:04:48 -04:00
Silvan Fuhrer
a7ddaf08c4 vehicle_status_flags.msg: remove condition_ prefix to reduce message size
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-03-23 10:37:51 -04:00
Matthias Grob
b85c4ec475 Commander: rename land detection subscription for consistency 2022-03-23 10:49:38 +01:00
bresch
182980526f commander: allow rearming grace period for arming switch only 2022-03-09 08:42:21 +01:00
Daniel Agar
11f617ca9b ekf2: default to in air and not at rest
- this is a more conservative default if a vehicle isn't set (no land detector running)
 - handled horizontal preflight failures in commander when disarmed
rather than overloading xy_valid and v_xy_valid flags
 - ekf2 no longer depend on arming or standby status
2022-02-22 16:59:10 -05:00
Daniel Agar
1d7791dad6 commander: monitor GPS validity and EKF2 dead reckoning
- ekf2: expose dead reckoning as control status flags
 - commander:
    - add GPS validity check
    - in AUTO MISSION if dependent on GPS then a loss of GPS will
2022-02-22 09:46:21 -05:00
Matthias Grob
d10f9030ad Commander: add delay before executing low battery failsafe action 2022-01-31 20:27:06 -05:00
Claudio Micheli
d122513197 extend support for Battery status message
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2022-01-13 08:40:34 +01:00
Daniel Agar
7d7d707db9 commander: add COM_HOME_EN parameter to enable/disable home position 2021-12-23 15:46:31 -05:00
Daniel Agar
986cf288da
dataman: remove obsolete persistence and reset reason 2021-12-12 12:06:35 -05:00
Matthias Grob
c522a8b15a Compute RTL time and react if lower than flight time
- Compute RTL time also during RTL
- Calculate correct altitude when finding destination
2021-11-24 14:10:24 +01:00
Beat Küng
21699935e8 vehicle_command: add VEHICLE_CMD_ACTUATOR_TEST and VEHICLE_CMD_CONFIGURE_ACTUATOR 2021-11-23 12:40:22 -05:00
Matthias Grob
43c529f294 Add MAVLink parachute system heartbeat detection 2021-11-19 17:15:04 +01:00
Matthias Grob
a593a51f05 Commander: fix mode initialization with RC 2021-11-09 16:05:25 +01:00
Matthias Grob
38ab7e6ab9 Commander: separate function for action request execution 2021-11-09 16:05:25 +01:00
Matthias Grob
0a02d8e774 Commander: handle denying disarm when not landed centrally 2021-11-09 16:05:25 +01:00
Matthias Grob
956997eb1e Replace arm_request and mode_request with combined action_request
Which saves flash space, log size and is extensible to handle e.g.
the VTOL transition and future actions.
2021-11-09 16:05:25 +01:00
Matthias Grob
052e29267d Use mode_request for RC mode switching 2021-11-09 16:05:25 +01:00