From ea92736fb853f3efa4d30121f63c553a720b4dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mart=C3=ADn=20Rico?= Date: Sun, 4 Jul 2021 09:06:42 +0000 Subject: [PATCH 1/2] Solve statically parameter error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Francisco Martín Rico --- plansys2_executor/test/unit/executor_test.cpp | 2 +- plansys2_planner/include/plansys2_planner/PlannerNode.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plansys2_executor/test/unit/executor_test.cpp b/plansys2_executor/test/unit/executor_test.cpp index bc87df69d..054685a39 100644 --- a/plansys2_executor/test/unit/executor_test.cpp +++ b/plansys2_executor/test/unit/executor_test.cpp @@ -1565,7 +1565,7 @@ TEST(problem_expert, action_timeout) pkgpath + "/test_behavior_trees/test_action_timeout_bt.xml"}); executor_node->set_parameter({"action_timeouts.actions", std::vector({"move"})}); // have to declare because the actions vector above was not available at node creation - executor_node->declare_parameter("action_timeouts.move.duration_overrun_percentage"); + executor_node->declare_parameter("action_timeouts.move.duration_overrun_percentage"); executor_node->set_parameter({"action_timeouts.move.duration_overrun_percentage", 1.0}); rclcpp::executors::MultiThreadedExecutor exe(rclcpp::ExecutorOptions(), 8); diff --git a/plansys2_planner/include/plansys2_planner/PlannerNode.hpp b/plansys2_planner/include/plansys2_planner/PlannerNode.hpp index 3f33ada24..a87326ec3 100644 --- a/plansys2_planner/include/plansys2_planner/PlannerNode.hpp +++ b/plansys2_planner/include/plansys2_planner/PlannerNode.hpp @@ -91,7 +91,7 @@ std::string get_plugin_type_param( NodeT node, const std::string & plugin_name) { - declare_parameter_if_not_declared(node, plugin_name + ".plugin"); + declare_parameter_if_not_declared(node, plugin_name + ".plugin", rclcpp::ParameterValue("")); std::string plugin_type; if (!node->get_parameter(plugin_name + ".plugin", plugin_type)) { RCLCPP_FATAL(node->get_logger(), "'plugin' param not defined for %s", plugin_name.c_str()); From a4db80beb01b6e6b03bf71fe58264d41b115afc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mart=C3=ADn=20Rico?= Date: Sun, 4 Jul 2021 09:12:34 +0000 Subject: [PATCH 2/2] Fix default param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Francisco Martín Rico --- plansys2_executor/test/unit/executor_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plansys2_executor/test/unit/executor_test.cpp b/plansys2_executor/test/unit/executor_test.cpp index 054685a39..663759312 100644 --- a/plansys2_executor/test/unit/executor_test.cpp +++ b/plansys2_executor/test/unit/executor_test.cpp @@ -1565,7 +1565,8 @@ TEST(problem_expert, action_timeout) pkgpath + "/test_behavior_trees/test_action_timeout_bt.xml"}); executor_node->set_parameter({"action_timeouts.actions", std::vector({"move"})}); // have to declare because the actions vector above was not available at node creation - executor_node->declare_parameter("action_timeouts.move.duration_overrun_percentage"); + executor_node->declare_parameter( + "action_timeouts.move.duration_overrun_percentage", 1.0); executor_node->set_parameter({"action_timeouts.move.duration_overrun_percentage", 1.0}); rclcpp::executors::MultiThreadedExecutor exe(rclcpp::ExecutorOptions(), 8);