diff options
author | Julian Oes <julian@oes.ch> | 2014-04-21 17:36:59 +0200 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2014-04-21 17:36:59 +0200 |
commit | c3c0328e8bb9211580dbe5a52ecb23e0452cb402 (patch) | |
tree | 0c449cb2733f3c6cbfc5593e38929fea34152c11 /src/modules/mavlink/mavlink_messages.cpp | |
parent | 488785250f4f1fa3c2f6d1e3283fd8eabb6b3144 (diff) | |
download | px4-firmware-c3c0328e8bb9211580dbe5a52ecb23e0452cb402.tar.gz px4-firmware-c3c0328e8bb9211580dbe5a52ecb23e0452cb402.tar.bz2 px4-firmware-c3c0328e8bb9211580dbe5a52ecb23e0452cb402.zip |
navigator: lot's of cleanup (WIP)
Diffstat (limited to 'src/modules/mavlink/mavlink_messages.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_messages.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/mavlink/mavlink_messages.cpp b/src/modules/mavlink/mavlink_messages.cpp index 648228e3b..3cf69bf7c 100644 --- a/src/modules/mavlink/mavlink_messages.cpp +++ b/src/modules/mavlink/mavlink_messages.cpp @@ -117,7 +117,8 @@ void get_mavlink_mode_state(struct vehicle_status_s *status, struct position_set union px4_custom_mode custom_mode; custom_mode.data = 0; - if (pos_sp_triplet->nav_state == NAV_STATE_NONE) { + if (pos_sp_triplet->nav_state == NAV_STATE_NONE_ON_GROUND + || pos_sp_triplet->nav_state == NAV_STATE_NONE_IN_AIR) { /* use main state when navigator is not active */ if (status->main_state == MAIN_STATE_MANUAL) { *mavlink_base_mode |= MAV_MODE_FLAG_MANUAL_INPUT_ENABLED | (status->is_rotary_wing ? MAV_MODE_FLAG_STABILIZE_ENABLED : 0); @@ -142,7 +143,7 @@ void get_mavlink_mode_state(struct vehicle_status_s *status, struct position_set *mavlink_base_mode |= MAV_MODE_FLAG_AUTO_ENABLED | MAV_MODE_FLAG_STABILIZE_ENABLED | MAV_MODE_FLAG_GUIDED_ENABLED; custom_mode.main_mode = PX4_CUSTOM_MAIN_MODE_AUTO; - if (pos_sp_triplet->nav_state == NAV_STATE_READY) { + if (pos_sp_triplet->nav_state == NAV_STATE_AUTO_ON_GROUND) { custom_mode.sub_mode = PX4_CUSTOM_SUB_MODE_AUTO_READY; } else if (pos_sp_triplet->nav_state == NAV_STATE_LOITER) { |