mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 14:03:34 +08:00
commander: use new failsafe state machine and add user intention class
This commit is contained in:
@@ -59,7 +59,6 @@ set(msg_files
|
||||
cellular_status.msg
|
||||
collision_constraints.msg
|
||||
collision_report.msg
|
||||
commander_state.msg
|
||||
control_allocator_status.msg
|
||||
cpuload.msg
|
||||
differential_pressure.msg
|
||||
|
||||
@@ -16,4 +16,4 @@ uint8 SOURCE_RC_SWITCH = 1
|
||||
uint8 SOURCE_RC_BUTTON = 2
|
||||
uint8 SOURCE_RC_MODE_SLOT = 3
|
||||
|
||||
uint8 mode # for ACTION_SWITCH_MODE what mode is requested according to commander_state.MAIN_STATE_
|
||||
uint8 mode # for ACTION_SWITCH_MODE what mode is requested according to vehicle_status_s::NAVIGATION_STATE_*
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Main state, i.e. what user wants. Controlled by RC or from ground station via telemetry link.
|
||||
uint64 timestamp # time since system start (microseconds)
|
||||
|
||||
uint8 MAIN_STATE_MANUAL = 0
|
||||
uint8 MAIN_STATE_ALTCTL = 1
|
||||
uint8 MAIN_STATE_POSCTL = 2
|
||||
uint8 MAIN_STATE_AUTO_MISSION = 3
|
||||
uint8 MAIN_STATE_AUTO_LOITER = 4
|
||||
uint8 MAIN_STATE_AUTO_RTL = 5
|
||||
uint8 MAIN_STATE_ACRO = 6
|
||||
uint8 MAIN_STATE_OFFBOARD = 7
|
||||
uint8 MAIN_STATE_STAB = 8
|
||||
# LEGACY RATTITUDE = 9
|
||||
uint8 MAIN_STATE_AUTO_TAKEOFF = 10
|
||||
uint8 MAIN_STATE_AUTO_LAND = 11
|
||||
uint8 MAIN_STATE_AUTO_FOLLOW_TARGET = 12
|
||||
uint8 MAIN_STATE_AUTO_PRECLAND = 13
|
||||
uint8 MAIN_STATE_ORBIT = 14
|
||||
uint8 MAIN_STATE_AUTO_VTOL_TAKEOFF = 15
|
||||
uint8 MAIN_STATE_MAX = 16
|
||||
|
||||
uint8 main_state
|
||||
|
||||
uint16 main_state_changes
|
||||
@@ -33,8 +33,9 @@ uint8 ARM_DISARM_REASON_UNIT_TEST = 13
|
||||
|
||||
uint64 nav_state_timestamp # time when current nav_state activated
|
||||
|
||||
# Navigation state "what should vehicle do"
|
||||
uint8 nav_state
|
||||
uint8 nav_state_user_intention # Mode that the user selected (might be different from nav_state in a failsafe situation)
|
||||
|
||||
uint8 nav_state # Currently active mode
|
||||
uint8 NAVIGATION_STATE_MANUAL = 0 # Manual mode
|
||||
uint8 NAVIGATION_STATE_ALTCTL = 1 # Altitude control mode
|
||||
uint8 NAVIGATION_STATE_POSCTL = 2 # Position control mode
|
||||
@@ -83,6 +84,7 @@ uint8 VEHICLE_TYPE_ROVER = 3
|
||||
uint8 VEHICLE_TYPE_AIRSHIP = 4
|
||||
|
||||
bool failsafe # true if system is in failsafe state (e.g.:RTL, Hover, Terminate, ...)
|
||||
bool failsafe_and_user_took_over # true if system is in failsafe state but the user took over control
|
||||
uint64 failsafe_timestamp # time when failsafe was activated
|
||||
|
||||
# Link loss
|
||||
@@ -97,8 +99,6 @@ bool is_vtol_tailsitter # True if the system performs a 90° pitch down rotatio
|
||||
bool in_transition_mode # True if VTOL is doing a transition
|
||||
bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW
|
||||
|
||||
bool mission_failure # Set to true if mission could not continue/finish
|
||||
bool geofence_violated
|
||||
|
||||
# MAVLink identification
|
||||
uint8 system_type # system type, contains mavlink MAV_TYPE
|
||||
|
||||
@@ -36,7 +36,6 @@ bool home_position_valid # Home position valid
|
||||
bool offboard_control_signal_lost # Offboard signal lost
|
||||
bool geofence_violated # Geofence violated
|
||||
|
||||
bool rc_signal_found_once
|
||||
bool rc_signal_lost # RC signal lost
|
||||
bool data_link_lost # Data link lost
|
||||
bool mission_failure # Mission failure
|
||||
@@ -46,5 +45,14 @@ bool vtol_transition_failure # VTOL transition failed
|
||||
bool battery_low_remaining_time
|
||||
bool battery_unhealthy
|
||||
|
||||
uint8 battery_warning
|
||||
bool wind_limit_exceeded
|
||||
bool flight_time_limit_exceeded
|
||||
|
||||
# failure detector
|
||||
bool fd_esc_arming_failure
|
||||
bool fd_critical_failure # Critical failure (attitude/altitude limit exceeded, or external ATS)
|
||||
bool fd_imbalanced_prop # Imbalanced propeller detected
|
||||
bool fd_motor_failure
|
||||
|
||||
uint8 battery_warning # Battery warning level
|
||||
|
||||
|
||||
Reference in New Issue
Block a user