Go to the documentation of this file.
34 #include <Eigen/Dense>
46 this->topicName = topicName;
51 if (topicName.empty())
53 usingTopic(getProperty<std::string>(
"HapticTopicName").getValue());
69 statisticsTask->start();
74 statisticsTask->stop();
79 std::unique_lock lock(dataMutex);
82 if (matrix->cols == 0)
89 Eigen::MatrixXf eigenMatrix = matrix->toEigen();
90 float max = eigenMatrix.maxCoeff();
91 float mean = eigenMatrix.mean();
92 std::string channelName = name;
93 Eigen::MatrixXf M = matrix->toEigen();
106 for (
int i = 0; i < M.rows(); i++)
108 for (
int j = 0; j < M.cols(); j++)
111 s <<
"entry_" << i <<
"," << j;
116 ARMARX_INFO <<
"Offering new channel: " << channelName;
127 for (
int i = 0; i < M.rows(); i++)
129 for (
int j = 0; j < M.cols(); j++)
132 s <<
"entry_" << i <<
"," << j;
160 void 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.