18#ifndef __DEPTH2KIN_MODULE_H__
19#define __DEPTH2KIN_MODULE_H__
25#include <opencv2/opencv.hpp>
27#include <yarp/os/all.h>
28#include <yarp/sig/all.h>
29#include <yarp/dev/all.h>
38using namespace yarp::os;
40using namespace yarp::sig;
52 void onRead(ImageOf<PixelMono> &imgIn);
122 bool attach(RpcServer &source);
127 cv::Rect
extractFingerTip(ImageOf<PixelMono> &imgIn, ImageOf<PixelBgr> &imgOut,
128 const Vector &c, Vector &px);
130 bool getGazeParams(
const string &eye,
const string &type, Matrix &M);
132 bool getDepth(
const Vector &px, Vector &
x, Vector &pxr);
133 bool getDepthAveraged(
const Vector &px, Vector &
x, Vector &pxr,
const int maxSamples=5);
134 void openHand(IControlMode *imod, IPositionControl *ipos);
135 void postureHelper(
const Vector &gaze_ang,
const Matrix &targetL,
const Matrix &targetR);
139 void doTouch(
const Vector &xd);
145 void onRead(ImageOf<PixelMono> &imgIn);
156 bool log(
const string &type);
161 bool setRoi(
const int side);
171 Property
calibrate(
const bool rm_outliers);
175 bool touch(
const int u,
const int v);
177 vector<PointReq>
getPoints(
const string &
arm,
const vector<double> &coordinates);
189 const double a,
const double b);
191 const double da,
const double db);
194 bool posture(
const string &type);
bool attach(RpcServer &source)
bool motorExplorationAsyncStop
void openHand(IControlMode *imod, IPositionControl *ipos)
enum CalibModule::@38 motorExplorationState
IEncoderArrays * iencarray
double getExplorationWait()
Return the current wait timeout used during exploration between two consecutive data points.
bool setTouchWithExperts(const string &sw)
Enable/disable the use of experts for touch test.
double getExplorationInTargetTol()
Return the current cartesian tolerance used during exploration.
bool explore()
Start the exploration phase.
void doTouch(const Vector &xd)
bool getGazeParams(const string &eye, const string &type, Matrix &M)
void doMotorExploration()
Vector curExplorationCenter
double getTouchInTargetTol()
Return the current cartesian tolerance used during touch actions.
string getCalibrationType()
Return the current calibration type.
PointReq getPoint(const string &arm, const double x, const double y, const double z)
Retrieve the compensated kinematic point corresponding to the input depth point.
void onRead(ImageOf< PixelMono > &imgIn)
bool posture(const string &type)
Make the robot reach a predefined posture.
bool stop()
Yield an asynchronous stop of the exploration phase.
bool load()
Reload the list of experts stored within the configuration file.
Vector getExtrinsics(const string &eye)
Retrieve the current extrinsics camera parameters.
double exploration_intargettol
bool setMaxDist(const double max_dist)
Set the maximum allowed distance between the depth point and kinematic prediction to enable data coll...
bool quit()
Quit the module.
string getExperiment(const string &exp)
Return the current status of the experiment.
double getMaxDist()
Return the maximum allowed distance between depth point and kinematic prediction to enable data colle...
bool pushExtrinsics(const string &eye, const Matrix &H)
bool setRoi(const int side)
@ motorExplorationStateTrigger
@ motorExplorationStateLog
@ motorExplorationStateReach
@ motorExplorationStateIdle
bool setArm(const string &arm)
Select the arm to deal with.
bool setBlockEyes(const double block_eyes)
Set the vergence angle used to keep the gaze fixed.
DisparityProcessor depthInPort
bool clearExperts()
Clear the list of currently available experts.
bool pushCalibrator()
Push the current calibrator in the list of experts.
bool clearExplorationData()
Clean up the internal list of explored points pairs.
bool setCalibrationType(const string &type, const string &extrapolation)
Set up the calibrator type.
bool setExplorationInTargetTol(const double tol)
Set up the cartesian tolerance used during exploration.
bool setExplorationSpace(const double cx, const double cy, const double cz, const double a, const double b)
Set up the internally coded exploration space composed by two co-centered ellipses,...
bool setExplorationWait(const double wait)
Set up the wait timeout used during exploration between two consecutive data points.
int getNumExperts()
Return the number of available experts.
bool setExperiment(const string &exp, const string &v)
Set on/off an experiment.
LocallyWeightedExperts expertsR
bool getDepthAveraged(const Vector &px, Vector &x, Vector &pxr, const int maxSamples=5)
Property calibrate(const bool rm_outliers)
Ask the current calibrator to carry out the calibration.
bool log(const string &type)
Store on file the log of system response computed out of the explored set of input-output pairs.
bool clearEyes()
Remove the block on the eyes.
bool blockEyes()
Tell the gaze to immediately steer the eyes to the stored vergence angle and stay still.
bool isTypeValid(const string &type)
bool setTouchInTargetTol(const double tol)
Set up the cartesian tolerance used during a touch actions.
BufferedPort< ImageOf< PixelBgr > > depthOutPort
vector< PointReq > getPoints(const string &arm, const vector< double > &coordinates)
Retrieve the compensated kinematic points corresponding to the input depth points.
string getTouchWithExperts()
Return the current status of the switch for experts usage during touch test.
bool setExplorationSpaceDelta(const double dcx, const double dcy, const double dcz, const double da, const double db)
Set up the exploration space in terms of differences with respect to the internally coded couple of e...
Property getExplorationData()
Return some progress about the ongoing exploration.
bool resetExtrinsics(const string &eye)
Reset the extrinsics matrix to default eye matrix.
BufferedPort< Bottle > touchInPort
Calibrator * factory(const string &type)
bool save()
Save the current list of experts into the configuration file.
bool touch(const int u, const int v)
LocallyWeightedExperts * experts
deque< Vector > targetsConsumed
string getArm()
Return the current arm.
bool createTargets(const Vector &c, const Vector &size)
bool configure(ResourceFinder &rf)
double getBlockEyes()
Return the current angle to keep the vergence at.
cv::Rect extractFingerTip(ImageOf< PixelMono > &imgIn, ImageOf< PixelBgr > &imgOut, const Vector &c, Vector &px)
int getRoi()
Return the side of the squared window used to filter data collection in the image plane.
bool getDepth(const Vector &px, Vector &x, Vector &pxr)
LocallyWeightedExperts expertsL
void postureHelper(const Vector &gaze_ang, const Matrix &targetL, const Matrix &targetR)
bool calibrateDepth()
Put the robot in a suitable predefined posture and then execute depth calibration.
CalibModule *void onRead(ImageOf< PixelMono > &imgIn)
PointReq IDL structure to send/receive points.
depth2kin_IDL IDL Interface to depth2kin services.
A class for defining the iCub Finger.