diff --git a/source/RobotAPI/components/RobotHealth/RobotHealth.cpp b/source/RobotAPI/components/RobotHealth/RobotHealth.cpp index 0d6d8ce5d6f1f333254c254215ea8a006ad9edbd..0d001ba473a11e5dc345876041bf3067879c08be 100644 --- a/source/RobotAPI/components/RobotHealth/RobotHealth.cpp +++ b/source/RobotAPI/components/RobotHealth/RobotHealth.cpp @@ -50,6 +50,7 @@ void RobotHealth::onConnectComponent() emergencyStopTopicPrx = getTopic<EmergencyStopListenerPrx>(getProperty<std::string>("EmergencyStopTopicName").getValue()); //remoteGuiPrx = getProxy<RemoteGuiInterfacePrx>(getProperty<std::string>("RemoteGuiName").getValue()); aggregatedRobotHealthTopicPrx = getTopic<AggregatedRobotHealthInterfacePrx>(getProperty<std::string>("AggregatedRobotHealthTopicName").getValue()); + textToSpeechTopic = getTopic<TextListenerInterfacePrx>(getProperty<std::string>("TextToSpeechTopicName").getValue()); /*if(robotUnitRequired) { @@ -86,6 +87,7 @@ void RobotHealth::monitorHealthTaskClb() if (e.isRunning) { ARMARX_ERROR << deactivateSpam(0.1, e.name) << "Component " << e.name << " has died."; + textToSpeechTopic->reportText("Oh no! Component " + e.name + " is no longer running."); hasNewErr = true; e.isRunning = false; } diff --git a/source/RobotAPI/components/RobotHealth/RobotHealth.h b/source/RobotAPI/components/RobotHealth/RobotHealth.h index cbf7381b5b8980332afe101e1a5a1a3bfa2de45d..989d6170b0349baf1f21e41b00d70a09522b138d 100644 --- a/source/RobotAPI/components/RobotHealth/RobotHealth.h +++ b/source/RobotAPI/components/RobotHealth/RobotHealth.h @@ -30,6 +30,7 @@ #include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h> #include <atomic> #include <ArmarXGui/interface/RemoteGuiInterface.h> +#include <RobotAPI/interface/speech/SpeechInterface.h> namespace armarx { @@ -46,6 +47,7 @@ namespace armarx { defineOptionalProperty<std::string>("EmergencyStopTopicName", "EmergencyStop", "The name of the topic over which changes of the emergencyStopState are sent."); defineOptionalProperty<std::string>("RobotHealthTopicName", "RobotHealthTopic", "Name of the RobotHealth topic"); + defineOptionalProperty<std::string>("TextToSpeechTopicName", "TextToSpeech", "Name of the TextToSpeech topic"); defineOptionalProperty<int>("MaximumCycleTimeWarnMS", 50, "Default value of the maximum cycle time for warnings"); defineOptionalProperty<int>("MaximumCycleTimeErrMS", 100, "Default value of the maximum cycle time for error"); defineOptionalProperty<std::string>("AggregatedRobotHealthTopicName", "AggregatedRobotHealthTopic", "Name of the AggregatedRobotHealthTopic"); @@ -145,6 +147,7 @@ namespace armarx //bool robotUnitRequired; RemoteGuiInterfacePrx remoteGuiPrx; AggregatedRobotHealthInterfacePrx aggregatedRobotHealthTopicPrx; + TextListenerInterfacePrx textToSpeechTopic; // RobotHealthInterface interface public: