26#include <yarp/math/Math.h>
27#include <yarp/math/Rand.h>
35#define RES_WAVER(x) (dynamic_cast<ArmWavingMonitor*>(x))
37#define ACTIONPRIM_DEFAULT_PER 50
38#define ACTIONPRIM_DEFAULT_EXECTIME 2.0
39#define ACTIONPRIM_DEFAULT_REACHTOL 0.005
40#define ACTIONPRIM_DUMP_PERIOD 1.0
41#define ACTIONPRIM_DEFAULT_PART "right_arm"
42#define ACTIONPRIM_DEFAULT_TRACKINGMODE "off"
43#define ACTIONPRIM_DEFAULT_VERBOSITY "off"
44#define ACTIONPRIM_DEFAULT_WBDYN_STEMNAME "wholeBodyDynamics"
45#define ACTIONPRIM_DEFAULT_WBDYN_PORTNAME "cartesianEndEffectorWrench:o"
48#define ACTIONPRIM_BALANCEARM_PERIOD 2.0
49#define ACTIONPRIM_BALANCEARM_LENGTH 0.03
51#define ACTIONPRIM_TORSO_PITCH "torso_pitch"
52#define ACTIONPRIM_TORSO_ROLL "torso_roll"
53#define ACTIONPRIM_TORSO_YAW "torso_yaw"
56using namespace yarp::os;
58using namespace yarp::sig;
59using namespace yarp::math;
65namespace iCub {
namespace action {
namespace log {
79 deque<ActionPrimitivesWayPoint> wayPoints;
81 ICartesianControl *cartCtrl;
82 double default_exec_time;
89 double checkTime(
const double time)
const
91 return std::max(
time,0.01);
95 double checkDefaultTime(
const double time)
const
97 return (
time>0.0?
time:default_exec_time);
103 if (wayPoints[i].oEnabled)
105 wayPoints[i].
x.toString(3,3).c_str(),
106 wayPoints[i].o.toString(3,3).c_str());
109 wayPoints[i].
x.toString(3,3).c_str());
115 if (wayPoints[i].callback!=NULL)
118 wayPoints[i].callback->exec();
130 wayPoints=_wayPoints;
138 default_exec_time=exec_time;
144 if ((cartCtrl!=NULL) && (wayPoints.size()>0))
147 cartCtrl->getPose(x0,o);
148 setPeriod(checkTime(wayPoints[0].granularity));
167 double t=Time::now()-t0;
168 double trajTime=checkDefaultTime(wayPoints[i].trajTime);
169 double r=t/checkTime(checkDefaultTime(wayPoints[i].duration));
171 Vector
x=(r<1.0)?(x0+r*(wayPoints[i].
x-x0)):wayPoints[i].x;
172 if (wayPoints[i].oEnabled)
173 cartCtrl->goToPose(
x,wayPoints[i].o,trajTime);
175 cartCtrl->goToPosition(
x,trajTime);
181 if (i<wayPoints.size()-1)
186 setPeriod(checkTime(wayPoints[i].granularity));
207 ICartesianControl *cartCtrl;
208 Vector restPos, restOrien;
229 cartCtrl->getTrajTime(&trajTime);
242 cartCtrl->getPose(xdhat,restOrien);
243 cartCtrl->askForPose(restPos,restOrien,xdhat,restOrien,qdhat);
245 cartCtrl->getTrajTime(&trajTime);
261 cartCtrl->setTrajTime(trajTime);
271 size_t len=restPos.length();
272 if ((cartCtrl!=NULL) && (len>=3))
274 Vector halves(len,0.5);
277 cartCtrl->goToPose(restPos+randOffs,restOrien);
286 cartCtrl->stopControl();
311 for (
size_t i=0; i<this->size(); i++)
313 Action &action=(*this)[i];
318 deque<Action>::clear();
382 va_start(arg,format);
383 vsnprintf(buf,
sizeof(buf),format,arg);
399 printf(
"%s\n",str.c_str());
419 const int j=remap[key];
421 bool sw=opt.find(key).asString()==
"on"?
true:
false;
423 Vector newDof(3,2.0), dummyRet;
424 newDof[j]=sw?1.0:0.0;
431 string minKey=key+
"_min";
432 string maxKey=key+
"_max";
437 min=opt.check(minKey,Value(min)).asFloat64();
438 max=opt.check(maxKey,Value(max)).asFloat64();
444 if (
cartCtrl->getRestWeights(weights))
448 cartCtrl->setRestWeights(weights,weights);
469 if (opt.check(
"hand_sequences_file"))
471 string handSeqFile=opt.find(
"hand_sequences_file").asString();
474 Property handSeqProp; handSeqProp.fromConfigFile(handSeqFile);
477 Bottle &bGeneral=handSeqProp.findGroup(
"GENERAL");
478 if (bGeneral.isNull())
484 if (!bGeneral.check(
"numSequences"))
490 int numSequences=bGeneral.find(
"numSequences").asInt32();
493 for (
int i=0; i<numSequences; i++)
498 Bottle &bSeq=handSeqProp.findGroup(seq.str());
505 if (!bSeq.check(
"key"))
511 string key=bSeq.find(
"key").asString();
534 if (opt.check(
"grasp_model_type"))
536 string modelType=opt.find(
"grasp_model_type").asString();
537 if (modelType!=
"none")
539 if (opt.check(
"grasp_model_file"))
541 if (modelType==
"springy")
543 else if (modelType==
"tactile")
551 string modelFile=opt.find(
"grasp_model_file").asString();
553 Property modelProp; modelProp.fromConfigFile(modelFile);
556 if (modelProp.check(
"type"))
558 string type=modelProp.find(
"type").asString();
563 type.c_str(),
part.c_str());
569 modelProp.put(
"robot",
robot);
592 if (!opt.check(
"local"))
598 robot=opt.check(
"robot",Value(
"icub")).asString();
599 local=opt.find(
"local").asString();
619 Property optPolyHand(
"(device remote_controlboard)");
620 optPolyHand.put(
"remote",
"/"+
robot+
"/"+
part);
621 optPolyHand.put(
"local",
"/"+
local+
"/"+
part+
"/position");
629 Property optPolyCart(
"(device cartesiancontrollerclient)");
630 optPolyCart.put(
"remote",
"/"+
robot+
"/cartesianController/"+
part);
631 optPolyCart.put(
"local",
"/"+
local+
"/"+
part+
"/cartesian");
645 cartCtrl->setInTargetTol(reach_tol);
663 for (
int i=0; i<3; i++)
691 setPeriod((
double)period/1000.0);
763 Bottle *pB=
out.asList();
766 for (
int fng=0; fng<5; fng++)
768 double val=pB->get(fng).asFloat64();
778 pair<multimap<int,int>::iterator,multimap<int,int>::iterator> i=
fingers2JntsMap.equal_range(fng);
780 for (multimap<int,int>::iterator j=i.first; j!=i.second; ++j)
785 if (tmpSet.find(jnt)!=tmpSet.end())
829 lock_guard<mutex> lck(
mtx);
873 const double execTime,
const bool oEnabled,
const bool execHand,
874 const HandWayPoint &handWP,
const bool handSeqTerminator,
879 lock_guard<mutex> lck(
mtx);
882 action.waitState=
false;
883 action.execArm=execArm;
886 action.execTime=execTime;
887 action.oEnabled=oEnabled;
888 action.execHand=execHand;
889 action.handWP=handWP;
891 action.execWayPoints=
false;
904 const string &handSeqKey,
const double execTime,
909 map<string,deque<HandWayPoint> >::iterator itr=
handSeqMap.find(handSeqKey);
912 deque<HandWayPoint> &q=itr->second;
918 _pushAction(
true,
x,o,execTime,oEnabled,
true,q[0],q.size()==1,q.size()==1?clb:NULL);
925 for (i=1; i<q.size()-1; i++)
951 const string &handSeqKey,
const double execTime,
963 return _pushAction(
x,vectDummy,handSeqKey,execTime,clb,
false);
969 const double execTime,
974 HandWayPoint handDummy;
976 _pushAction(
true,
x,o,execTime,
true,
false,handDummy,
false,clb);
991 HandWayPoint handDummy;
994 _pushAction(
true,
x,vectDummy,execTime,
false,
false,handDummy,
false,clb);
1009 map<string,deque<HandWayPoint> >::iterator itr=
handSeqMap.find(handSeqKey);
1012 deque<HandWayPoint> &q=itr->second;
1013 Vector vectDummy(1);
1017 for (i=0; i<q.size()-1; i++)
1029 handSeqKey.c_str());
1045 lock_guard<mutex> lck(
mtx);
1072 lock_guard<mutex> lck(
mtx);
1073 map<string,deque<HandWayPoint> >::iterator itr=
handSeqMap.find(handSeqKey);
1076 deque<HandWayPoint> &q=itr->second;
1091 action.
clb=(q.size()==1?clb:NULL);
1097 Vector vectDummy(1);
1101 for (i=1; i<q.size()-1; i++)
1115 handSeqKey.c_str());
1129 lock_guard<mutex> lck(
mtx);
1150 const double execTime)
1163 x.toString(3,3).c_str(),
1164 o.toString(3,3).c_str());
1192 x.toString(3,3).c_str());
1252 lock_guard<mutex> lck(
mtx);
1274 const double t=Time::now();
1278 Vector
x,o,xdhat,odhat,qdhat;
1280 cartCtrl->getDesired(xdhat,odhat,qdhat);
1285 xdhat.toString(3,3).c_str(),
norm(xdhat-
x),
1286 odhat.toString(3,3).c_str(),
norm(odhat-o));
1369 if (
encCtrl->getEncoder(jnt,&fb))
1425 const Vector &
x=action.
x;
1426 const Vector &o=action.
o;
1427 const bool oEnabled=action.
oEnabled;
1441 x.toString(3,3).c_str(),
1442 o.toString(3,3).c_str());
1453 x.toString(3,3).c_str());
1505 size_t sz=std::min(
fingersJnts.size(),std::min(poss.length(),vels.length()));
1506 for (
size_t i=0; i<sz; i++)
1509 modCtrl->setControlMode(j,VOCAB_CM_POSITION);
1521 tag.c_str(),poss.toString(3,3).c_str(),
1522 thres.toString(3,3).c_str(),tmo);
1535 const Vector &vels,
const Vector &tols,
const Vector &thres,
1538 if ((poss.length()==9) && (vels.length()==9) && (tols.length()==9) && (thres.length()==5))
1542 handWP.
tag=handSeqKey;
1561 if (!sequence.check(
"numWayPoints"))
1567 int numWayPoints=sequence.find(
"numWayPoints").asInt32();
1570 for (
int j=0; j<numWayPoints; j++)
1575 Bottle &bWP=sequence.findGroup(wp.str());
1582 if (!bWP.check(
"poss"))
1588 if (!bWP.check(
"vels"))
1594 if (!bWP.check(
"tols"))
1600 if (!bWP.check(
"thres"))
1606 if (!bWP.check(
"tmo"))
1612 Bottle *bPoss=bWP.find(
"poss").asList();
1613 Vector poss(bPoss->size());
1615 for (
size_t k=0; k<poss.length(); k++)
1616 poss[k]=bPoss->get(k).asFloat64();
1618 Bottle *bVels=bWP.find(
"vels").asList();
1619 Vector vels(bVels->size());
1621 for (
size_t k=0; k<vels.length(); k++)
1622 vels[k]=bVels->get(k).asFloat64();
1624 Bottle *bTols=bWP.find(
"tols").asList();
1625 Vector tols(bTols->size());
1627 for (
size_t k=0; k<tols.length(); k++)
1628 tols[k]=bTols->get(k).asFloat64();
1630 Bottle *bThres=bWP.find(
"thres").asList();
1631 Vector thres(bThres->size());
1633 for (
size_t k=0; k<thres.length(); k++)
1634 thres[k]=bThres->get(k).asFloat64();
1636 double tmo=bWP.find(
"tmo").asFloat64();
1642 wp.str().c_str(),handSeqKey.c_str());
1652 map<string,deque<HandWayPoint> >::iterator itr=
handSeqMap.find(handSeqKey);
1664 map<string,deque<HandWayPoint> >::iterator itr=
handSeqMap.find(handSeqKey);
1679 map<string,deque<HandWayPoint> >::iterator itr;
1683 q.push_back(itr->first);
1694 deque<HandWayPoint> &handWP=
handSeqMap[handSeqKey];
1698 Bottle &bNum=sequence.addList();
1699 bNum.addString(
"numWayPoints");
1700 bNum.addInt32((
int)handWP.size());
1703 for (
unsigned int i=0; i<handWP.size(); i++)
1708 Bottle &bWP=sequence.addList();
1709 bWP.addString(wp.str());
1712 Bottle &bPoss=bWP.addList();
1713 bPoss.addString(
"poss");
1714 Bottle &bPossVects=bPoss.addList();
1715 for (
size_t j=0; j<handWP[i].poss.length(); j++)
1716 bPossVects.addFloat64(handWP[i].poss[j]);
1719 Bottle &bVels=bWP.addList();
1720 bVels.addString(
"vels");
1721 Bottle &bVelsVects=bVels.addList();
1722 for (
size_t j=0; j<handWP[i].vels.length(); j++)
1723 bVelsVects.addFloat64(handWP[i].vels[j]);
1726 Bottle &bTols=bWP.addList();
1727 bTols.addString(
"tols");
1728 Bottle &bTolsVects=bTols.addList();
1729 for (
size_t j=0; j<handWP[i].tols.length(); j++)
1730 bTolsVects.addFloat64(handWP[i].tols[j]);
1733 Bottle &bThres=bWP.addList();
1734 bThres.addString(
"thres");
1735 Bottle &bThresVects=bThres.addList();
1736 for (
size_t j=0; j<handWP[i].thres.length(); j++)
1737 bThresVects.addFloat64(handWP[i].thres[j]);
1740 Bottle &bTmo=bWP.addList();
1741 bTmo.addString(
"tmo");
1742 bTmo.addFloat64(handWP[i].tmo);
1757 lock_guard<mutex> lck(
mtx);
1771 lock_guard<mutex> lck(
mtx);
1785 lock_guard<mutex> lck(
mtx);
1838 size_t len=std::min(torso.length(),
size_t(3));
1839 for (
size_t i=0; i<len; i++)
1947 restPos.toString(3,3).c_str());
2109 const Vector &
x2,
const Vector &o2,
2110 const double execTime)
2136 x.toString(3,3).c_str());
2205 size_t len=std::min(wbdynWrench->length(),
wrenchExternal.length());
2206 for (
size_t i=0; i<len; i++)
2211 const double forceExternalAbs=
norm(forceExternal);
2228 forceExternal.toString(3,3).c_str(),forceExternalAbs,
ext_force_thres);
2256 ext_force_thres=opt.check(
"ext_force_thres",Value(std::numeric_limits<double>::max())).asFloat64();
2261 string wbdynServerName=
"/"+wbdynStemName+
"/"+
part+
"/"+wbdynPortName;
2263 if (!Network::connect(wbdynServerName,
wbdynPortIn.getName(),
"udp"))
2323 const Vector &d1,
const Vector &d2)
#define ACTIONPRIM_DEFAULT_REACHTOL
#define ACTIONPRIM_DEFAULT_EXECTIME
#define ACTIONPRIM_DEFAULT_PER
#define ACTIONPRIM_TORSO_PITCH
#define ACTIONPRIM_BALANCEARM_PERIOD
#define ACTIONPRIM_TORSO_ROLL
#define ACTIONPRIM_DEFAULT_PART
#define ACTIONPRIM_DEFAULT_WBDYN_PORTNAME
#define ACTIONPRIM_DEFAULT_VERBOSITY
#define ACTIONPRIM_DEFAULT_WBDYN_STEMNAME
#define ACTIONPRIM_DUMP_PERIOD
#define ACTIONPRIM_TORSO_YAW
#define ACTIONPRIM_BALANCEARM_LENGTH
#define ACTIONPRIM_DEFAULT_TRACKINGMODE
#define ACTIONPRIM_DISABLE_EXECTIME
Class for defining routines to be called when action is completed.
virtual void exec()=0
Defines the callback body to be called at the action end.
A derived class defining a first abstraction layer on top of actionPrimitives father class.
virtual bool tap(const yarp::sig::Vector &x1, const yarp::sig::Vector &o1, const yarp::sig::Vector &x2, const yarp::sig::Vector &o2, const double execTime=ACTIONPRIM_DISABLE_EXECTIME)
Tap the given target (combined action).
virtual bool grasp(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const yarp::sig::Vector &d)
Grasp the given target (combined action).
virtual bool touch(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const yarp::sig::Vector &d)
Touch the given target (combined action).
virtual bool disableContactDetection()
Self-explaining :)
virtual bool grasp(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const yarp::sig::Vector &d1, const yarp::sig::Vector &d2)
More evolute version of grasp.
virtual bool isContactDetectionEnabled(bool &f) const
Self-explaining :)
virtual bool open(yarp::os::Property &opt)
Configure the object.
virtual bool getExtForceThres(double &thres) const
Retrieve the current threshold on the external force used to stop the limb while reaching.
virtual bool isValid() const
Check if the object is initialized correctly.
virtual bool enableContactDetection()
Self-explaining :)
liftAndGraspCallback * execLiftAndGrasp
yarp::sig::Vector grasp_o
virtual bool getExtWrench(yarp::sig::Vector &wrench) const
Retrieve the current wrench on the end-effector.
virtual ~ActionPrimitivesLayer2()
Destructor.
virtual bool touch(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const yarp::sig::Vector &d)
More evolute version of touch, exploiting contact detection.
friend class touchCallback
virtual bool checkContact(bool &f) const
Check whether the reaching has been stopped due to a contact with external objects.
yarp::sig::Vector wrenchExternal
virtual void close()
Deallocate the object.
friend class liftAndGraspCallback
virtual bool setExtForceThres(const double thres)
Set the threshold on the external force used to stop the limb while reaching.
yarp::sig::Vector grasp_d2
ActionPrimitivesLayer2()
Default Constructor.
virtual void postReachCallback()
yarp::os::BufferedPort< yarp::sig::Vector > wbdynPortIn
touchCallback * execTouch
The base class defining actions.
yarp::sig::Vector disableTorsoSw
virtual bool removeHandSeq(const std::string &handSeqKey)
Remove an already existing hand motion sequence.
std::vector< int > fingersJnts
std::multimap< int, int > fingers2JntsMap
virtual bool areFingersInPosition(bool &f)
Query if fingers are in position (cumulative response).
virtual void disableTorsoDof()
virtual bool lockActions()
Disable the possibility to yield any new action.
virtual void postReachCallback()
virtual bool syncCheckInterrupt(const bool disable=false)
Suddenly interrupt any blocking call that is pending on querying the action status.
virtual bool cmdHand(const Action &action)
virtual bool isValid() const
Check if the object is initialized correctly.
std::condition_variable cv_motionDoneEvent
virtual bool enableReachingTimeout(const double tmo)
Enable timeout while reaching.
perception::Model * graspModel
virtual bool execPendingHandSequences()
virtual bool _pushAction(const bool execArm, const yarp::sig::Vector &x, const yarp::sig::Vector &o, const double execTime, const bool oEnabled, const bool execHand, const HandWayPoint &handWP, const bool handSeqTerminator, ActionPrimitivesCallback *clb)
virtual bool getTorsoJoints(yarp::sig::Vector &torso)
Return the control status of torso joints.
virtual bool wait(const Action &action)
virtual bool setTorsoJoints(const yarp::sig::Vector &torso)
Change the control status of torso joints.
std::deque< bool > fingerInPosition
std::set< int > fingersJntsSet
virtual bool handCheckMotionDone(const int jnt)
virtual bool setTrackingMode(const bool f)
Set the task space controller in tracking or non-tracking mode.
yarp::dev::PolyDriver polyHand
virtual bool disableArmWaving()
Disable the waving mode.
virtual bool addHandSequence(const std::string &handSeqKey, const yarp::os::Bottle &sequence)
Define an hand motion sequence from a configuration bottle.
virtual bool isValidHandSeq(const std::string &handSeqKey)
Check whether a sequence key is defined.
virtual ~ActionPrimitives()
Destructor.
virtual bool unlockActions()
Enable the possibility to yield new actions.
virtual bool getPose(yarp::sig::Vector &x, yarp::sig::Vector &o) const
Get the current arm pose.
virtual void close()
Deallocate the object.
iCub::action::ActionPrimitives::ActionsQueue actionsQueue
yarp::dev::IControlMode * modCtrl
ActionPrimitivesCallback * actionClb
virtual bool areFingersMoving(bool &f)
Query if fingers are moving.
yarp::os::PeriodicThread * armWaver
virtual bool cmdArmWP(const Action &action)
virtual bool getHandSequence(const std::string &handSeqKey, yarp::os::Bottle &sequence)
Return a hand sequence.
virtual bool execQueuedAction()
virtual bool reachPosition(const yarp::sig::Vector &x, const double execTime=ACTIONPRIM_DISABLE_EXECTIME)
Immediately update the current reaching target (without affecting the actions queue) or initiate a ne...
std::mutex mtx_motionStartEvent
double latchTimerReachLog
virtual bool stopControl()
Stop any ongoing arm/hand movements.
virtual bool setDefaultExecTime(const double execTime)
Set the default arm movement execution time.
virtual bool cmdArm(const Action &action)
virtual bool getTrackingMode() const
Get the current controller mode.
virtual bool checkActionOnGoing(bool &f, const bool sync=false)
Check whether an action is still ongoing.
friend class ArmWayPoints
ActionPrimitives()
Default Constructor.
std::map< std::string, std::deque< HandWayPoint > > handSeqMap
yarp::sig::Vector enableTorsoSw
yarp::sig::Vector curGraspDetectionThres
virtual bool configHandSeq(yarp::os::Property &opt)
virtual double getDefaultExecTime() const
Get the current default arm movement execution time.
yarp::dev::IPositionControl * posCtrl
virtual bool configGraspModel(yarp::os::Property &opt)
virtual bool open(yarp::os::Property &opt)
Configure the object.
virtual bool getGraspModel(perception::Model *&model) const
Return the model used internally to detect external contacts.
virtual bool reachPose(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const double execTime=ACTIONPRIM_DISABLE_EXECTIME)
Immediately update the current reaching target (without affecting the actions queue) or initiate a ne...
virtual void printMessage(const int logtype, const char *format,...) const
yarp::sig::Vector curHandTols
yarp::dev::PolyDriver polyCart
virtual bool getActionsLockStatus() const
Return the actions lock status.
yarp::dev::IEncoders * encCtrl
std::mutex mtx_motionDoneEvent
virtual void enableTorsoDof()
virtual bool addHandSeqWP(const std::string &handSeqKey, const yarp::sig::Vector &poss, const yarp::sig::Vector &vels, const yarp::sig::Vector &tols, const yarp::sig::Vector &thres, const double tmo)
Define an hand WayPoint (WP) to be added at the bottom of the hand motion sequence pointed by the key...
std::set< int > fingersMovingJntsSet
virtual bool clearActionsQueue()
Empty the actions queue.
virtual bool getCartesianIF(yarp::dev::ICartesianControl *&ctrl) const
Return the cartesian interface used internally to control the limb.
yarp::sig::Vector curHandFinalPoss
virtual bool pushAction(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const std::string &handSeqKey, const double execTime=ACTIONPRIM_DISABLE_EXECTIME, ActionPrimitivesCallback *clb=NULL)
Insert a combination of arm and hand primitive actions in the actions queue.
virtual bool disableReachingTimeout()
Disable timeout while reaching.
std::deque< std::string > getHandSeqList()
Return the list of available hand sequence keys.
virtual bool enableArmWaving(const yarp::sig::Vector &restPos)
Enable the waving mode that keeps on moving the arm around a predefined position.
virtual bool syncCheckReinstate()
Reinstate the blocking feature for future calls with sync switch on.
std::condition_variable cv_motionStartEvent
yarp::os::PeriodicThread * actionWP
virtual bool checkActionsDone(bool &f, const bool sync=false)
Check whether all the actions in queue are accomplished.
virtual bool isHandSeqEnded()
virtual bool handleTorsoDOF(yarp::os::Property &opt, const std::string &key)
virtual bool pushWaitState(const double tmo, ActionPrimitivesCallback *clb=NULL)
Insert a wait state in the actions queue.
yarp::dev::ICartesianControl * cartCtrl
ArmWavingMonitor(ICartesianControl *_cartCtrl)
void setRestPosition(const Vector &_restPos)
virtual ~ArmWavingMonitor()
void afterStart(bool success)
void set_default_exec_time(const double exec_time)
ArmWayPoints(ActionPrimitives *_action, const deque< ActionPrimitivesWayPoint > &_wayPoints)
ActionPrimitivesLayer2 * action
virtual void exec()
Defines the callback body to be called at the action end.
virtual void exec()
Defines the callback body to be called at the action end.
ActionPrimitivesLayer2 * action
A class for defining the versions of the iCub limbs.
An abstract class that provides basic methods for interfacing with the data acquisition.
virtual bool getOutput(yarp::os::Value &out) const =0
Provide the higher layers with the model output computed over the attached sensors.
virtual bool fromProperty(const yarp::os::Property &options)=0
Configure the model taking its parameters from a Property object.
A class that provides the user with a suitable framework to deal with the elastic approach for the pr...
A class that provides a mesaure of contact detection for each finger relying on tactile sensors.
double norm(const yarp::sig::Matrix &M, int col)
Returns the norm of the vector given in the form: matrix(:,col).
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.
ActionPrimitivesCallback * callback
Action callback that is executed when the waypoint is reached.
yarp::sig::Vector o
The 4x1 Vector specifying the orientation of the waypoint in axis-angle representation.
double granularity
The time granularity [s] used by the trajectory generator [s].
ActionPrimitivesWayPoint()
Default Constructor.
double trajTime
The arm execution time [s] accounting for the controller's responsivity.
yarp::sig::Vector x
The 3x1 Vector specifyng the position of the waypoint [m].
bool oEnabled
If this flag is set to true then orientation will be taken into account.
double duration
The time duration [s] to achieve the waypoint.
yarp::os::PeriodicThread * wayPointsThr
ActionPrimitivesCallback * clb