23 #include <condition_variable>
28 #include <yarp/os/all.h>
29 #include <yarp/dev/all.h>
30 #include <yarp/sig/all.h>
31 #include <yarp/math/Math.h>
32 #include <yarp/math/SVD.h>
37 using namespace yarp::os;
39 using namespace yarp::sig;
40 using namespace yarp::math;
54 class xdPort :
public BufferedPort<Bottle>,
72 void onRead(Bottle &b)
override;
76 explicit xdPort(
void *_slv);
79 void init(
const Vector &xd0);
80 void lock() { locked=
true; }
86 bool set_xd(
const Vector &_xd);
88 Vector get_xdDelayed();
107 void resize_v(
const int sz,
const double val);
108 void resize_counterv(
const int sz,
const double val);
110 void set_xd(
const Vector &_xd);
111 void set_qd(
const Vector &_qd);
112 void set_qd(
const int i,
const double val);
113 void set_x(
const Vector &_x);
114 void set_x(
const Vector &_x,
const double stamp);
115 void set_q(
const Vector &_q);
116 void set_torso(
const Vector &_torso);
117 void set_v(
const Vector &_v);
118 void set_counterv(
const Vector &_counterv);
119 void set_fpFrame(
const Matrix &_S);
124 Vector get_x(
double &stamp);
128 Vector get_counterv();
129 Matrix get_fpFrame();
131 std::pair<Vector,bool> get_gyro();
132 std::pair<Vector,bool> get_accel();
176 virtual bool getExtrinsicsMatrix(
const string &type, Matrix &M);
177 virtual bool setExtrinsicsMatrix(
const string &type,
const Matrix &M);
183 inline double sat(
const double val,
const double min,
const double max)
192 bool getCamParams(
const ResourceFinder &rf,
const string &type, Matrix **Prj,
int &w,
int &
h,
const bool verbose=
false);
198 bool getAlignHN(
const ResourceFinder &rf,
const string &type,
iKinChain *chain,
const bool verbose=
false);
221 bool getFeedback(Vector &fbTorso, Vector &fbHead, PolyDriver *drvTorso,
223 double *timeStamp =
nullptr);
ResourceFinder rf_cameras
double saccadesActivationAngle
IThreeAxisLinearAccelerometers * iAccel
double gyro_noise_threshold
double saccadesInhibitionPeriod
double minAllowedVergence
IThreeAxisGyroscopes * iGyro
iKinLimbVersion head_version
virtual void minAllowedVergenceChanged()
A class for defining the iCub Eye.
A Base class for defining a Serial Link Chain.
A class for defining the versions of the iCub limbs.
condition_variable cv_triggerNeck
void copyJointsBounds(iKinChain *ch1, iKinChain *ch2)
bool getAlignHN(const ResourceFinder &rf, const string &type, iKinChain *chain, const bool verbose=false)
bool getCamParams(const ResourceFinder &rf, const string &type, Matrix **Prj, int &w, int &h, const bool verbose=false)
bool getFeedback(Vector &fbTorso, Vector &fbHead, PolyDriver *drvTorso, PolyDriver *drvHead, const ExchangeData *commData, double *timeStamp=nullptr)
void updateNeckBlockedJoints(iKinChain *chain, const Vector &fbNeck)
void updateTorsoBlockedJoints(iKinChain *chain, const Vector &fbTorso)
Matrix alignJointsBounds(iKinChain *chain, PolyDriver *drvTorso, PolyDriver *drvHead, const ExchangeData *commData)
double sat(const double val, const double min, const double max)