From be6c24e61003b74a3f33bcffecaab2ca1d6ead94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Enrique=20Dom=C3=ADnguez?=
 <jdominguez@iri.upc.edu>
Date: Fri, 24 Apr 2020 13:08:51 +0200
Subject: [PATCH] path_distance forced to 0.0 if path_length<=0

---
 src/iri_ana_nav_module_bt.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/iri_ana_nav_module_bt.cpp b/src/iri_ana_nav_module_bt.cpp
index 1f47c6e..997ea99 100644
--- a/src/iri_ana_nav_module_bt.cpp
+++ b/src/iri_ana_nav_module_bt.cpp
@@ -461,7 +461,8 @@ BT::NodeStatus CIriAnaNavModuleBT::get_current_path_distance(BT::TreeNode& self)
   }
   else {
     ROS_WARN("CIriAnaNavModuleBT:get_current_path_distance Path with length <= 0");
-    self.setOutput("path_distance", 0.0);
+    double path_distance = 0.0;
+    self.setOutput("path_distance", path_distance);
   }
   return BT::NodeStatus::SUCCESS;
 }
-- 
GitLab