49 this->topicName = topicName;
55 if (topicName.empty())
74 statisticsTask->start();
80 statisticsTask->stop();
85 const std::string& name,
86 const armarx::MatrixFloatBasePtr& values,
87 const armarx::TimestampBasePtr&
timestamp,
90 std::unique_lock lock(dataMutex);
93 if (matrix->cols == 0)
100 Eigen::MatrixXf eigenMatrix = matrix->toEigen();
101 float max = eigenMatrix.maxCoeff();
102 float mean = eigenMatrix.mean();
103 std::string channelName = name;
104 Eigen::MatrixXf M = matrix->toEigen();
110 channelName,
"device",
Variant(device),
"Device of the tactile sensor");
112 channelName,
"name",
Variant(name),
"Name of the tactile sensor");
119 for (
int i = 0; i < M.rows(); i++)
121 for (
int j = 0; j < M.cols(); j++)
124 s <<
"entry_" << i <<
"," << j;
126 channelName, s.str(),
Variant(M(i, j)),
"Individual matrix entry");
130 ARMARX_INFO <<
"Offering new channel: " << channelName;
141 for (
int i = 0; i < M.rows(); i++)
143 for (
int j = 0; j < M.cols(); j++)
146 s <<
"entry_" << i <<
"," << j;
175 HapticObserver::updateStatistics()
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
Checks if the numbers published in the relevant data fields equal a reference value.
Checks if the numbers published in the relevant data fields are larger than a reference value.
Checks if the numbers published in the relevant data fields are smaller than a reference value.
Checks if the relevant data fields have been updated since the installation of this condition.
void onConnectObserver() override
Framework hook.
void setTopicName(std::string topicName)
void onExitObserver() override
Framework hook.
void reportSensorValues(const ::std::string &device, const ::std::string &name, const ::armarx::MatrixFloatBasePtr &values, const ::armarx::TimestampBasePtr ×tamp, const ::Ice::Current &=Ice::emptyCurrent) override
PropertyDefinitionsPtr createPropertyDefinitions() override
void onInitObserver() override
Framework hook.
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
bool existsChannel(const std::string &channelName) const
void offerChannel(std::string channelName, std::string description)
Offer a channel.
void offerConditionCheck(std::string checkName, ConditionCheck *conditionCheck)
Offer a condition check.
void updateChannel(const std::string &channelName, const std::set< std::string > &updatedDatafields=std::set< std::string >())
Update all conditions for a channel.
void offerDataFieldWithDefault(std::string channelName, std::string datafieldName, const Variant &defaultValue, std::string description)
Offer a datafield with default value.
void setDataField(const std::string &channelName, const std::string &datafieldName, const Variant &value, bool triggerFilterUpdate=true)
set datafield with datafieldName and in channel channelName
The periodic task executes one thread method repeatedly using the time period specified in the constr...
The Variant class is described here: Variants.
#define ARMARX_INFO
The normal logging level.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::optional< float > mean(const boost::circular_buffer< NameValueMap > &buffer, const std::string &key)
IceInternal::Handle< MatrixFloat > MatrixFloatPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
IceInternal::Handle< TimestampVariant > TimestampVariantPtr