Skip to content
Snippets Groups Projects
Commit f58b1b4a authored by Fabian Reister's avatar Fabian Reister
Browse files

Merge branch 'feature/robot-health-to-debug-observer' into 'master'

RobotHealth: reporting data as debug observer datafield (FR)

See merge request ArmarX/RobotAPI!247
parents 9d6173fd 891680ab
No related branches found
No related tags found
1 merge request!247RobotHealth: reporting data as debug observer datafield (FR)
armarx_component_set_name("RobotHealth") armarx_component_set_name("RobotHealth")
set(COMPONENT_LIBS set(COMPONENT_LIBS
ArmarXCoreInterfaces ArmarXCore ArmarXCoreInterfaces ArmarXCore ArmarXCoreComponentPlugins
RemoteGui RemoteGui
ArmarXGuiInterfaces ArmarXGuiInterfaces
RobotAPIInterfaces) RobotAPIInterfaces)
......
...@@ -49,6 +49,8 @@ namespace armarx ...@@ -49,6 +49,8 @@ namespace armarx
//usingProxy(getProperty<std::string>("RemoteGuiName").getValue()); //usingProxy(getProperty<std::string>("RemoteGuiName").getValue());
setDebugObserverBatchModeEnabled(true);
} }
...@@ -157,6 +159,8 @@ namespace armarx ...@@ -157,6 +159,8 @@ namespace armarx
catch(...) catch(...)
{} {}
}*/ }*/
reportDebugObserver();
} }
void RobotHealth::onDisconnectComponent() void RobotHealth::onDisconnectComponent()
...@@ -296,4 +300,16 @@ namespace armarx ...@@ -296,4 +300,16 @@ namespace armarx
} }
return ss.str(); return ss.str();
} }
void RobotHealth::reportDebugObserver()
{
for(const auto& entry: entries)
{
setDebugObserverDatafield("RobotHealth_" + entry.name + "_lastDelta", entry.lastDelta);
setDebugObserverDatafield("RobotHealth_" + entry.name + "_maximumCycleTimeWarn", entry.maximumCycleTimeWarn);
setDebugObserverDatafield("RobotHealth_" + entry.name + "_maximumCycleTimeErr", entry.maximumCycleTimeErr);
}
sendDebugObserverBatch();
}
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <ArmarXCore/core/Component.h> #include <ArmarXCore/core/Component.h>
#include <ArmarXCore/core/services/tasks/PeriodicTask.h> #include <ArmarXCore/core/services/tasks/PeriodicTask.h>
#include <ArmarXCore/interface/components/EmergencyStopInterface.h> #include <ArmarXCore/interface/components/EmergencyStopInterface.h>
#include <ArmarXCore/libraries/ArmarXCoreComponentPlugins/DebugObserverComponentPlugin.h>
#include <atomic> #include <atomic>
#include <mutex> #include <mutex>
...@@ -82,7 +83,8 @@ namespace armarx ...@@ -82,7 +83,8 @@ namespace armarx
*/ */
class RobotHealth : class RobotHealth :
virtual public RobotHealthComponentInterface, virtual public RobotHealthComponentInterface,
virtual public armarx::Component virtual public armarx::Component,
virtual public armarx::DebugObserverComponentPluginUser
{ {
public: public:
/** /**
...@@ -145,6 +147,8 @@ namespace armarx ...@@ -145,6 +147,8 @@ namespace armarx
void monitorHealthTaskClb(); void monitorHealthTaskClb();
Entry& findOrCreateEntry(const std::string& name); Entry& findOrCreateEntry(const std::string& name);
void reportDebugObserver();
std::mutex mutex; std::mutex mutex;
std::deque<Entry> entries; std::deque<Entry> entries;
std::atomic_size_t validEntries {0}; std::atomic_size_t validEntries {0};
......
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