429 Commits

Author SHA1 Message Date
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
Thomas Debrunner
f6bdc42977 param-reset: Add option to reset all configurable params, but not the ones that store vehicle information 2022-04-14 07:57:48 +02:00
Matthias Grob
f968a5947d ArmStateMachine: port arming_state_names into the class 2022-04-06 10:02:14 +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
8c3ba7adb4 commander: silence GPS no longer validity PX4_WARN 2022-04-04 14:43:11 -04:00
Daniel Agar
0c31f63896 sensors: add baro calibration and cleanup
- sensor_baro.msg use SI (pressure in Pascals)
 - update all barometer drivers to publish directly and remove PX4Barometer helper
 - introduce baro cal (offset) mainly as a mechanism to adjust
relative priority
 - commander: add simple baro cal that sets baro offsets to align with
GPS altitude (if available)
 - create new sensors_status.msg to generalize sensor reporting
2022-03-26 16:08:41 -04: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
db1fb6acf7 Commander: no battery time based RTL when already landed 2022-03-23 10:49:38 +01: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
Roman Bapst
6de5d24e00
Added VTOL Takeoff navigation mode (#19027)
* Commander: added support for MAIN_STATE_AUTO_VTOL_TAKEOFF
* navigator: added support for vtol_takeoff navigation mode
2022-02-15 14:56:57 +01:00
Matthias Grob
ae0bb8371d Commander: message planned battery action with warning together 2022-01-31 20:27:06 -05:00
Matthias Grob
405852b5c8 Commander: only disallow RC override during battery failsafe delay 2022-01-31 20:27:06 -05:00
Matthias Grob
5ec21835a4 Commander: ensure low battery failsafe flying unatended without GPS 2022-01-31 20:27:06 -05:00
Matthias Grob
1911ec0085 Commander: fix user messageing for low battery failsafe delay 2022-01-31 20:27:06 -05:00
Matthias Grob
955aad0dfb Commander: consistent hysteresis initialization 2022-01-31 20:27:06 -05:00
Matthias Grob
d10f9030ad Commander: add delay before executing low battery failsafe action 2022-01-31 20:27:06 -05:00
Matthias Grob
3af315f2c3 Commander: change battery failsafe to return action instead of executing 2022-01-31 20:27:06 -05:00
Matthias Grob
8eed43b515 Commander: put battery warning and failsafe action in separate functions 2022-01-31 20:27:06 -05:00
Daniel Agar
ad447ab223 commander: respect control mode for prearm requirements
- preflight tolerate ekf2 warnings if not in an attitude/velocity/position mode (eg manual or acro)
2022-01-31 09:48:37 -05:00
Daniel Agar
3f25349eb9 commander: don't reject VEHICLE_CMD_DO_SET_ACTUATOR 2022-01-25 18:44:58 -05:00
Claudio Micheli
8a01135a93 Commander: more changes to use events with escs and battery failures
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2022-01-13 08:40:34 +01: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
Julian Oes
b3d830dd11 Mantis: move power off tune to commander
This way we don't allocate inside the interrupt context.
2022-01-10 23:04:10 -05:00
Julian Oes
aa007dadee commander: fix emergency power off
From what I can see the CONFIG_BOARDCTL_POWEROFF is not really used
anywhere, however, the BOARD_HAS_POWER_CONTROL is something that is set,
e.g. for the Mantis, to allow power off.
2022-01-10 23:04:10 -05:00
Julian Oes
6301fa35c1 commander: add command to power off 2022-01-10 23:04:10 -05:00
Daniel Agar
71d8b15b73 commander: fix COM_HOME_EN missing case
- VEHICLE_CMD_COMPONENT_ARM_DISARM is yet another path that calls set_home_position()
2022-01-09 20:52:07 -05:00
Beat Küng
8e04934eab commander: consider COM_MOT_TEST_EN for COMMAND_ACTUATOR_TEST as well 2021-12-24 20:06:13 -05:00
Daniel Agar
7d7d707db9 commander: add COM_HOME_EN parameter to enable/disable home position 2021-12-23 15:46:31 -05:00
Matthias Grob
f68ae39840 Commander: avoid RC actions during calibration 2021-12-22 09:08:23 -05:00
Thomas Debrunner
eb69f15d3a health-flags: Increase health flags to 64 bit bit field to support extended sys status mavlink message
Add SYS_STATUS flag for parachute
2021-12-14 09:41:12 -05:00
Daniel Agar
986cf288da
dataman: remove obsolete persistence and reset reason 2021-12-12 12:06:35 -05:00
Thomas Debrunner
8db7a6225b geo: Moved the map_projection_* functions and state into a self-contained C++ class 2021-12-06 14:30:14 +01:00
Julian Oes
a9b9362fea commander: handle system broadcast commands
This changes the command handling logic to accept commands which are
targeted at any system, signaled by target_system set to 0.
2021-12-01 20:17:35 -05:00
Matthias Grob
55dfbdc6a6 Commander: fix remaining flight time user messaging 2021-11-30 19:46:22 +01:00
Matthias Grob
c5fb68b7a1 Commander: force disabling the arm stick gesture when arm switch is in use 2021-11-25 07:56:35 +01: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
Matthias Grob
5489005e0b Commander: call battery_status_check on update instead of early return 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
0153c870d2 Commander: make sure yaw airmode is not possible while arm gesture is enabled
It's unsafe to arm with the gesture when yaw airmode is enabled
because e.g. in Stabilized mode that results in a high yawrate setpoint
that the drone tries to follow even with zero thrust
because of the airmode.

It was handled before by checking the arm switch parameter because that
used to disable the stick arm gesture.
See 24dc316973a049e50d3e6760eddbf7250cb55d2e
2021-11-23 16:03:46 +01:00
Daniel Agar
577d926639 commander: improve angular velocity validity and message 2021-11-22 11:27:45 -05:00
Matthias Grob
f912ee2c8b Commander: send out parachute MAVLink command when kill switch engaged 2021-11-19 17:15:04 +01:00