diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-19 19:04:10 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-19 19:04:10 +0200 |
commit | 1e96633907f46bffeefbb6c3c913266e667d5a13 (patch) | |
tree | a2157847c2bf78d282bffc64767fa128629364b4 /src/modules/commander/commander.cpp | |
parent | 7bd952c7acf7bc1c588a123d395930525be1349c (diff) | |
parent | 69a183e221a6ae2fc1f9677b0193d11e43d46d72 (diff) | |
download | px4-firmware-1e96633907f46bffeefbb6c3c913266e667d5a13.tar.gz px4-firmware-1e96633907f46bffeefbb6c3c913266e667d5a13.tar.bz2 px4-firmware-1e96633907f46bffeefbb6c3c913266e667d5a13.zip |
Merged seatbelt_multirotor_new / master
Diffstat (limited to 'src/modules/commander/commander.cpp')
-rw-r--r-- | src/modules/commander/commander.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 98aab8788..d2455794a 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -399,16 +399,21 @@ void handle_command(struct vehicle_status_s *status, const struct safety_s *safe } case VEHICLE_CMD_NAV_TAKEOFF: { - transition_result_t nav_res = navigation_state_transition(status, NAVIGATION_STATE_AUTO_TAKEOFF, control_mode); + if (armed->armed) { + transition_result_t nav_res = navigation_state_transition(status, NAVIGATION_STATE_AUTO_TAKEOFF, control_mode); - if (nav_res == TRANSITION_CHANGED) { - mavlink_log_info(mavlink_fd, "[cmd] TAKEOFF on command"); - } + if (nav_res == TRANSITION_CHANGED) { + mavlink_log_info(mavlink_fd, "[cmd] TAKEOFF on command"); + } - if (nav_res != TRANSITION_DENIED) { - result = VEHICLE_CMD_RESULT_ACCEPTED; + if (nav_res != TRANSITION_DENIED) { + result = VEHICLE_CMD_RESULT_ACCEPTED; + } else { + result = VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED; + } } else { + /* reject TAKEOFF not armed */ result = VEHICLE_CMD_RESULT_TEMPORARILY_REJECTED; } |