19 #ifndef __CONTROLLER_H__
20 #define __CONTROLLER_H__
23 #include <condition_variable>
28 #include <yarp/os/all.h>
29 #include <yarp/sig/all.h>
30 #include <yarp/dev/all.h>
31 #include <yarp/math/Math.h>
35 #include <iCub/utils.h>
43 using namespace yarp::os;
45 using namespace yarp::sig;
46 using namespace yarp::math;
110 Vector
v,vNeck,vEyes;
111 Vector
q0,qd,qdNeck,qdEyes;
119 Vector computedxFP(
const Matrix &
H,
const Vector &v,
const Vector &w,
const Vector &x_FP);
120 Vector computeNeckVelFromdxFP(
const Vector &
fp,
const Vector &dfp);
121 Vector computeEyesVelFromdxFP(
const Vector &dfp);
122 bool areJointsHealthyAndSet();
123 void setJointsCtrlMode();
124 void stopLimb(
const bool execStopPosition=
true);
125 void notifyEvent(
const string &event,
const double checkPoint=-1.0);
126 void motionOngoingEventsHandling();
127 void motionOngoingEventsFlush();
128 void stopControlHelper();
132 const double _neckTime,
const double _eyesTime,
133 const double _min_abs_vel,
const unsigned int _period);
136 void findMinimumAllowedVergence();
137 void minAllowedVergenceChanged()
override;
138 void resetCtrlEyes();
139 void doSaccade(
const Vector &ang,
const Vector &vel);
140 bool look(
const Vector &
x);
142 void printIter(Vector &xd, Vector &
fp, Vector &qd, Vector &q, Vector &v,
double printTime);
143 bool threadInit()
override;
144 void threadRelease()
override;
145 void afterStart(
bool s)
override;
149 double getTneck()
const;
150 double getTeyes()
const;
151 void setTneck(
const double execTime);
152 void setTeyes(
const double execTime);
154 void setTrackingMode(
const bool f);
155 bool getTrackingMode()
const;
156 bool setGazeStabilization(
const bool f);
157 bool getGazeStabilization()
const;
158 bool getDesired(Vector &des);
159 bool getVelocity(Vector &vel);
160 bool getPose(
const string &poseSel, Vector &
x, Stamp &stamp);
161 bool registerMotionOngoingEvent(
const double checkPoint);
162 bool unregisterMotionOngoingEvent(
const double checkPoint);
163 Bottle listMotionOngoingEvents();
BufferedPort< Bottle > port_event
minJerkVelCtrl * mjCtrlNeck
vector< int > jointsToSet
multiset< double > motionOngoingEvents
minJerkVelCtrl * mjCtrlEyes
IPositionControl * posHead
double ctrlActiveRisingEdgeTime
BufferedPort< Vector > port_q
Integrator * IntStabilizer
IPositionDirect * posNeck
IVelocityControl * velHead
BufferedPort< Bottle > port_debug
BufferedPort< Vector > port_x
multiset< double > motionOngoingEventsCurrent
condition_variable cv_eventLook
A class for defining a saturated integrator based on Tustin formula: .
Abstract class for minimum-jerk controllers with velocity commands.
A class for describing the kinematic of the straight line coming out from the point located between t...
A class for defining the Inertia Sensor Kinematics of the iCub.
A Base class for defining a Serial Link Chain.
constexpr double GAZECTRL_MOTIONDONE_EYES_QTHRES
constexpr int32_t GAZECTRL_SWOFFCOND_DISABLESLOT
constexpr double GAZECTRL_CRITICVER_STABILIZATION
constexpr double GAZECTRL_MOTIONDONE_NECK_QTHRES
static struct bpf_program fp