diff options
author | Ban Siesta <bansiesta@gmail.com> | 2014-12-19 23:38:10 +0000 |
---|---|---|
committer | Ban Siesta <bansiesta@gmail.com> | 2014-12-19 23:38:10 +0000 |
commit | 7cb4786e7934af50b5ceb370c593e27111d9dd17 (patch) | |
tree | c6d77d9b29fddb5591c68b3c50f29e98fd0b2924 | |
parent | f0ff914b626fbfb497143f80b19376efb524b9e1 (diff) | |
download | px4-firmware-7cb4786e7934af50b5ceb370c593e27111d9dd17.tar.gz px4-firmware-7cb4786e7934af50b5ceb370c593e27111d9dd17.tar.bz2 px4-firmware-7cb4786e7934af50b5ceb370c593e27111d9dd17.zip |
navigator: report when a waypoint has been reached not when the whole mission is finished
-rw-r--r-- | src/modules/navigator/mission.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/modules/navigator/mission.cpp b/src/modules/navigator/mission.cpp index 8de8faf9d..3f0a6bb51 100644 --- a/src/modules/navigator/mission.cpp +++ b/src/modules/navigator/mission.cpp @@ -38,6 +38,7 @@ * @author Julian Oes <julian@oes.ch> * @author Thomas Gubler <thomasgubler@gmail.com> * @author Anton Babushkin <anton.babushkin@me.com> + * @author Ban Siesta <bansiesta@gmail.com> */ #include <sys/types.h> @@ -149,18 +150,12 @@ Mission::on_active() /* lets check if we reached the current mission item */ if (_mission_type != MISSION_TYPE_NONE && is_mission_item_reached()) { + set_mission_item_reached(); if (_mission_item.autocontinue) { /* switch to next waypoint if 'autocontinue' flag set */ advance_mission(); set_mission_items(); - } else { - /* else just report that item reached */ - if (_mission_type == MISSION_TYPE_OFFBOARD) { - if (!(_navigator->get_mission_result()->seq_reached == _current_offboard_mission_index && _navigator->get_mission_result()->reached)) { - set_mission_item_reached(); - } - } } } else if (_mission_type != MISSION_TYPE_NONE &&_param_altmode.get() == MISSION_ALTMODE_FOH) { @@ -395,7 +390,6 @@ Mission::set_mission_items() /* reuse setpoint for LOITER only if it's not IDLE */ _navigator->set_can_loiter_at_sp(pos_sp_triplet->current.type == SETPOINT_TYPE_LOITER); - reset_mission_item_reached(); set_mission_finished(); _navigator->set_position_setpoint_triplet_updated(); |