aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commander/state_machine_helper.cpp
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2013-08-18 23:05:26 +0200
committerAnton Babushkin <anton.babushkin@me.com>2013-08-18 23:05:26 +0200
commitffc2a8b7a358a2003e5ed548c41878b33e7aa726 (patch)
tree73a2af534135aa4d3ac0c62b202d85dadd0bd981 /src/modules/commander/state_machine_helper.cpp
parent2be5240b9f70803417c9648133490409ba40ba55 (diff)
downloadpx4-firmware-ffc2a8b7a358a2003e5ed548c41878b33e7aa726.tar.gz
px4-firmware-ffc2a8b7a358a2003e5ed548c41878b33e7aa726.tar.bz2
px4-firmware-ffc2a8b7a358a2003e5ed548c41878b33e7aa726.zip
vehicle_local_position topic updated, position_estimator_inav and commander fixes, only altitude estimate required for SETBELT now.
Diffstat (limited to 'src/modules/commander/state_machine_helper.cpp')
-rw-r--r--src/modules/commander/state_machine_helper.cpp27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp
index f313adce4..76c7eaf92 100644
--- a/src/modules/commander/state_machine_helper.cpp
+++ b/src/modules/commander/state_machine_helper.cpp
@@ -217,9 +217,8 @@ main_state_transition(struct vehicle_status_s *current_state, main_state_t new_m
case MAIN_STATE_SEATBELT:
- /* need position estimate */
- // TODO only need altitude estimate really
- if (current_state->condition_local_position_valid) {
+ /* need altitude estimate */
+ if (current_state->condition_local_altitude_valid) {
ret = TRANSITION_CHANGED;
}
@@ -227,7 +226,7 @@ main_state_transition(struct vehicle_status_s *current_state, main_state_t new_m
case MAIN_STATE_EASY:
- /* need position estimate */
+ /* need local position estimate */
if (current_state->condition_local_position_valid) {
ret = TRANSITION_CHANGED;
}
@@ -236,8 +235,8 @@ main_state_transition(struct vehicle_status_s *current_state, main_state_t new_m
case MAIN_STATE_AUTO:
- /* need position estimate */
- if (current_state->condition_local_position_valid) {
+ /* need global position estimate */
+ if (current_state->condition_global_position_valid) {
ret = TRANSITION_CHANGED;
}
@@ -277,17 +276,6 @@ navigation_state_transition(struct vehicle_status_s *current_status, navigation_
} else {
switch (new_navigation_state) {
- case NAVIGATION_STATE_STANDBY:
- ret = TRANSITION_CHANGED;
- control_mode->flag_control_rates_enabled = false;
- control_mode->flag_control_attitude_enabled = false;
- control_mode->flag_control_velocity_enabled = false;
- control_mode->flag_control_position_enabled = false;
- control_mode->flag_control_altitude_enabled = false;
- control_mode->flag_control_climb_rate_enabled = false;
- control_mode->flag_control_manual_enabled = false;
- break;
-
case NAVIGATION_STATE_DIRECT:
ret = TRANSITION_CHANGED;
control_mode->flag_control_rates_enabled = true;
@@ -394,9 +382,8 @@ navigation_state_transition(struct vehicle_status_s *current_status, navigation_
case NAVIGATION_STATE_AUTO_LAND:
- /* deny transitions from landed states */
- if (current_status->navigation_state != NAVIGATION_STATE_STANDBY &&
- current_status->navigation_state != NAVIGATION_STATE_AUTO_READY) {
+ /* deny transitions from landed state */
+ if (current_status->navigation_state != NAVIGATION_STATE_AUTO_READY) {
ret = TRANSITION_CHANGED;
control_mode->flag_control_rates_enabled = true;
control_mode->flag_control_attitude_enabled = true;