aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uORB
diff options
context:
space:
mode:
authorJulian Oes <julian@oes.ch>2014-05-27 21:56:32 +0200
committerJulian Oes <julian@oes.ch>2014-05-27 21:56:32 +0200
commited6c2a5168ca891f20594687acfd3c6bbf7e1cf9 (patch)
treeb71c7b12719a3d4535615aee2cf95a034bc87b13 /src/modules/uORB
parent063caba36bd2fe26eb4bfa8e546e9551ccc05519 (diff)
downloadpx4-firmware-ed6c2a5168ca891f20594687acfd3c6bbf7e1cf9.tar.gz
px4-firmware-ed6c2a5168ca891f20594687acfd3c6bbf7e1cf9.tar.bz2
px4-firmware-ed6c2a5168ca891f20594687acfd3c6bbf7e1cf9.zip
commander and navigator: lot's of changes, failsafe handling in commander, navigator only for execution (WIP)
Diffstat (limited to 'src/modules/uORB')
-rw-r--r--src/modules/uORB/topics/mission_result.h1
-rw-r--r--src/modules/uORB/topics/position_setpoint_triplet.h15
-rw-r--r--src/modules/uORB/topics/vehicle_status.h35
3 files changed, 30 insertions, 21 deletions
diff --git a/src/modules/uORB/topics/mission_result.h b/src/modules/uORB/topics/mission_result.h
index 7c3921198..ad654a9ff 100644
--- a/src/modules/uORB/topics/mission_result.h
+++ b/src/modules/uORB/topics/mission_result.h
@@ -56,6 +56,7 @@ struct mission_result_s
bool mission_reached; /**< true if mission has been reached */
unsigned mission_index_reached; /**< index of the mission which has been reached */
unsigned index_current_mission; /**< index of the current mission */
+ bool mission_finished; /**< true if mission has been completed */
};
/**
diff --git a/src/modules/uORB/topics/position_setpoint_triplet.h b/src/modules/uORB/topics/position_setpoint_triplet.h
index 85e8ef8a5..c2741a05b 100644
--- a/src/modules/uORB/topics/position_setpoint_triplet.h
+++ b/src/modules/uORB/topics/position_setpoint_triplet.h
@@ -74,14 +74,13 @@ struct position_setpoint_s
};
typedef enum {
- NAV_STATE_NONE_ON_GROUND = 0,
- NAV_STATE_NONE_IN_AIR,
- NAV_STATE_AUTO_ON_GROUND,
- NAV_STATE_LOITER,
- NAV_STATE_MISSION,
- NAV_STATE_RTL,
- NAV_STATE_LAND,
- NAV_STATE_MAX
+ NAV_STATE_MANUAL = 0,
+ NAV_STATE_POSCTL,
+ NAV_STATE_AUTO,
+ NAV_STATE_RC_LOSS,
+ NAV_STATE_DL_LOSS,
+ NAV_STATE_TERMINATION,
+ MAX_NAV_STATE
} nav_state_t;
/**
diff --git a/src/modules/uORB/topics/vehicle_status.h b/src/modules/uORB/topics/vehicle_status.h
index d902dc49e..259d7329e 100644
--- a/src/modules/uORB/topics/vehicle_status.h
+++ b/src/modules/uORB/topics/vehicle_status.h
@@ -63,9 +63,11 @@ typedef enum {
MAIN_STATE_MANUAL = 0,
MAIN_STATE_ALTCTL,
MAIN_STATE_POSCTL,
- MAIN_STATE_AUTO,
+ MAIN_STATE_AUTO_MISSION,
+ MAIN_STATE_AUTO_LOITER,
+ MAIN_STATE_AUTO_RTL,
MAIN_STATE_ACRO,
- MAIN_STATE_MAX
+ MAIN_STATE_MAX,
} main_state_t;
// If you change the order, add or remove arming_state_t states make sure to update the arrays
@@ -78,7 +80,7 @@ typedef enum {
ARMING_STATE_STANDBY_ERROR,
ARMING_STATE_REBOOT,
ARMING_STATE_IN_AIR_RESTORE,
- ARMING_STATE_MAX
+ ARMING_STATE_MAX,
} arming_state_t;
typedef enum {
@@ -88,18 +90,25 @@ typedef enum {
typedef enum {
FAILSAFE_STATE_NORMAL = 0, /**< Normal operation */
- FAILSAFE_STATE_RTL, /**< Return To Launch */
- FAILSAFE_STATE_LAND, /**< Land without position control */
+ FAILSAFE_STATE_RTL_RC, /**< Return To Launch on remote control loss */
+ FAILSAFE_STATE_RTL_DL, /**< Return To Launch on datalink loss */
+ FAILSAFE_STATE_LAND, /**< Land as safe as possible */
FAILSAFE_STATE_TERMINATION, /**< Disable motors and use parachute, can't be recovered */
- FAILSAFE_STATE_MAX
+ FAILSAFE_STATE_MAX,
} failsafe_state_t;
typedef enum {
- NAVIGATION_STATE_NONE = 0,
- NAVIGATION_STATE_MISSION,
- NAVIGATION_STATE_LOITER,
- NAVIGATION_STATE_RTL,
- NAVIGATION_STATE_LAND
+ NAVIGATION_STATE_MANUAL = 0,
+ NAVIGATION_STATE_ACRO,
+ NAVIGATION_STATE_ALTCTL,
+ NAVIGATION_STATE_POSCTL,
+ NAVIGATION_STATE_AUTO_MISSION,
+ NAVIGATION_STATE_AUTO_LOITER,
+ NAVIGATION_STATE_AUTO_RTL,
+ NAVIGATION_STATE_AUTO_RTL_RC,
+ NAVIGATION_STATE_AUTO_RTL_DL,
+ NAVIGATION_STATE_LAND,
+ NAVIGATION_STATE_TERMINATION,
} navigation_state_t;
enum VEHICLE_MODE_FLAG {
@@ -160,10 +169,10 @@ struct vehicle_status_s {
uint16_t counter; /**< incremented by the writing thread everytime new data is stored */
uint64_t timestamp; /**< in microseconds since system start, is set whenever the writing thread stores new data */
- main_state_t main_state; /**< main state machine */
+ main_state_t main_state; /**< main state machine */
navigation_state_t set_nav_state; /**< set navigation state machine to specified value */
arming_state_t arming_state; /**< current arming state */
- hil_state_t hil_state; /**< current hil state */
+ hil_state_t hil_state; /**< current hil state */
failsafe_state_t failsafe_state; /**< current failsafe state */
int32_t system_type; /**< system type, inspired by MAVLink's VEHICLE_TYPE enum */