17 #include <yarp/os/Log.h>
22 using namespace yarp::os;
24 using namespace yarp::sig;
25 using namespace yarp::math;
34 yError(
"iKin: not implemented");
39 iKinLink::iKinLink(
double _A,
double _D,
double _Alpha,
double _Offset,
40 double _Min,
double _Max): zeros1x1(
zeros(1,1)), zeros1(
zeros(1))
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)");
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();
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");
1485 links.write(options);
1487 options.put(
"type",
getType());
1488 options.put(
"numLinks",(
int)
N);
1528 for (
unsigned int i=0; i<limb.
getN(); i++)
1536 for (
unsigned int i=0; i<
linkList.size(); i++)
1554 size_t point=version.find(
'.');
1555 if ((point!=string::npos) && (point!=version.length()-1))
1557 v_major=strtoul(version.substr(0,point).c_str(),NULL,0);
1558 v_minor=strtoul(version.substr(point+1).c_str(),NULL,0);
1562 v_major=strtoul(version.c_str(),NULL,0);
1570 const unsigned long int v_minor)
1602 ostringstream version;
1604 return version.str();
1653 return (*
this<v) || (*
this==v);
1660 return (*
this>v) || (*
this==v);
1668 unsigned long int m2=0L;
1732 IControlLimits &limTorso=*lim[0];
1734 unsigned int iTorso;
1737 for (iTorso=0; iTorso<3; iTorso++)
1739 if (!limTorso.getLimits(iTorso,&
min,&
max))
1776 size_t underscore=
getType().find(
'_');
1777 if (underscore!=string::npos)
1779 arm=
getType().substr(0,underscore);
1845 type.replace(0,underscore,
"left");
1893 IControlLimits &limTorso=*lim[0];
1894 IControlLimits &limArm =*lim[1];
1896 unsigned int iTorso;
1900 for (iTorso=0; iTorso<3; iTorso++)
1902 if (!limTorso.getLimits(iTorso,&
min,&
max))
1917 for (iArm=0; iArm<
getN()-iTorso; iArm++)
1919 if (!limArm.getLimits(iArm,&
min,&
max))
1955 this->finger=
finger.finger;
1974 size_t underscore=
getType().find(
'_');
1975 if (underscore!=string::npos)
1980 underscore=
finger.find(
'_');
1981 if (underscore!=string::npos)
2007 H0(0,0)=0.121132;
H0(0,1)=0.043736;
H0(0,2)=-0.991672;
H0(0,3)=-0.025391770;
2008 H0(1,0)=-0.958978;
H0(1,1)=0.263104;
H0(1,2)=-0.105535;
H0(1,3)=-0.011783901;
2009 H0(2,0)=0.256297;
H0(2,1)=0.963776;
H0(2,2)=0.073812;
H0(2,3)=-0.0017018;
2010 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2015 H0(0,0)=0.478469;
H0(0,1)=0.063689;
H0(0,2)=-0.875792;
H0(0,3)=-0.024029759;
2016 H0(1,0)=-0.878095;
H0(1,1)=0.039246;
H0(1,2)=-0.476873;
H0(1,3)=-0.01193433;
2017 H0(2,0)=0.004;
H0(2,1)=0.997198;
H0(2,2)=0.074703;
H0(2,3)=-0.00168926;
2018 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2044 else if (
finger==
"index")
2046 H0(0,0)=0.898138;
H0(0,1)=0.439714;
H0(0,2)=0.0;
H0(0,3)=0.00245549;
2047 H0(1,0)=-0.43804;
H0(1,1)=0.89472;
H0(1,2)=0.087156;
H0(1,3)=-0.025320433;
2048 H0(2,0)=0.038324;
H0(2,1)=-0.078278;
H0(2,2)=0.996195;
H0(2,3)=-0.010973325;
2049 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2067 else if (
finger==
"middle")
2069 H0(0,0)=1.0;
H0(0,1)=0.0;
H0(0,2)=0.0;
H0(0,3)=0.0178;
2070 H0(1,0)=0.0;
H0(1,1)=0.0;
H0(1,2)=-1.0;
H0(1,3)=-0.00830233;
2071 H0(2,0)=0.0;
H0(2,1)=1.0;
H0(2,2)=0.0;
H0(2,3)=-0.0118;
2072 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2087 H0(0,0)=0.9998;
H0(0,1)=0.0192;
H0(0,2)=0.0;
H0(0,3)=0.001569230;
2088 H0(1,0)=0.0191;
H0(1,1)=-0.9960;
H0(1,2)=0.0872;
H0(1,3)=0.007158757;
2089 H0(2,0)=0.0017;
H0(2,1)=-0.0871;
H0(2,2)=-0.9962;
H0(2,3)=-0.011458935;
2090 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2108 else if (
finger==
"little")
2110 H0(0,0)=0.9998;
H0(0,1)=0.0192;
H0(0,2)=0.0;
H0(0,3)=-0.00042147;
2111 H0(1,0)=0.0191;
H0(1,1)=-0.9960;
H0(1,2)=0.0872;
H0(1,3)=0.0232755;
2112 H0(2,0)=0.0017;
H0(2,1)=-0.0871;
H0(2,2)=-0.9962;
H0(2,3)=-0.00956329;
2113 H0(3,0)=0.0;
H0(3,1)=0.0;
H0(3,2)=0.0;
H0(3,3)=1.0;
2148 IControlLimits &limFinger=*lim[0];
2153 if (!limFinger.getLimits(8,&
min,&
max))
2159 if (!limFinger.getLimits(9,&
min,&
max))
2165 if (!limFinger.getLimits(10,&
min,&
max))
2173 else if (
finger==
"index")
2175 if (!limFinger.getLimits(7,&
min,&
max))
2180 (*this)[0].setMin(0.0);
2183 if (!limFinger.getLimits(11,&
min,&
max))
2189 if (!limFinger.getLimits(12,&
min,&
max))
2197 else if (
finger==
"middle")
2199 if (!limFinger.getLimits(13,&
min,&
max))
2205 if (!limFinger.getLimits(14,&
min,&
max))
2215 if (!limFinger.getLimits(7,&
min,&
max))
2220 (*this)[0].setMin(0.0);
2223 if (!limFinger.getLimits(15,&
min,&
max))
2240 Vector &chainJoints)
2242 if ((motorEncoders.length()!=9) && (motorEncoders.length()!=16))
2245 int offs=(motorEncoders.length()==16?7:0);
2249 chainJoints.resize(4);
2250 chainJoints[0]=motorEncoders[offs+1];
2251 chainJoints[1]=motorEncoders[offs+2];
2252 chainJoints[2]=motorEncoders[offs+3]/2.0;
2253 chainJoints[3]=chainJoints[2];
2255 else if (
finger==
"index")
2257 chainJoints.resize(4);
2259 chainJoints[1]=motorEncoders[offs+4];
2260 chainJoints[2]=motorEncoders[offs+5]/2.0;
2261 chainJoints[3]=chainJoints[2];
2263 else if (
finger==
"middle")
2265 chainJoints.resize(3);
2266 chainJoints[0]=motorEncoders[offs+6];
2267 chainJoints[1]=motorEncoders[offs+7]/2.0;
2268 chainJoints[2]=chainJoints[1];
2272 chainJoints.resize(4);
2274 chainJoints[1]=motorEncoders[offs+8]/3.0;
2275 chainJoints[3]=chainJoints[2]=chainJoints[1];
2286 const Vector &jointEncoders,
2287 Vector &chainJoints,
2288 const Matrix &jointEncodersBounds)
2290 if (((motorEncoders.length()!=9) && (motorEncoders.length()!=16)) ||
2291 (jointEncoders.length()<15) || (jointEncodersBounds.cols()<2))
2294 int offs=(motorEncoders.length()==16?7:0);
2296 Matrix bounds=jointEncodersBounds;
2297 if (bounds.rows()!=jointEncoders.length())
2299 bounds=
zeros((
unsigned int)jointEncoders.length(),2);
2300 for (
size_t r=0; r<jointEncoders.length(); r++)
2306 chainJoints.resize(4);
2307 chainJoints[0]=motorEncoders[offs+1];
2308 for (
unsigned int i=1; i<chainJoints.length(); i++)
2311 double span=bounds(i-1,1)-bounds(i-1,0);
2316 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*this)(i).getMin())+(*
this)(i).getMin());
2319 else if (
finger==
"index")
2321 chainJoints.resize(4);
2323 for (
unsigned int i=1; i<chainJoints.length(); i++)
2326 double span=bounds(i+2,1)-bounds(i+2,0);
2331 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*this)(i).getMin())+(*
this)(i).getMin());
2334 else if (
finger==
"middle")
2336 chainJoints.resize(3);
2337 for (
unsigned int i=0; i<chainJoints.length(); i++)
2340 double span=bounds(i+6,1)-bounds(i+6,0);
2345 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*this)(i).getMin())+(*
this)(i).getMin());
2350 chainJoints.resize(4);
2352 for (
unsigned int i=1; i<chainJoints.length(); i++)
2355 double span=bounds(i+8,1)-bounds(i+8,0);
2360 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*this)(i).getMin())+(*
this)(i).getMin());
2363 else if (
finger==
"little")
2365 chainJoints.resize(4);
2367 for (
unsigned int i=1; i<chainJoints.length(); i++)
2370 double span=bounds(i+11,1)-bounds(i+11,0);
2374 c=1.0-
std::min(1.0,
std::max(0.0,(bounds(i+11,1)-jointEncoders[i+11])/span));
2375 chainJoints[i]=
CTRL_RAD2DEG*(c*((*this)(i).getMax()-(*this)(i).getMin())+(*
this)(i).getMin());
2403 size_t underscore=
getType().find(
'_');
2404 if (underscore!=string::npos)
2406 leg=
getType().substr(0,underscore);
2520 IControlLimits &limLeg=*lim[0];
2525 for (iLeg=0; iLeg<
getN(); iLeg++)
2527 if (!limLeg.getLimits(iLeg,&
min,&
max))
2556 size_t underscore=
getType().find(
'_');
2557 if (underscore!=string::npos)
2559 eye=
getType().substr(0,underscore);
2666 Matrix
HN=yarp::math::eye(4, 4);
2674 Matrix
HN=yarp::math::eye(4, 4);
2691 IControlLimits &limTorso=*lim[0];
2692 IControlLimits &limHead =*lim[1];
2694 unsigned int iTorso;
2698 for (iTorso=0; iTorso<3; iTorso++)
2700 if (!limTorso.getLimits(iTorso,&
min,&
max))
2715 for (iHead=0; iHead<
getN()-iTorso; iHead++)
2717 if (!limHead.getLimits(iHead,&
min,&
max))
2775 (*this)[
getN()-2].setD(0.0);
2893 IControlLimits &limTorso=*lim[0];
2894 IControlLimits &limHead =*lim[1];
2896 unsigned int iTorso;
2900 for (iTorso=0; iTorso<3; iTorso++)
2902 if (!limTorso.getLimits(iTorso,&
min,&
max))
2918 for (iHead=0; iHead<3; iHead++)
2920 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.
A class for defining the iCub Eye.
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.
A class for defining the iCub Finger.
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.
A Base class for defining a Serial Link Chain.
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.
A class for defining generic Limb.
std::deque< iKinLink * > linkList
virtual void getMatrixFromProperties(const yarp::os::Property &options, const std::string &tag, yarp::sig::Matrix &H)
iKinChain & operator=(const iKinChain &c)
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.
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.
virtual void clone(const iKinLink &l)
void setD(const double _D)
Sets the Link offset D.
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)