From e50990e644c9f67a0e01de0b42f30a9a680b659b Mon Sep 17 00:00:00 2001
From: Alejandro Lopez Gestoso <alopez@iri.upc.edu>
Date: Thu, 10 Jun 2021 13:25:20 +0200
Subject: [PATCH] Fixed a bug on waypoints anvigation. Fixed default module
 values override

---
 src/tiago_nav_bt_module.cpp |  4 ++--
 src/xml/bt_test.xml         | 32 ++++++++++++++++----------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/tiago_nav_bt_module.cpp b/src/tiago_nav_bt_module.cpp
index 68ab2bf..6fc5357 100644
--- a/src/tiago_nav_bt_module.cpp
+++ b/src/tiago_nav_bt_module.cpp
@@ -441,7 +441,7 @@ BT::NodeStatus CTiagoNavModuleBT::sync_tiago_nav_go_to_waypoints(BT::TreeNode& s
   else
   {
     continue_on_error_goal = continue_on_error.value();
-    this->tiago_nav_module.go_to_waypoint(group_goal, first_index_goal, num_goal);
+    this->tiago_nav_module.go_to_waypoint(group_goal, first_index_goal, num_goal, continue_on_error_goal);
   }
   return BT::NodeStatus::SUCCESS;
 }
@@ -478,7 +478,7 @@ BT::NodeStatus CTiagoNavModuleBT::async_tiago_nav_go_to_waypoints(BT::TreeNode&
     else
     {
       continue_on_error_goal = continue_on_error.value();
-      this->tiago_nav_module.go_to_waypoint(group_goal, first_index_goal, num_goal);
+      this->tiago_nav_module.go_to_waypoint(group_goal, first_index_goal, num_goal, continue_on_error_goal);
     }
   }
   if (this->tiago_nav_module.is_finished())
diff --git a/src/xml/bt_test.xml b/src/xml/bt_test.xml
index 1409727..7b5632e 100644
--- a/src/xml/bt_test.xml
+++ b/src/xml/bt_test.xml
@@ -56,36 +56,36 @@
             <input_port name="x"> desired X positon with respect to the goal frame</input_port>
             <input_port name="y"> desired Y positon with respect to the goal frame</input_port>
             <input_port name="yaw"> desired orientation with respect to the goal frame</input_port>
-            <input_port default="-1.0" name="heading_tol"> heading tolerance for the goal</input_port>
-            <input_port default="-1.0" name="x_y_pos_tol"> position tolerance for the goal</input_port>
+            <input_port name="heading_tol"> heading tolerance for the goal</input_port>
+            <input_port name="x_y_pos_tol"> position tolerance for the goal</input_port>
         </Action>
         <Action ID="async_tiago_nav_go_to_pose">
             <input_port name="x"> desired X positon with respect to the goal frame</input_port>
             <input_port name="y"> desired Y positon with respect to the goal frame</input_port>
             <input_port name="yaw"> desired orientation with respect to the goal frame</input_port>
-            <input_port default="-1.0" name="heading_tol"> heading tolerance for the goal</input_port>
-            <input_port default="-1.0" name="x_y_pos_tol"> position tolerance for the goal</input_port>
+            <input_port name="heading_tol"> heading tolerance for the goal</input_port>
+            <input_port name="x_y_pos_tol"> position tolerance for the goal</input_port>
             <input_port default="True" name="new_goal"> If it's a new_goal</input_port>
         </Action>
         <Action ID="sync_tiago_nav_go_to_orientation">
             <input_port name="yaw"> desired orientation with respect to the goal frame</input_port>
-            <input_port default="-1.0" name="heading_tol"> heading tolerance for the goal</input_port>
+            <input_port name="heading_tol"> heading tolerance for the goal</input_port>
         </Action>
         <Action ID="async_tiago_nav_go_to_orientation">
             <input_port name="yaw"> desired orientation with respect to the goal frame</input_port>
