Go to the documentation of this file.
26 #include <Eigen/Dense>
49 this->topicName = topicName;
55 if (topicName.empty())
57 usingTopic(getProperty<std::string>(
"HapticTopicName").getValue());
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()
void updateChannel(const std::string &channelName, const std::set< std::string > &updatedDatafields=std::set< std::string >())
Update all conditions for a channel.
The Variant class is described here: Variants.
void onInitObserver() override
Framework hook.
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
void setTopicName(std::string topicName)
bool existsChannel(const std::string &channelName) const
PropertyDefinitionsPtr createPropertyDefinitions() override
std::optional< float > mean(const boost::circular_buffer< NameValueMap > &buffer, const std::string &key)
void onConnectObserver() override
Framework hook.
void setDataField(const std::string &channelName, const std::string &datafieldName, const Variant &value, bool triggerFilterUpdate=true)
set datafield with datafieldName and in channel channelName
void reportSensorValues(const ::std::string &device, const ::std::string &name, const ::armarx::MatrixFloatBasePtr &values, const ::armarx::TimestampBasePtr ×tamp, const ::Ice::Current &=Ice::emptyCurrent) override
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
void onExitObserver() override
Framework hook.
void offerConditionCheck(std::string checkName, ConditionCheck *conditionCheck)
Offer a condition check.
void offerDataFieldWithDefault(std::string channelName, std::string datafieldName, const Variant &defaultValue, std::string description)
Offer a datafield with default value.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
double s(double t, double s0, double v0, double a0, double j)
This file offers overloads of toIce() and fromIce() functions for STL container types.
void offerChannel(std::string channelName, std::string description)
Offer a channel.