diff --git a/src/safe_cmd_alg_node.cpp b/src/safe_cmd_alg_node.cpp index 407e125a757bd1c58759d83a6f31eecfcf9054b4..babd0f65e5d6e6980ac60b4519a02cdce4a33e3d 100644 --- a/src/safe_cmd_alg_node.cpp +++ b/src/safe_cmd_alg_node.cpp @@ -30,6 +30,8 @@ SafeCmdAlgNode::SafeCmdAlgNode(void) : // [init action servers] // [init action clients] + this->reset_front_laser_watchdog(); + this->reset_rear_laser_watchdog(); } SafeCmdAlgNode::~SafeCmdAlgNode(void) @@ -45,15 +47,18 @@ void SafeCmdAlgNode::mainNodeThread(void) { this->update_front_laser_watchdog(); this->update_rear_laser_watchdog(); - if(this->front_laser_watchdog_active()) - { - ROS_ERROR_THROTTLE(1,"SafeCmdAlgNode::mainNodeThread: Front laser watchdog timeout!"); - Twist_msg_.linear.x = 0.0; - } - else if(this->rear_laser_watchdog_active()) + if(this->front_laser_watchdog_active() || this->rear_laser_watchdog_active()) { - ROS_ERROR_THROTTLE(1,"SafeCmdAlgNode::mainNodeThread: Rear laser watchdog timeout!"); - Twist_msg_.linear.x = 0.0; + if(this->front_laser_watchdog_active()) + { + ROS_ERROR_DELAYED_THROTTLE(5,"SafeCmdAlgNode::mainNodeThread: Front laser watchdog timeout!"); + Twist_msg_.linear.x = 0.0; + } + if(this->rear_laser_watchdog_active()) + { + ROS_ERROR_DELAYED_THROTTLE(5,"SafeCmdAlgNode::mainNodeThread: Rear laser watchdog timeout!"); + Twist_msg_.linear.x = 0.0; + } } else {