commander: failsafe_state removed, replaced with bool failsafe, navigation state and failsafe determined directly from main state and conditions

This commit is contained in:
Anton Babushkin
2014-06-16 17:34:21 +02:00
parent 91f0b9eee4
commit e0ed0625f8
9 changed files with 122 additions and 115 deletions
+1 -3
View File
@@ -118,7 +118,7 @@ void get_mavlink_mode_state(struct vehicle_status_s *status, struct position_set
union px4_custom_mode custom_mode;
custom_mode.data = 0;
switch (status->set_nav_state) {
switch (status->nav_state) {
case NAVIGATION_STATE_MANUAL:
*mavlink_base_mode |= MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
@@ -161,8 +161,6 @@ void get_mavlink_mode_state(struct vehicle_status_s *status, struct position_set
break;
case NAVIGATION_STATE_AUTO_RTL:
case NAVIGATION_STATE_AUTO_FAILSAFE_RC_LOSS:
case NAVIGATION_STATE_AUTO_FAILSAFE_DL_LOSS:
*mavlink_base_mode |= MAV_MODE_FLAG_AUTO_ENABLED
| MAV_MODE_FLAG_STABILIZE_ENABLED
| MAV_MODE_FLAG_GUIDED_ENABLED;