Skip to content

Commit

Permalink
Merge branch 'add/node_stopped_message' of https://github.com/nobleo/…
Browse files Browse the repository at this point in the history
…rosmon into add/node_stopped_message
  • Loading branch information
MCFurry committed Jul 7, 2021
2 parents ac6e1de + e325a80 commit 181f7c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rosmon_core/src/diagnostics_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,16 @@ void DiagnosticsPublisher::publish(const std::vector<NodeMonitor::Ptr>& state)
}
else
{
if (nodeState->state() == NodeMonitor::STATE_IDLE)
{
msg = "node idle ";
}

if(nodeState->numRespawnsAllowed() >= 0 &&
nodeState->restartCount() > static_cast<unsigned int>(nodeState->numRespawnsAllowed()))
{
nodeStatus.level = diagnostic_msgs::DiagnosticStatus::WARN;
msg = "restart count > " + std::to_string(nodeState->numRespawnsAllowed()) +
msg += "restart count > " + std::to_string(nodeState->numRespawnsAllowed()) +
"! (" + std::to_string(nodeState->restartCount()) + ")";
}

Expand Down

0 comments on commit 181f7c1

Please sign in to comment.