Skip to content
Snippets Groups Projects
Commit 06fc4f52 authored by Simon Ottenhaus's avatar Simon Ottenhaus
Browse files

minimum report interval

parent b6dc3412
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ void RobotHealth::onInitComponent()
defaultMaximumCycleTimeErr = getProperty<int>("MaximumCycleTimeErrMS").getValue();
usingTopic(getProperty<std::string>("RobotHealthTopicName").getValue());
reportErrorsWithSpeech = getProperty<bool>("ReportErrorsWithSpeech").getValue();
speechMinimumReportInterval = getProperty<int>("SpeechMinimumReportInterval").getValue();
//robotUnitRequired = getProperty<bool>("RobotUnitRequired").getValue();
/*if(robotUnitRequired)
......@@ -88,8 +89,9 @@ void RobotHealth::monitorHealthTaskClb()
if (e.isRunning)
{
ARMARX_ERROR << deactivateSpam(0.1, e.name) << "Component " << e.name << " has died.";
if (reportErrorsWithSpeech)
if (reportErrorsWithSpeech && (TimeUtil::GetTime() - lastSpeechOutput).toSecondsDouble() > speechMinimumReportInterval)
{
lastSpeechOutput = TimeUtil::GetTime();
textToSpeechTopic->reportText("Oh no! Component " + e.name + " is no longer running.");
}
hasNewErr = true;
......
......@@ -54,6 +54,8 @@ namespace armarx
defineOptionalProperty<std::string>("AggregatedRobotHealthTopicName", "AggregatedRobotHealthTopic", "Name of the AggregatedRobotHealthTopic");
defineOptionalProperty<std::string>("RequiredComponents", "", "Comma separated list of required components");
defineOptionalProperty<int>("SpeechMinimumReportInterval", 60, "Time that has to pass between reported messages in seconds.");
//defineOptionalProperty<std::string>("RemoteGuiName", "RemoteGuiProvider", "Name of the remote GUI provider");
//defineOptionalProperty<std::string>("RobotUnitName", "Armar6Unit", "Name of the RobotUnit");
//defineOptionalProperty<bool>("RobotUnitRequired", true, "Wait for RobotUnit");
......@@ -150,6 +152,8 @@ namespace armarx
AggregatedRobotHealthInterfacePrx aggregatedRobotHealthTopicPrx;
TextListenerInterfacePrx textToSpeechTopic;
bool reportErrorsWithSpeech;
int speechMinimumReportInterval;
IceUtil::Time lastSpeechOutput;
// RobotHealthInterface interface
public:
......
......@@ -68,6 +68,9 @@ void GuiHealthClientWidgetController::onInitComponent()
void GuiHealthClientWidgetController::healthTimerClb()
{
RobotHealthHeartbeatArgs rhha;
rhha.maximumCycleTimeWarningMS = 250;
rhha.maximumCycleTimeErrorMS = 500;
robotHealthTopicPrx->heartbeat(getName(), RobotHealthHeartbeatArgs());
}
void GuiHealthClientWidgetController::updateSummaryTimerClb()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment