From 39eeae4a1bd9b69f047b8eb3df0a0291fffac13d Mon Sep 17 00:00:00 2001 From: Sebastian Jahr Date: Fri, 6 Oct 2023 18:04:25 +0200 Subject: [PATCH] set a non-infinite default timeout in CurrentState stage (#491) Co-authored-by: Mario Prats --- core/src/stages/current_state.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/stages/current_state.cpp b/core/src/stages/current_state.cpp index ca48fb1b6..f03b37adb 100644 --- a/core/src/stages/current_state.cpp +++ b/core/src/stages/current_state.cpp @@ -35,6 +35,8 @@ /* Authors: Michael Goerner, Luca Lach, Robert Haschke */ +#include + #include #include #include @@ -47,13 +49,16 @@ namespace moveit { namespace task_constructor { namespace stages { +using namespace std::chrono_literals; +constexpr std::chrono::duration DEFAULT_TIMEOUT = 3s; + static const rclcpp::Logger LOGGER = rclcpp::get_logger("CurrentState"); CurrentState::CurrentState(const std::string& name) : Generator(name) { auto& p = properties(); Property& timeout = p.property("timeout"); timeout.setDescription("max time to wait for get_planning_scene service"); - timeout.setValue(-1.0); + timeout.setValue(DEFAULT_TIMEOUT.count()); } void CurrentState::init(const moveit::core::RobotModelConstPtr& robot_model) {