21 #ifndef _SENSORSDUPLICATEREADINGS_H_
22 #define _SENSORSDUPLICATEREADINGS_H_
24 #include <yarp/robottestingframework/TestCase.h>
25 #include <yarp/os/BufferedPort.h>
26 #include <yarp/sig/Vector.h>
29 class DuplicateReadingsPortInfo {
32 int toleratedDuplicates;
36 class DuplicateDetector :
public yarp::os::BufferedPort<yarp::sig::Vector> {
44 unsigned long getCount() {
return count; }
45 unsigned long getMaxNrOfDuplicates() {
return maxNrOfDuplicates; }
46 double getMaxJitter() {
return maxJitter; }
47 unsigned long getTotalNrOfDuplicates() {
return totalNrOfDuplicates; }
49 virtual void onRead(yarp::sig::Vector& vec);
54 unsigned long currentNrOfDuplicates;
55 unsigned long totalNrOfDuplicates;
56 unsigned long maxNrOfDuplicates;
57 double lastNewValueTime;
60 yarp::sig::Vector lastReading;
93 virtual bool setup(yarp::os::Property& property);
95 virtual void tearDown();
100 DuplicateDetector port;
101 std::vector<DuplicateReadingsPortInfo> ports;
Check if a yarp port is correctly publishing unique values at each update .