15#include <yarp/sig/Vector.h>
16#include <yarp/sig/Matrix.h>
22using namespace yarp::sig;
31 for(
int i=0;i<m.rows();i++)
33 for(
int j=0;j<m.cols();j++)
34 cout<<setw(15)<<m(i,j);
42 for(
size_t j=0;j<v.length();j++)
90 Vector q(arm->
getN()); q.zero();
91 Vector dq(q); Vector ddq(q);
103 Vector w0(3); Vector dw0(3); Vector ddp0(3);
104 w0=dw0=ddp0=0.0; ddp0[2]=9.81;
109 Vector Fsens(3); Fsens.zero();
111 Vector Musens(3); Musens.zero();
128 cout<<
"iCubArmNoTorsoDyn has "<<arm->
getN()<<
" links."<<endl;
137 printVector(
"Measured Force in the FT sensor ",Fsens);
138 printVector(
"Measured Moment in the FT sensor ",Musens);
147 cout<<
"\nDestroying sensor..."<<endl;
148 delete armWSensorSolver; armWSensorSolver=NULL;
149 cout<<
"Destroying arm..."<<endl;
150 delete arm; arm=NULL;
A class for defining the 7-DOF iCub Arm in the iDyn framework.
bool initKinematicNewtonEuler(const yarp::sig::Vector &w0, const yarp::sig::Vector &dw0, const yarp::sig::Vector &ddp0)
Calls the proper method to set kinematics variables in OneChainNewtonEuler: either initKinematicBase(...
yarp::sig::Matrix getForces() const
Returns the links forces as a matrix, where the i-th col is the i-th force.
yarp::sig::Vector setD2Ang(const yarp::sig::Vector &ddq)
Sets the free joint angles acceleration to values of ddq[i].
void prepareNewtonEuler(const NewEulMode NewEulMode_s=DYNAMIC)
Prepare for the Newton-Euler recursive computation of forces and torques.
yarp::sig::Matrix getMoments() const
Returns the links moments as a matrix, where the i-th col is the i-th moment.
yarp::sig::Vector getTorques() const
Returns the links torque as a vector.
yarp::sig::Vector setAng(const yarp::sig::Vector &q)
Sets the free joint angles to values of q[i].
yarp::sig::Vector setDAng(const yarp::sig::Vector &dq)
Sets the free joint angles velocity to values of dq[i].
A class for computing joint force/moment/torque of an iCub arm (left/right) given the FT measurements...
virtual bool computeFromSensorNewtonEuler(const yarp::sig::Vector &F, const yarp::sig::Vector &Mu)
The main computation method: given the FT sensor measurements, compute forces moments and torques in ...
yarp::sig::Vector getAng()
Returns the current free joint angles values.
unsigned int getN() const
Returns the number of Links belonging to the Chain.
void printVector(const string &s, const Vector &v)
void printMatrix(const string &s, const Matrix &m)