17#include <yarp/os/Log.h>
22using namespace yarp::os;
24using namespace yarp::sig;
25using namespace yarp::math;
34 yError(
"iKin: not implemented");
162 yWarning(
"Attempt to set joint angle to %g while blocked",_Ang);
172 double c_theta=cos(theta);
173 double s_theta=sin(theta);
197 return getH(c_override);
205 return getH(c_override);
209 double c_theta=cos(theta);
210 double s_theta=sin(theta);
212 int C=(
n>>1)&1 ? -1 : 1;
219 DnH(0,3)=-C*s_theta*
A;
224 DnH(1,3)=C*c_theta*
A;
231 DnH(0,3)=C*c_theta*
A;
236 DnH(1,3)=C*s_theta*
A;
313 yError(
"addLink() failed due to out of range index: %d>%d",i,
N);
335 yError(
"rmLink() failed due to out of range index: %d>=%d",i,
N);
406 yError(
"blockLink() failed due to out of range index: %d>=%d",i,
N);
429 for (j=i-1; j>=0; j--)
433 for (++j; j<=(int)i; j++)
436 for (; j<(int)
N && !
allList[j]->isCumulative(); j++)
447 yError(
"setBlockingValue() failed since the %dth link was not already blocked",i);
455 yError(
"setBlockingValue() failed due to out of range index: %d>=%d",i,
N);
475 yError(
"releaseLink() failed due to out of range index: %d>=%d",i,
N);
486 return allList[i]->isBlocked();
490 yError(
"isLinkBlocked() failed due to out of range index: %d>=%d",i,
N);
500 for (
unsigned int i=0; i<
N; i++)
508 for (
unsigned int i=0; i<
N; i++)
524 for (
unsigned int i=0; i<
N; i++)
564 if ((_H0.rows()==4) && (_H0.cols()==4))
572 yError(
"Attempt to reference a wrong matrix H0 (not 4x4)");
582 if ((_HN.rows()==4) && (_HN.cols()==4))
590 yError(
"Attempt to reference a wrong matrix HN (not 4x4)");
602 size_t sz=std::min(q.length(),(
size_t)
DOF);
603 for (
size_t i=0; i<sz; i++)
615 for (
unsigned int i=0; i<
DOF; i++)
638 yError(
"setAng() failed due to out of range index: %d>=%d",i,
N);
652 yError(
"getAng() failed due to out of range index: %d>=%d",i,
N);
664 r[0]=atan2(-R(2,1),R(2,2));
666 r[2]=atan2(-R(1,0),R(0,0));
677 dr[0]=(R(2,1)*dR(2,2) - R(2,2)*dR(2,1)) / (R(2,1)*R(2,1) + R(2,2)*R(2,2));
678 dr[1]=dR(2,0)/sqrt(fabs(1-R(2,0)*R(2,0)));
679 dr[2]=(R(1,0)*dR(0,0) - R(0,0)*dR(1,0)) / (R(1,0)*R(1,0) + R(0,0)*R(0,0));
687 const Matrix &dRj,
const Matrix &d2R)
691 double y,yi,yj,yij,
x,xi,xj,xij;
704 d2r[0]=((xj*yi+
x*yij-xij*
y-xi*yj)*tmp1 - 2.0*(
x*yi-xi*
y)*(
x*xj+
y*yj)) / (tmp1*tmp1);
712 tmp2 =sqrt(fabs(tmp1));
713 d2r[1]=(xij-(
x*xi*xj)/tmp1) / (tmp1*tmp2);
725 d2r[2]=((xj*yi+
x*yij-xij*
y-xi*yj)*tmp1 - 2.0*(
x*yi-xi*
y)*(
x*xj+
y*yj)) / (tmp1*tmp1);
767 for (
unsigned int j=0; j<=_i; j++)
768 H*=((*l)[j]->
getH(c_override));
782 unsigned int n=(
unsigned int)
quickList.size();
785 for (
unsigned int i=0; i<
n; i++)
805 Matrix
H=
getH(i,
true);
813 Vector r=dcm2axis(
H);
835 yError(
"Pose() failed due to out of range index: %d>=%d",i,
N);
845 return getH(i,
true).subcol(0,3,3);
858 Vector r=dcm2axis(
H);
896 return getH().subcol(0,3,3);
921 for (
unsigned int j=0; j<=i; j++)
925 for (
unsigned int k=0; k<=i; k++)
931 dH*=
allList[k]->getDnH(1,
true);
965 unsigned int n=(
unsigned int)
quickList.size();
970 for (
unsigned int i=0; i<
DOF; i++)
974 for (
unsigned int j=0; j<
n; j++)
1023 for (
unsigned int j=0; j<=i; j++)
1024 intH.push_back(intH[j]*
allList[j]->getH(
true));
1030 for (
unsigned int j=0; j<=i; j++)
1033 w=
cross(Z,2,PN-Z,3);
1059 for (
unsigned int i=0; i<
N; i++)
1060 intH.push_back(intH[i]*
allList[i]->getH(
true));
1064 for (
unsigned int i=0; i<
DOF; i++)
1066 unsigned int j=
hash[i];
1069 w=
cross(Z,2,PN-Z,3);
1107 yError(
"prepareForHessian() failed since DOF==0");
1119 yAssert((i<
DOF) && (j<
DOF));
1150 const unsigned int j)
1163 yError(
"prepareForHessian() failed due to out of range index: %d>=%d",lnk,
N);
1174 const unsigned int j)
1176 yAssert((i<lnk) && (j<lnk));
1207 Matrix dJ(6,
DOF); dJ.zero();
1208 double dqj,dqi,a,b,c;
1209 for (
unsigned int i=0; i<
DOF; i++)
1211 for (
unsigned int j=0; j<=i; j++)
1215 a=J(4,j)*J(2,i)-J(5,j)*J(1,i);
1216 b=J(5,j)*J(0,i)-J(3,j)*J(2,i);
1217 c=J(3,j)*J(1,i)-J(4,j)*J(0,i);
1221 dJ(3,i)+=dqj*(J(4,j)*J(5,i)-J(5,j)*J(4,i));
1222 dJ(4,i)+=dqj*(J(5,j)*J(3,i)-J(3,j)*J(5,i));
1223 dJ(5,i)+=dqj*(J(3,j)*J(4,i)-J(4,j)*J(3,i));
1255 Matrix dJ(6,lnk-1); dJ.zero();
1256 double dqj,dqi,a,b,c;
1257 for (
unsigned int i=0; i<lnk; i++)
1259 for (
unsigned int j=0; j<=i; j++)
1263 a=J(4,j)*J(2,i)-J(5,j)*J(1,i);
1264 b=J(5,j)*J(0,i)-J(3,j)*J(2,i);
1265 c=J(3,j)*J(1,i)-J(4,j)*J(0,i);
1269 dJ(3,i)+=dqj*(J(4,j)*J(5,i)-J(5,j)*J(4,i));
1270 dJ(4,i)+=dqj*(J(5,j)*J(3,i)-J(3,j)*J(5,i));
1271 dJ(5,i)+=dqj*(J(3,j)*J(4,i)-J(4,j)*J(3,i));
1354 if (Bottle *bH=options.find(tag).asList())
1360 for (
int cnt=0; (cnt<bH->size()) && (cnt<
H.rows()*
H.cols()); cnt++)
1362 H(i,j)=bH->get(cnt).asFloat64();
1377 Bottle b; Bottle &l=b.addList();
1378 for (
int r=0; r<
H.rows(); r++)
1379 for (
int c=0; c<
H.cols(); c++)
1380 l.addFloat64(
H(r,c));
1382 options.put(tag,b.get(0));
1391 type=options.check(
"type",Value(
"right")).asString();
1396 int numLinks=options.check(
"numLinks",Value(0)).asInt32();
1399 yError(
"invalid number of links specified!");
1408 for (
int i=0; i<numLinks; i++)
1413 Bottle &bLink=options.findGroup(link.str());
1416 yError(
"%s is missing!",link.str().c_str());
1425 double A=bLink.check(
"A",Value(0.0)).asFloat64();
1426 double D=bLink.check(
"D",Value(0.0)).asFloat64();
1427 double alpha=
CTRL_DEG2RAD*bLink.check(
"alpha",Value(0.0)).asFloat64();
1429 double min=
CTRL_DEG2RAD*bLink.check(
"min",Value(-180.0)).asFloat64();
1430 double max=
CTRL_DEG2RAD*bLink.check(
"max",Value(180.0)).asFloat64();
1434 if (bLink.check(
"blocked"))
1446 for (
unsigned int i=0; i<
N; i++)
1448 Bottle &link=links.addList();
1451 link.addString(tag.str());
1453 Bottle &
A=link.addList();
1455 A.addFloat64((*
this)[i].getA());
1457 Bottle &D=link.addList();
1459 D.addFloat64((*
this)[i].getD());
1461 Bottle &alpha=link.addList();
1462 alpha.addString(
"alpha");
1465 Bottle &
offset=link.addList();
1466 offset.addString(
"offset");
1469 Bottle &min=link.addList();
1470 min.addString(
"min");
1473 Bottle &max=link.addList();
1474 max.addString(
"max");
1477 if ((*
this)[i].isBlocked())
1479 Bottle &blocked=link.addList();
1480 blocked.addString(
"blocked");
1486 options.fromString(links.toString(),
false);
1488 options.put(
"type",
getType());
1489 options.put(
"numLinks",(
int)
N);
1529 for (
unsigned int i=0; i<limb.
getN(); i++)
1537 for (
unsigned int i=0; i<
linkList.size(); i++)
1555 size_t point=version.find(
'.');
1556 if ((point!=string::npos) && (point!=version.length()-1))
1558 v_major=strtoul(version.substr(0,point).c_str(),NULL,0);
1559 v_minor=strtoul(version.substr(point+1).c_str(),NULL,0);
1563 v_major=strtoul(version.c_str(),NULL,0);
1571 const unsigned long int v_minor)
1603 ostringstream version;
1605 return version.str();
1654 return (*
this<v) || (*
this==v);
1661 return (*
this>v) || (*
this==v);
1669 unsigned long int m2=0L;
1733 IControlLimits &limTorso=*lim[0];
1735 unsigned int iTorso;
1738 for (iTorso=0; iTorso<3; iTorso++)
1740 if (!limTorso.getLimits(iTorso,&min,&max))
1777 size_t underscore=
getType().find(
'_');
1778 if (underscore!=string::npos)
1780 arm=
getType().substr(0,underscore);
1846 type.replace(0,underscore,
"left");
1894 IControlLimits &limTorso=*lim[0];
1895 IControlLimits &limArm =*lim[1];
1897 unsigned int iTorso;
1901 for (iTorso=0; iTorso<3; iTorso++)
1903 if (!limTorso.getLimits(iTorso,&min,&max))
1918 for (iArm=0; iArm<
getN()-iTorso; iArm++)
1920 if (!limArm.getLimits(iArm,&min,&max))
1956 this->finger=
finger.finger;
1975 size_t underscore=
getType().find(
'_');
1976 if (underscore!=string::npos)
1981 underscore=
finger.find(
'_');
1982 if (underscore!=string::npos)
2008 H0(0,0)=0.121132;
H0(0,1)=0.043736;
H0(0,2)=-0.991672;
H0(0,3)=-0.025391770;
2009 H0(1,0)=-0.958978;
H0(1,1)=0.263104;
H0(1,2)=-0.105535;
H0(1,3)=-0.011783901;
2010 H0(2,0)=0.256297;
H0(2,1)=0.963776;
H0(2,2)=0.073812;
H0(2,3)=-0.0017018;
2011 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2016 H0(0,0)=0.478469;
H0(0,1)=0.063689;
H0(0,2)=-0.875792;
H0(0,3)=-0.024029759;
2017 H0(1,0)=-0.878095;
H0(1,1)=0.039246;
H0(1,2)=-0.476873;
H0(1,3)=-0.01193433;
2018 H0(2,0)=0.004;
H0(2,1)=0.997198;
H0(2,2)=0.074703;
H0(2,3)=-0.00168926;
2019 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2045 else if (
finger==
"index")
2047 H0(0,0)=0.898138;
H0(0,1)=0.439714;
H0(0,2)=0.0;
H0(0,3)=0.00245549;
2048 H0(1,0)=-0.43804;
H0(1,1)=0.89472;
H0(1,2)=0.087156;
H0(1,3)=-0.025320433;
2049 H0(2,0)=0.038324;
H0(2,1)=-0.078278;
H0(2,2)=0.996195;
H0(2,3)=-0.010973325;
2050 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2068 else if (
finger==
"middle")
2070 H0(0,0)=1.0;
H0(0,1)=0.0;
H0(0,2)=0.0;
H0(0,3)=0.0178;
2071 H0(1,0)=0.0;
H0(1,1)=0.0;
H0(1,2)=-1.0;
H0(1,3)=-0.00830233;
2072 H0(2,0)=0.0;
H0(2,1)=1.0;
H0(2,2)=0.0;
H0(2,3)=-0.0118;
2073 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2088 H0(0,0)=0.9998;
H0(0,1)=0.0192;
H0(0,2)=0.0;
H0(0,3)=0.001569230;
2089 H0(1,0)=0.0191;
H0(1,1)=-0.9960;
H0(1,2)=0.0872;
H0(1,3)=0.007158757;
2090 H0(2,0)=0.0017;
H0(2,1)=-0.0871;
H0(2,2)=-0.9962;
H0(2,3)=-0.011458935;
2091 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2109 else if (
finger==
"little")
2111 H0(0,0)=0.9998;
H0(0,1)=0.0192;
H0(0,2)=0.0;
H0(0,3)=-0.00042147;
2112 H0(1,0)=0.0191;
H0(1,1)=-0.9960;
H0(1,2)=0.0872;
H0(1,3)=0.0232755;
2113 H0(2,0)=0.0017;
H0(2,1)=-0.0871;
H0(2,2)=-0.9962;
H0(2,3)=-0.00956329;
2114 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2149 IControlLimits &limFinger=*lim[0];
2154 if (!limFinger.getLimits(8,&min,&max))
2160 if (!limFinger.getLimits(9,&min,&max))
2166 if (!limFinger.getLimits(10,&min,&max))
2174 else if (
finger==
"index")
2176 if (!limFinger.getLimits(7,&min,&max))
2181 (*this)[0].setMin(0.0);
2184 if (!limFinger.getLimits(11,&min,&max))
2190 if (!limFinger.getLimits(12,&min,&max))
2198 else if (
finger==
"middle")
2200 if (!limFinger.getLimits(13,&min,&max))
2206 if (!limFinger.getLimits(14,&min,&max))
2216 if (!limFinger.getLimits(7,&min,&max))
2221 (*this)[0].setMin(0.0);
2224 if (!limFinger.getLimits(15,&min,&max))
2241 Vector &chainJoints)
2243 if ((motorEncoders.length()!=9) && (motorEncoders.length()!=16))
2246 int offs=(motorEncoders.length()==16?7:0);
2250 chainJoints.resize(4);
2251 chainJoints[0]=motorEncoders[offs+1];
2252 chainJoints[1]=motorEncoders[offs+2];
2253 chainJoints[2]=motorEncoders[offs+3]/2.0;
2254 chainJoints[3]=chainJoints[2];
2256 else if (
finger==
"index")
2258 chainJoints.resize(4);
2260 chainJoints[1]=motorEncoders[offs+4];
2261 chainJoints[2]=motorEncoders[offs+5]/2.0;
2262 chainJoints[3]=chainJoints[2];
2264 else if (
finger==
"middle")
2266 chainJoints.resize(3);
2267 chainJoints[0]=motorEncoders[offs+6];
2268 chainJoints[1]=motorEncoders[offs+7]/2.0;
2269 chainJoints[2]=chainJoints[1];
2273 chainJoints.resize(4);
2275 chainJoints[1]=motorEncoders[offs+8]/3.0;
2276 chainJoints[3]=chainJoints[2]=chainJoints[1];
2287 const Vector &jointEncoders,
2288 Vector &chainJoints,
2289 const Matrix &jointEncodersBounds)
2291 if (((motorEncoders.length()!=9) && (motorEncoders.length()!=16)) ||
2292 (jointEncoders.length()<15) || (jointEncodersBounds.cols()<2))
2295 int offs=(motorEncoders.length()==16?7:0);
2297 Matrix bounds=jointEncodersBounds;
2298 if (bounds.rows()!=jointEncoders.length())
2300 bounds=
zeros((
unsigned int)jointEncoders.length(),2);
2301 for (
size_t r=0; r<jointEncoders.length(); r++)
2307 chainJoints.resize(4);
2308 chainJoints[0]=motorEncoders[offs+1];
2309 for (
unsigned int i=1; i<chainJoints.length(); i++)
2312 double span=bounds(i-1,1)-bounds(i-1,0);
2314 c=std::min(1.0,std::max(0.0,(jointEncoders[i-1]-bounds(i-1,0))/span));
2316 c=1.0-std::min(1.0,std::max(0.0,(bounds(i-1,1)-jointEncoders[i-1])/span));
2317 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*
this)(i).getMin())+(*
this)(i).getMin());
2320 else if (
finger==
"index")
2322 chainJoints.resize(4);
2324 for (
unsigned int i=1; i<chainJoints.length(); i++)
2327 double span=bounds(i+2,1)-bounds(i+2,0);
2329 c=std::min(1.0,std::max(0.0,(jointEncoders[i+2]-bounds(i+2,0))/span));
2331 c=1.0-std::min(1.0,std::max(0.0,(bounds(i+2,1)-jointEncoders[i+2])/span));
2332 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*
this)(i).getMin())+(*
this)(i).getMin());
2335 else if (
finger==
"middle")
2337 chainJoints.resize(3);
2338 for (
unsigned int i=0; i<chainJoints.length(); i++)
2341 double span=bounds(i+6,1)-bounds(i+6,0);
2343 c=std::min(1.0,std::max(0.0,(jointEncoders[i+6]-bounds(i+6,0))/span));
2345 c=1.0-std::min(1.0,std::max(0.0,(bounds(i+6,1)-jointEncoders[i+6])/span));
2346 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*
this)(i).getMin())+(*
this)(i).getMin());
2351 chainJoints.resize(4);
2353 for (
unsigned int i=1; i<chainJoints.length(); i++)
2356 double span=bounds(i+8,1)-bounds(i+8,0);
2358 c=std::min(1.0,std::max(0.0,(jointEncoders[i+8]-bounds(i+8,0))/span));
2360 c=1.0-std::min(1.0,std::max(0.0,(bounds(i+8,1)-jointEncoders[i+8])/span));
2361 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*
this)(i).getMin())+(*
this)(i).getMin());
2364 else if (
finger==
"little")
2366 chainJoints.resize(4);
2368 for (
unsigned int i=1; i<chainJoints.length(); i++)
2371 double span=bounds(i+11,1)-bounds(i+11,0);
2373 c=std::min(1.0,std::max(0.0,(jointEncoders[i+11]-bounds(i+11,0))/span));
2375 c=1.0-std::min(1.0,std::max(0.0,(bounds(i+11,1)-jointEncoders[i+11])/span));
2376 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*
this)(i).getMin())+(*
this)(i).getMin());
2404 size_t underscore=
getType().find(
'_');
2405 if (underscore!=string::npos)
2407 leg=
getType().substr(0,underscore);
2521 IControlLimits &limLeg=*lim[0];
2526 for (iLeg=0; iLeg<
getN(); iLeg++)
2528 if (!limLeg.getLimits(iLeg,&min,&max))
2557 size_t underscore=
getType().find(
'_');
2558 if (underscore!=string::npos)
2560 eye=
getType().substr(0,underscore);
2689 Matrix
HN=yarp::math::eye(4, 4);
2696 Matrix
HN=yarp::math::eye(4, 4);
2713 IControlLimits &limTorso=*lim[0];
2714 IControlLimits &limHead =*lim[1];
2716 unsigned int iTorso;
2720 for (iTorso=0; iTorso<3; iTorso++)
2722 if (!limTorso.getLimits(iTorso,&min,&max))
2737 for (iHead=0; iHead<
getN()-iTorso; iHead++)
2739 if (!limHead.getLimits(iHead,&min,&max))
2797 (*this)[
getN()-2].setD(0.0);
2940 IControlLimits &limTorso=*lim[0];
2941 IControlLimits &limHead =*lim[1];
2943 unsigned int iTorso;
2947 for (iTorso=0; iTorso<3; iTorso++)
2949 if (!limTorso.getLimits(iTorso,&min,&max))
2965 for (iHead=0; iHead<3; iHead++)
2967 if (!limHead.getLimits(iHead,&min,&max))
virtual void allocate(const std::string &_type)
iCubArm()
Default constructor.
virtual bool alignJointsBounds(const std::deque< yarp::dev::IControlLimits * > &lim)
Alignes the Arm joints bounds with current values set aboard the iCub.
virtual void allocate(const std::string &_type)
iCubEyeNeckRef()
Default constructor.
virtual void allocate(const std::string &_type)
virtual bool alignJointsBounds(const std::deque< yarp::dev::IControlLimits * > &lim)
Alignes the Eye joints bounds with current values set aboard the iCub.
iCubEye()
Default constructor.
virtual bool alignJointsBounds(const std::deque< yarp::dev::IControlLimits * > &lim)
Alignes the finger joints bounds with current values set aboard the iCub.
virtual void clone(const iCubFinger &finger)
iCubFinger()
Default constructor.
virtual bool getChainJoints(const yarp::sig::Vector &motorEncoders, yarp::sig::Vector &chainJoints)
Retrieves the vector of actual finger's joint values (to be used in conjuction with the iKinLimb meth...
iCubFinger & operator=(const iCubFinger &finger)
Copies a Finger object into the current one.
double fingers_abduction_max
virtual void allocate(const std::string &_type)
virtual void allocate(const std::string &_type)
iCubHeadCenter()
Default constructor.
virtual void allocate(const std::string &_type)
iCubInertialSensorWaist()
Default constructor.
iCubInertialSensor()
Default constructor.
virtual void allocate(const std::string &_type)
virtual bool alignJointsBounds(const std::deque< yarp::dev::IControlLimits * > &lim)
Alignes the Inertial Sensor joints bounds with current values set aboard the iCub.
iCubLeg()
Default constructor.
virtual void allocate(const std::string &_type)
virtual bool alignJointsBounds(const std::deque< yarp::dev::IControlLimits * > &lim)
Alignes the Leg joints bounds with current values set aboard the iCub.
virtual void allocate(const std::string &_type)
iCubTorso()
Default constructor.
virtual bool alignJointsBounds(const std::deque< yarp::dev::IControlLimits * > &lim)
Alignes the Torso joints bounds with current values set aboard the iCub.
void popLink()
Removes a Link from the bottom of the Chain.
yarp::sig::Matrix getHN() const
Returns HN, the rigid roto-translation matrix from the Nth frame to the end-effector.
yarp::sig::Vector Position(const unsigned int i)
Returns the 3D position coordinates of ith Link.
bool setHN(const yarp::sig::Matrix &_HN)
Sets HN, the rigid roto-translation matrix from the Nth frame to the end-effector.
void prepareForHessian()
Prepares computation for a successive call to fastHessian_ij().
yarp::sig::Matrix GeoJacobian()
Returns the geometric Jacobian of the end-effector.
yarp::sig::Vector EndEffPosition()
Returns the 3D coordinates of end-effector position.
yarp::sig::Vector d2RotAng(const yarp::sig::Matrix &R, const yarp::sig::Matrix &dRi, const yarp::sig::Matrix &dRj, const yarp::sig::Matrix &d2R)
yarp::sig::Vector Hessian_ij(const unsigned int i, const unsigned int j)
Returns the 6x1 vector where is the forward kinematic function and is the DOF couple.
void pushLink(iKinLink &l)
Adds a Link at the bottom of the Chain.
bool isLinkBlocked(const unsigned int i)
Queries whether the ith Link is blocked.
iKinChain & operator--(int)
Removes a Link from the bottom of the Chain.
yarp::sig::Matrix AnaJacobian(const unsigned int i, unsigned int col)
Returns the analitical Jacobian of the ith link.
bool releaseLink(const unsigned int i)
Releases the ith Link.
virtual void clone(const iKinChain &c)
void clear()
Removes all Links.
void setAllLinkVerbosity(unsigned int _verbose)
Sets the verbosity level of all Links belonging to the Chain.
yarp::sig::Vector fastHessian_ij(const unsigned int i, const unsigned int j)
Returns the 6x1 vector where is the forward kinematic function and is the DOF couple.
bool setBlockingValue(const unsigned int i, double Ang)
Changes the value of the ith blocked Link.
void setVerbosity(unsigned int _verbose)
Sets the verbosity level of the Chain.
void setConstraint(unsigned int i, bool _constrained)
Sets the constraint status of ith link.
iKinChain & operator=(const iKinChain &c)
Copies a Chain object into the current one.
bool rmLink(const unsigned int i)
Removes the ith Link from the Chain.
std::deque< unsigned int > hash_dof
iKinChain()
Default constructor.
yarp::sig::Vector EndEffPose(const bool axisRep=true)
Returns the coordinates of end-effector.
yarp::sig::Vector Pose(const unsigned int i, const bool axisRep=true)
Returns the coordinates of ith Link.
bool addLink(const unsigned int i, iKinLink &l)
Adds a Link at the position ith within the Chain.
yarp::sig::Vector getAng()
Returns the current free joint angles values.
yarp::sig::Vector setAng(const yarp::sig::Vector &q)
Sets the free joint angles to values of q[i].
std::deque< unsigned int > hash
yarp::sig::Matrix getH()
Returns the rigid roto-translation matrix from the root reference frame to the end-effector frame in ...
yarp::sig::Vector dRotAng(const yarp::sig::Matrix &R, const yarp::sig::Matrix &dR)
virtual ~iKinChain()
Destructor.
std::deque< iKinLink * > quickList
yarp::sig::Matrix DJacobian(const yarp::sig::Vector &dq)
Compute the time derivative of the geometric Jacobian.
yarp::sig::Vector RotAng(const yarp::sig::Matrix &R)
unsigned int getN() const
Returns the number of Links belonging to the Chain.
yarp::sig::Matrix hess_Jlnk
bool blockLink(const unsigned int i, double Ang)
Blocks the ith Link at the a certain value of its joint angle.
bool setH0(const yarp::sig::Matrix &_H0)
Sets H0, the rigid roto-translation matrix from the root reference frame to the 0th frame.
void setAllConstraints(bool _constrained)
Sets the constraint status of all chain links.
iKinChain & operator<<(iKinLink &l)
Adds a Link at the bottom of the Chain.
std::deque< iKinLink * > allList
A class for defining the versions of the iCub limbs.
iKinLimbVersion operator-(const iKinLimbVersion &v) const
Overloaded - operator.
iKinLimbVersion & operator=(const iKinLimbVersion &v)
Overloaded assignment operator.
unsigned long int v_minor
bool operator==(const iKinLimbVersion &v) const
Overloaded == operator.
bool operator<=(const iKinLimbVersion &v) const
Overloaded <= operator.
bool operator>=(const iKinLimbVersion &v) const
Overloaded >=</=> operator.
bool operator!=(const iKinLimbVersion &v) const
Overloaded != operator.
unsigned long int get_minor() const
Return the minor version.
unsigned long int get_major() const
Return the major version.
bool operator>(const iKinLimbVersion &v) const
Overloaded > operator.
bool operator<(const iKinLimbVersion &v) const
Overloaded < operator.
unsigned long int v_major
iKinLimbVersion()
Default Constructor.
std::string get_version() const
Return the version string.
std::deque< iKinLink * > linkList
virtual void getMatrixFromProperties(const yarp::os::Property &options, const std::string &tag, yarp::sig::Matrix &H)
virtual ~iKinLimb()
Destructor.
bool rmLink(const unsigned int i)
bool fromLinksProperties(const yarp::os::Property &options)
Initializes the Limb from a list of properties wherein links parameters are specified.
std::string getType() const
Returns the Limb type as a string.
iKinChain & operator=(const iKinChain &c)
virtual void allocate(const std::string &_type)
bool toLinksProperties(yarp::os::Property &options)
Provides the links attributes listed in a property object.
void pushLink(iKinLink &l)
virtual void setMatrixToProperties(yarp::os::Property &options, const std::string &tag, yarp::sig::Matrix &H)
iKinLimb()
Default constructor.
virtual void clone(const iKinLimb &limb)
A Base class for defining a Link with standard Denavit-Hartenberg convention.
double setAng(double _Ang)
Sets the joint angle value.
void setAlpha(const double _Alpha)
Sets the Link twist Alpha.
void setMax(const double _Max)
Sets the joint angle higher bound.
yarp::sig::Matrix getDnH(unsigned int n=1, bool c_override=false)
Computes the derivative of order n of the homogeneous transformation matrix H with respect to the joi...
void addCumH(const yarp::sig::Matrix &_cumH)
iKinLink & operator=(const iKinLink &l)
Copies a Link object into the current one.
void setMin(const double _Min)
Sets the joint angle lower bound.
yarp::sig::Matrix getH(bool c_override=false)
Computes the homogeneous transformation matrix H of the Link.
const yarp::sig::Vector zeros1
virtual void clone(const iKinLink &l)
void setD(const double _D)
Sets the Link offset D.
const yarp::sig::Matrix zeros1x1
yarp::sig::Vector cross(const yarp::sig::Matrix &A, int colA, const yarp::sig::Matrix &B, int colB)
Returns the cross product between two vectors given in the form: matrix(:,col).
void notImplemented(const unsigned int verbose)