18 #include <yarp/sig/Vector.h>
19 #include <yarp/sig/Matrix.h>
28 using namespace yarp::sig;
55 :
iDynNode(
"node with arms, torso and head")
64 Matrix Harm_right(4,4); Harm_right.eye();
65 Matrix Htorso(4,4); Htorso.eye();
66 Matrix Hhead(4,4); Hhead.eye();
67 Matrix Harm_left(4,4); Harm_left.eye();
71 Harm_right(0,0) = -cos(theta); Harm_right(0,1) = 0.0; Harm_right(0,2) = -sin(theta); Harm_right(0,3) = 0.00294;
72 Harm_right(1,0) = 0.0; Harm_right(1,1) = -1.0; Harm_right(1,2) = 0.0; Harm_right(1,3) = -0.050;
73 Harm_right(2,0) = -sin(theta); Harm_right(2,1) = 0.0; Harm_right(2,2) = cos(theta); Harm_right(2,3) = 0.10997;
74 Harm_right(3,3) = 1.0;
85 H0.zero(); H0(0,1)=-1.0; H0(1,2)=-1.0; H0(2,0)=1.0; H0(3,3)=1.0;
91 addLimb(arm_right,Harm_right);
92 addLimb(torso,Htorso);
94 addLimb(arm_left,Harm_left);
155 for(
int i=0;i<m.rows();i++)
157 for(
int j=0;j<m.cols();j++)
158 cout<<setw(15)<<m(i,j);
165 for(
size_t j=0;j<v.length();j++)
166 cout<<setw(15)<<v(j);
179 cout<<endl<<
"Node <"<<node.
toString()<<
"> created"<<endl;
185 Vector q_torso(node.
torso->
getN()); q_torso.zero();
186 Vector q_head(node.
head->
getN()); q_head.zero();
196 Matrix J(6,1); J.zero();
197 Vector pose(6); pose.zero();
206 <<
"************************\n"
207 <<
"* 1 - torso to right arm \n"
208 <<
"* 2 - torso to left arm \n"
209 <<
"* 3 - torso to head \n"
210 <<
"* 4 - head to right arm \n"
211 <<
"* 5 - head to left arm \n"
212 <<
"* 6 - head to torso \n"
213 <<
"* 7 - right arm to left arm \n"
214 <<
"* 8 - left arm to right arm \n"
218 <<
"* Enter your choice: ";
231 case 'q': cout<<
" .. quitting, bye.\n"<<endl;
ok=
false;
break;
232 default: cout<<
" .. this is not a correct choice!!\n"<<endl;
ok=
false;
244 cout<<endl<<
"\n\n************************\n\n";
Vector Pose_HeadArmRight(bool axisRep=false)
Vector Pose_TorsoArmLeft(bool axisRep=false)
Matrix Jacobian_TorsoArmLeft()
Matrix Jacobian_TorsoHead()
Vector Pose_HeadArmLeft(bool axisRep=false)
Matrix Jacobian_ArmRightArmLeft()
Matrix Jacobian_TorsoArmRight()
Vector Pose_HeadTorso(bool axisRep=false)
Matrix Jacobian_ArmLeftArmRight()
Matrix Jacobian_HeadArmLeft()
Vector Pose_ArmLeftArmRight(bool axisRep=false)
Vector Pose_TorsoHead(bool axisRep=false)
Matrix Jacobian_HeadTorso()
Vector Pose_TorsoArmRight(bool axisRep=false)
Vector Pose_ArmRightArmLeft(bool axisRep=false)
Matrix Jacobian_HeadArmRight()
A class for defining the 7-DOF iCub Arm in the iDyn framework.
A class for defining the 3-DOF Inertia Sensor Kinematics.
A class for defining the 3-DOF iCub Torso in the iDyn framework.
yarp::sig::Vector setAng(const yarp::sig::Vector &q)
Sets the free joint angles to values of q[i].
A class for defining a generic Limb within the iDyn framework.
A class for connecting two or mutiple limbs and exchanging kinematic and wrench information between l...
void setVerbosity(unsigned int _verbose)
Sets the verbosity level of the Chain.
unsigned int getN() const
Returns the number of Links belonging to the Chain.
bool setH0(const yarp::sig::Matrix &_H0)
Sets H0, the rigid roto-translation matrix from the root reference frame to the 0th frame.
int main(int argc, char *argv[])
void printVector(const string &s, const Vector &v)
void printMatrix(const string &s, const Matrix &m)
Copyright (C) 2008 RobotCub Consortium.