iCub-main
Classes
iDynInv
+ Collaboration diagram for iDynInv:

Classes

class  iCub::iDyn::iDynInvSensor
 
class  iCub::iDyn::iDynInvSensorArm
 
class  iCub::iDyn::iDynInvSensorArmNoTorso
 
class  iCub::iDyn::iDynInvSensorLeg
 
class  iCub::iDyn::iDynSensor
 
class  iCub::iDyn::iDynSensorArm
 
class  iCub::iDyn::iDynSensorArmNoTorso
 
class  iCub::iDyn::iDynSensorLeg
 

Detailed Description

Classes for force/torque computation in a dynamic chain, where a single FT sensor is placed. Using Newton-Euler formula it is possible to compute an estimate of the FT sensor measurements. iDynInvSensor is the generic class which takes a iDynChain, sets a generic sensor attached to the chain, and manages the proper computations. iDynInvSensorArm and iDynInvSensorLeg are specific classes performing computations for iCub arms and legs: by choosing left/right part, they automatically set the proper FT sensor parameters. Given single FT sensor measurements it is also possible to compute link/joint force/moment/torque. As iDynInvSensor, iDynSensor attachs a FT sensor into a iDynChain; exploiting the sensor force/moment measurements, and applying the inverse formula of Newton-Euler recursive algorithm, it is possible to compute joint torques given single FT measurements. The dynamical parameters necessary to the algorithm are read automatically from the iDynChain (consisting of iDynLinks), whereas the FT sensor must be set from iDynSensor constructor.

Tested OS

Windows

Example Instantiation of the Module

Set a iDynInvSensor for iCub's left arm, with force/moment computation in the static case (STATIC), and verbose (VERBOSE==1) output:

iCubArmDyn *arm = new iCubArmDyn("left");
iDynInvSensorArm armWSensorSolver = new iDynInvSensorArm(arm,STATIC,VERBOSE);
Note that by setting the arm as "left", the sensor is automatically set as the left sensor of the arm. Then start retrieving the sensor force/moment. First the chain must be updated with the current angle configuration:

arm->setAng(q);
arm->setDAng(dq);
arm->setD2Ang(ddq);
Then the arm dynamics must be solved, in order to find each links' force/moment, etc:

arm->computeNewtonEuler(w0,dw0,d2p0,Fend,Mend);
Finally we can compute the sensor force and moment, attaching the sensor to its link (whose force/moment have been previously computed):

armWSensorSolver->computeSensorForceMoment();
The sensor force/moment can be retrieved separately (3x1 vectors) or together (6x1 vector).

Vector F = armWSensorSolver->getSensorForce();
Vector Mu = armWSensorSolver->getSensorMoment();
Vector FMu = armWSensorSolver->getSensorForceMoment();

Example Instantiation of the Module

Set a iDynSensor for iCub's left arm, with force/moment computation in the static case (STATIC), and verbose (VERBOSE==1) output:

iCubArmDyn *arm = new iCubArmDyn("left");
iDynSensorArm armWSensorSolver = new iDynSensorArm(arm,STATIC,VERBOSE);
Note that by setting the arm as "left", the sensor is automatically set as the left sensor of the arm. The chain must be updated with the current angle configuration, and the sensor measurements must be put into two (3x1) vectors or one (6x1).

arm->setAng(q);
Vector FM = measureFromSensor();
Vector F = measureForceFromSensor();
Vector M = measureMomentFromSensor();
In both cases, we can give the compute method our measurements:

armWSensorSolver->computeFromSensorNewtonEuler(FM);
armWSensorSolver->computeFromSensorNewtonEuler(F,M);
The arm joints force/moment/torque can be now retrieved:

Matrix F = armWSensorSolver->getForces();
Matrix Mu = armWSensorSolver->getMoments();
Vector Tau = armWSensorSolver->getTorques();

Author
Serena Ivaldi

Copyright (C) 2010 RobotCub Consortium CopyPolicy: Released under the terms of the GNU GPL v2.0.