20#ifndef __COMPTHREAD_H__
21#define __COMPTHREAD_H__
29#include <yarp/sig/Vector.h>
30#include <yarp/os/BufferedPort.h>
31#include <yarp/os/PeriodicThread.h>
32#include <yarp/os/ResourceFinder.h>
33#include <yarp/dev/IAnalogSensor.h>
34#include <yarp/dev/PolyDriver.h>
40using namespace yarp::os;
41using namespace yarp::sig;
56 CompensationThread(
string name, ResourceFinder* rf,
string robotName,
double _compensationGain,
double _contactCompensationGain,
57 int addThreshold,
float minBaseline,
bool zeroUpRawData,
int period,
bool binarization,
bool smoothFilter,
float smoothFactor);
107 static const int CAL_TIME = 5;
112 unsigned int SKIN_DIM;
113 double compensationGain;
114 double contactCompensationGain;
116 bool initializationFinished;
119 int calibrationCounter;
120 int readErrorCounter;
133 unsigned int portNum;
135 vector<Compensator*> compensators;
136 vector<bool> compEnable;
137 vector<bool> compWorking;
138 unsigned int compensatorCounter;
144 BufferedPort<skinContactList> skinEventsPort;
145 BufferedPort<Vector> monitorPort;
146 BufferedPort<Bottle> infoPort;
153 bool doesBaselineExceed(
unsigned int &compInd,
unsigned int &taxInd,
double &baseline,
double &initialBaseline);
154 void sendMonitorData();
155 void sendDebugMsg(
string msg);
156 void sendErrorMsg(
string msg);
157 void sendSkinEvents();
bool setTaxelPosition(SkinPart sp, unsigned int taxelId, const Vector &position)
unsigned int getAddThreshold()
double getMaxNeighborDistance()
Vector getPoseConfidences(SkinPart sp)
Vector getTaxelPose(SkinPart sp, unsigned int taxelId)
Vector getTaxelOrientation(SkinPart sp, unsigned int taxelId)
bool setTaxelPose(SkinPart sp, unsigned int taxelId, const Vector &pose)
bool enableSkinPart(SkinPart sp)
vector< SkinPart > getSkinParts()
bool setSmoothFactor(float value)
double getPoseConfidence(SkinPart sp, unsigned int taxelId)
vector< Vector > getTaxelPoses(SkinPart sp=SKIN_PART_ALL)
double getCompensationGain()
bool setContactCompensationGain(double gain)
bool setTaxelPositions(SkinPart sp, const Vector &positions)
bool setCompensationGain(double gain)
double getContactCompensationGain()
bool setTaxelPoses(SkinPart sp, const vector< Vector > &poses)
bool disableSkinPart(SkinPart sp)
Vector getTaxelPosition(SkinPart sp, unsigned int taxelId)
bool isSkinEnabled(SkinPart sp)
bool setTaxelOrientation(SkinPart sp, unsigned int taxelId, const Vector &orientation)
Vector getTouchThreshold()
bool setAddThreshold(unsigned int thr)
bool setMaxNeighborDistance(double dist)
void setBinarization(bool value)
bool setTaxelOrientations(SkinPart sp, const vector< Vector > &orientations)
vector< Vector > getTaxelPositions(SkinPart sp=SKIN_PART_ALL)
void setSmoothFilter(bool value)
vector< Vector > getTaxelOrientations(SkinPart sp=SKIN_PART_ALL)
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.