458 Commits

Author SHA1 Message Date
Matthias Grob
aa575d6af0 Commander: move first preflight check run to constructor 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
bd50a52c9c Commander: fix startup sound interrupted by safety button initialization
The safetyButtonHandler() reports that the safety statatus
changed on the first loop iteration when safety is disabled which makes
sense to inform the system that safety is off but the tune for the user
should not be played because it interrupts the startup tune.
2022-06-08 05:12:05 -04:00
Matthias Grob
44c4b8fa85 Style refactoring related to safety button 2022-06-08 05:12:05 -04:00
Matthias Grob
83c15fca9f Commander: switch back to Hold mode after autonomous landing 2022-06-01 12:08:32 +12:00
Matthias Grob
33df8b24f2 Commander: differentiate clearly between to arm and to disarm transition 2022-06-01 12:08:32 +12:00
Matthias Grob
400e1f8214 Commander: only initialize to tablet mode and don't switch back on RC loss 2022-06-01 12:08:32 +12:00
Matthias Grob
c03f5b9481 Commander: fix overlooked rebase naming error 2022-05-25 21:10:19 +02: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
Matthias Grob
0be474430c Commander: don't disarm on landing amid a mission 2022-05-24 13:42:03 +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
Julian Oes
33a77c225c commander: lockdown is not termination
We use lockdown to prevent outputs like motors and servos from being
active in HITL simulation. This means that we can't treat the lockdown
flag as a flight_terminated, otherwise we can't arm in HITL at all.
2022-05-20 09:43:32 -04:00
Nico van Duijn
04071b9456 Commander: ignore MAV_CMD_REQUEST_MSG
This commit adds the MAV_CMD_REQUEST_MESSAGE to the list of vehicle
commands which are ignored without generating a warning sound.
2022-05-20 15:36:42 +02:00
Matthias Grob
38e027ee45 ArmStateMachine: remove dependency on armed.armed
To have the internal state as single source of truth
for the arming state within Commander.
2022-05-20 13:51:51 +02:00
Matthias Grob
37c485ce89 ArmStateMachine: move arm state into the class 2022-05-20 13:51:51 +02:00
Matthias Grob
47532ca07b ArmStateMachine: replace state name array with method 2022-05-20 13:51:51 +02:00
Daniel Agar
fd4b62032e
commander: publish actuator_armed first on any change 2022-05-19 12:47:50 -04:00
Silvan Fuhrer
2b7efeacca vtol_vehicle_status: replace several status bools by single vehicle_vtol_state
Replace vtol_in_rw_mode, vtol_in_trans_mode, in_transition_to_fw by vehicle_vtol_state.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02:00
Silvan Fuhrer
635f64a2e5 Commander: remove permanent stabilization option for fixed-wing flight
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02: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
Matthias Grob
b3776134b8 Commander: ensure diconnected battery is cleared from bit field 2022-05-06 10:32:27 -04:00
Alex Mikhalev
45dff7f71a commander: Add prearm check for flight termination 2022-04-25 11:57:37 -04:00
Junwoo Hwang
af839c828d Set Tune's Volume for Power-Off in Commander to default volume of tune_control message 2022-04-25 11:47:43 -04:00
bresch
3c6b72c33b commander: improve set_in_air_position
- set local home using global pos and global home
- set local home using GNSS pos and global home
- set global home using global ref of local frame and local home
2022-04-19 15:29:25 +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
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