8#include <RobotAPI/interface/components/RobotHealthInterface.h>
15 const std::vector<std::string>& tags,
16 const std::string& description)
18 RobotHealthHeartbeatArgs argsCopy = defaultHeartbeatArgs;
19 argsCopy.description = description;
20 argsCopy.identifier = identifier;
29 const std::vector<std::string>& tags,
30 const std::string& description)
32 RobotHealthHeartbeatArgs argsCopy = defaultHeartbeatArgs;
33 argsCopy.description = description;
35 argsCopy.identifier = identifier;
36 toIce(argsCopy.maximumCycleTimeWarning, warning);
37 toIce(argsCopy.maximumCycleTimeError, error);
46 const std::vector<std::string>& tags,
47 const std::string& description)
49 RobotHealthHeartbeatArgs argsCopy = defaultHeartbeatArgs;
50 argsCopy.description = description;
52 toIce(argsCopy.maximumCycleTimeWarning, warning);
53 toIce(argsCopy.maximumCycleTimeError, error);
64 if (args.identifier.empty())
66 RobotHealthHeartbeatArgs argsCopy = args;
68 robotHealthComponentPrx->signUp(argsCopy);
73 RobotHealthHeartbeatArgs argsCopy = args;
74 argsCopy.identifier =
parent().
getName() +
"_" + argsCopy.identifier;
75 robotHealthComponentPrx->signUp(argsCopy);
82 if (robotHealthComponentPrx)
84 armarx::core::time::dto::DateTime now;
86 robotHealthComponentPrx->heartbeat(
parent().getName(), now);
97 if (robotHealthComponentPrx)
99 armarx::core::time::dto::DateTime now;
101 robotHealthComponentPrx->heartbeat(
parent().getName() +
"_" + channelName, now);
142 properties->component(robotHealthComponentPrx,
145 "Name of the robot health component.");
148 if (not properties->hasDefinition(
makePropertyName(maximumCycleTimeWarningMSPropertyName)))
150 properties->optional(p.maximumCycleTimeWarningMS,
151 maximumCycleTimeWarningMSPropertyName,
152 "maximum cycle time before warning is emitted");
155 if (not properties->hasDefinition(
makePropertyName(maximumCycleTimeErrorMSPropertyName)))
157 properties->optional(p.maximumCycleTimeErrorMS,
158 maximumCycleTimeErrorMSPropertyName,
159 "maximum cycle time before error is emitted");
ManagedIceObject & parent()
std::string makePropertyName(const std::string &name)
std::string getName() const
Retrieve name of object.
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
void postOnInitComponent() override
void preOnInitComponent() override
void postOnConnectComponent() override
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
void signUp(const std::string &channelName="", const std::vector< std::string > &aliases={}, const std::string &description="")
register component to heartbeat
void heartbeatOnChannel(const std::string &channelName)
Sends out a heartbeat for a subchannel.
void heartbeat()
Sends out a heartbeat using the default config.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
void toIce(dto::ClockType::ClockTypeEnum &dto, const ClockType &bo)
This file is part of ArmarX.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void toIce(std::map< IceKeyT, IceValueT > &iceMap, const boost::container::flat_map< CppKeyT, CppValueT > &cppMap)