diff --git a/CMakeLists.txt b/CMakeLists.txt index 72267f2873a73070798ffa4c7fafb375da3005c8..adca6f34965e49ca4bfa23a8fe344eb6ef3597a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ catkin_python_setup() catkin_package( INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS roscpp + CATKIN_DEPENDS roscpp rospy ) ########### diff --git a/include/iri_ros_tools/module_action.h b/include/iri_ros_tools/module_action.h index 4397ff5badaa41d44d29df588c5e04b520c4131a..e968d46707a5219c9da06c7db71dd2009287f2f9 100644 --- a/include/iri_ros_tools/module_action.h +++ b/include/iri_ros_tools/module_action.h @@ -602,12 +602,11 @@ void CModuleAction<action_ros,dyn_reconf_config>::dynamic_reconfigure(dyn_reconf boost::any value; params=dyn_reconf_config::__getParamDescriptions__(); - for(typename std::vector<typename dyn_reconf_config::AbstractParamDescriptionConstPtr>::iterator param=params.begin();param!=params.end();param++) { + (*param)->getValue(config,value); if((*param)->name==(name+"_num_retries")) { - (*param)->getValue(config,value); if(value.type()==typeid(int)) this->set_max_num_retries(boost::any_cast<int &>(value)); } @@ -621,15 +620,13 @@ void CModuleAction<action_ros,dyn_reconf_config>::dynamic_reconfigure(dyn_reconf enable_timeout=false; } } - if((*param)->name==(name+"_timeout_s")) + else if((*param)->name==(name+"_timeout_s")) { - (*param)->getValue(config,value); if(value.type()==typeid(double)) timeout=boost::any_cast<double &>(value); } - if((*param)->name==(name+"_feedback_watchdog_time_s")) + else if((*param)->name==(name+"_feedback_watchdog_time_s")) { - (*param)->getValue(config,value); if(value.type()==typeid(double)) watchdog=boost::any_cast<double &>(value); } @@ -660,6 +657,8 @@ void CModuleAction<action_ros,dyn_reconf_config>::dynamic_reconfigure(dyn_reconf this->disable_timeout(); if(enable_watchdog) this->enable_watchdog(watchdog); + else + this->disable_watchdog(); } @@ -740,7 +739,10 @@ bool CModuleAction<action_ros,dyn_reconf_config>::is_watchdog_active(void) } } else + { + this->action_access.exit(); return false; + } } template<class action_ros,class dyn_reconf_config> diff --git a/package.xml b/package.xml index cf2f79436058d0879e2a619cf7c98c5225543671..dfc607c3376927d4bed49e916c242b0a6d1a1dc7 100644 --- a/package.xml +++ b/package.xml @@ -14,6 +14,7 @@ <buildtool_depend>catkin</buildtool_depend> <depend>roscpp</depend> + <depend>rospy</depend> <!-- The export tag contains other, unspecified, tags --> <export> diff --git a/src/iri_ros_tools/dyn_params.py b/src/iri_ros_tools/dyn_params.py index 93ce21b585a6c0fd4db67ed29baaa19642e46822..bf54e48a5e760daea1eda12ec56043ed0f610b8b 100644 --- a/src/iri_ros_tools/dyn_params.py +++ b/src/iri_ros_tools/dyn_params.py @@ -14,9 +14,9 @@ def add_module_action_params(gen,name): new_group.add(name+"_num_retries", int_t, 0,"Number of times an action will be called before reporting an error",1, 1, 10) new_group.add(name+"_enable_timeout", bool_t, 0,"Enable or disable the timeout feature", True) - new_group.add(name+"_timeout_s", double_t,0,"Maximum time in second to wait for the action to complete", 10.0, 1.0, 600.0) - new_group.add(name+"_enable_iwatchdog", bool_t, 0,"Enable or disable the watchdog feature", True) - new_group.add(name+"_feedback_watchdog_time_s",double_t,0,"Maximum time in second between two consecutive feedback topics", 2.0, 1.0, 100.0) + new_group.add(name+"_timeout_s", double_t,0,"Maximum time in second to wait for the action to complete", 10.0, 0.1, 600.0) + new_group.add(name+"_enable_watchdog", bool_t, 0,"Enable or disable the watchdog feature", True) + new_group.add(name+"_feedback_watchdog_time_s",double_t,0,"Maximum time in second between two consecutive feedback topics", 2.0, 0.1, 100.0) new_group.add(name+"_enabled", bool_t, 0,"Enable or disable the actual action request", True) return new_group