navigator: reset triplets during onboard/offboard mission update

This commit is contained in:
Dennis Mannhart
2017-09-11 02:08:22 -07:00
committed by Lorenz Meier
parent c84c7cdcb4
commit 5b03c5f68e
3 changed files with 24 additions and 4 deletions
+6
View File
@@ -303,6 +303,9 @@ Mission::find_offboard_land_start()
void
Mission::update_onboard_mission()
{
/* reset triplets */
_navigator->reset_triplets();
if (orb_copy(ORB_ID(onboard_mission), _navigator->get_onboard_mission_sub(), &_onboard_mission) == OK) {
/* accept the current index set by the onboard mission if it is within bounds */
if (_onboard_mission.current_seq >= 0
@@ -350,6 +353,9 @@ Mission::update_offboard_mission()
{
bool failed = true;
/* reset triplets */
_navigator->reset_triplets();
if (orb_copy(ORB_ID(offboard_mission), _navigator->get_offboard_mission_sub(), &_offboard_mission) == OK) {
// The following is not really a warning, but it can be useful to have this message in the log file
PX4_WARN("offboard mission updated: dataman_id=%d, count=%d, current_seq=%d", _offboard_mission.dataman_id,