Skip to content

Commit 23ea599

Browse files
committed
recover on diagnostics when stopped
1 parent 29442b7 commit 23ea599

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cob_base_controller_utils/src/halt_detector.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ bool containsSubstring(std::string string, std::string substring) {
129129
/**
130130
* Callback for diagnostic aggregation.
131131
*
132-
* Recovers on diagnostic errors if currently not stopped or stuck.
132+
* Recovers on diagnostic errors if currently not stuck.
133133
*
134134
* @param msg DiagnosticArray message.
135135
*/
@@ -152,10 +152,12 @@ void diagnosticsAggCallback(const diagnostic_msgs::DiagnosticArray::ConstPtr& ms
152152
error = true;
153153
}
154154
}
155-
if (error && !g_is_stuck && !g_is_stopped && ros::Time::now() - g_last_diagnostic_recover_timestamp >= ros::Duration(2.0)) {
155+
if (error && !g_is_stuck && ros::Time::now() - g_last_diagnostic_recover_timestamp >= ros::Duration(2.0)) {
156156
ROS_INFO("Recovering from diagnostic error");
157+
g_stop_timer.stop();
157158
recover();
158159
g_last_diagnostic_recover_timestamp = ros::Time::now();
160+
g_stop_timer.start();
159161
}
160162
}
161163
}

0 commit comments

Comments
 (0)