-            <input_port default="-1.0" name="heading_tol"> heading tolerance for the goal</input_port>
-            <input_port default="True" name="new_goal"> If it's a new_goal</input_port>
+            <input_port name="heading_tol"> heading tolerance for the goal</input_port>
+            <input_port name="new_goal"> If it's a new_goal</input_port>
         </Action>
         <Action ID="sync_tiago_nav_go_to_position">
             <input_port name="x"> desired X positon with respect to the goal frame</input_port>
             <input_port name="y"> desired Y positon with respect to the goal frame</input_port>
-            <input_port default="-1.0" name="x_y_pos_tol"> position tolerance for the goal</input_port>
+            <input_port name="x_y_pos_tol"> position tolerance for the goal</input_port>
         </Action>
         <Action ID="async_tiago_nav_go_to_position">
             <input_port name="x"> desired X positon with respect to the goal frame</input_port>
             <input_port name="y"> desired Y positon with respect to the goal frame</input_port>
-            <input_port default="-1.0" name="x_y_pos_tol"> position tolerance for the goal</input_port>
-            <input_port default="True" name="new_goal"> If it's a new_goal</input_port>
+            <input_port name="x_y_pos_tol"> position tolerance for the goal</input_port>
+            <input_port name="new_goal"> If it's a new_goal</input_port>
         </Action>
         <Action ID="sync_tiago_nav_go_to_poi">
             <input_port name="poi"> name of the desired point of interest to move to</input_port>
@@ -97,14 +97,14 @@
             <input_port name="group"> Name of the desired group of points of interest</input_port>
             <input_port name="first_index"> The index of the first waypoint to execute inside the list of interest points inside the group</input_port>
             <input_port name="num"> The number of waypoints to execute. If 0 is provided, all of them will be executed</input_port>
-            <input_port default="False" name="continue_on_error"> Whether to contiune on the next waypoint when the current one can not be reached (true) or not (false). By default it is set to not continue</input_port>
+            <input_port name="continue_on_error"> Whether to contiune on the next waypoint when the current one can not be reached (true) or not (false). By default it is set to not continue</input_port>
         </Action>
         <Action ID="async_tiago_nav_go_to_waypoints">
             <input_port name="group"> Name of the desired group of points of interest</input_port>
             <input_port name="first_index"> The index of the first waypoint to execute inside the list of interest points inside the group</input_port>
             <input_port name="num"> The number of waypoints to execute. If 0 is provided, all of them will be executed</input_port>
-            <input_port default="False" name="continue_on_error"> Whether to contiune on the next waypoint when the current one can not be reached (true) or not (false). By default it is set to not continue</input_port>
-            <input_port default="True" name="new_goal"> If it's a new_goal</input_port>
+            <input_port name="continue_on_error"> Whether to contiune on the next waypoint when the current one can not be reached (true) or not (false). By default it is set to not continue</input_port>
+            <input_port name="new_goal"> If it's a new_goal</input_port>
         </Action>
         <Action ID="get_tiago_nav_current_waypoint">
             <output_port name="waypoint"> The index of the current waypoint being executed</output_port>
@@ -163,9 +163,9 @@
             <output_port name="x"> desired X positon with respect to the goal frame</output_port>
             <output_port name="y"> desired Y positon with respect to the goal frame</output_port>
             <output_port name="yaw"> desired orientation with respect to the goal frame</output_port>
-            <output_port default="-1.0" name="heading_tol"> heading tolerance for the goal</output_port>
-            <output_port default="-1.0" name="x_y_pos_tol"> position tolerance for the goal</output_port>
-            <output_port default="True" name="new_goal"> If it's a new_goal</output_port>
+            <output_port name="heading_tol"> heading tolerance for the goal</output_port>
+            <output_port name="x_y_pos_tol"> position tolerance for the goal</output_port>
+            <output_port name="new_goal"> If it's a new_goal</output_port>
         </Action>
         <Action ID="set_tiago_nav_goal_frame_inputs">
             <output_port name="frame_id"> The name of the new reference frame for the future goals</output_port>
-- 
GitLab