27 #include <RobotAPI/interface/units/HapticUnit.h>
48 defineOptionalProperty<std::string>(
"HapticTopicName",
"HapticValues",
"Name of the HapticUnit Topic");
61 this->lastTimestamp = timestamp;
66 void add(
long timestamp)
68 long delta = timestamp - lastTimestamp;
77 pos = (pos + 1) % count;
80 lastTimestamp = timestamp;
102 for (std::vector<long>::iterator it =
deltas.begin(); it !=
deltas.end(); ++it)
107 return sum /
deltas.size();
127 virtual public HapticUnitObserverInterface
137 return "HapticUnitObserver";
143 void reportSensorValues(const ::std::string& device, const ::std::string& name, const ::armarx::MatrixFloatBasePtr&
values, const ::armarx::TimestampBasePtr& timestamp, const ::Ice::Current& = Ice::emptyCurrent)
override;
150 std::mutex dataMutex;
151 std::string topicName;
154 void updateStatistics();
156 std::map<std::string, HapticSampleStatistics> statistics;