iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::iDyn::iDynSensorNode Class Reference

A class for connecting two or mutiple limbs and exchanging kinematic and wrench information between limbs, when one or multiple limbs have FT sensors. More...

#include <iDynBody.h>

+ Inheritance diagram for iCub::iDyn::iDynSensorNode:

Public Member Functions

 iDynSensorNode (const NewEulMode _mode=DYNAMIC)
 Default constructor. More...
 
 iDynSensorNode (const std::string &_info, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::VERBOSE)
 Constructor. More...
 
virtual void addLimb (iDyn::iDynLimb *limb, const yarp::sig::Matrix &H, const FlowType kinFlow=RBT_NODE_OUT, const FlowType wreFlow=RBT_NODE_IN)
 Add one limb to the node, defining its RigidBodyTransformation. More...
 
void addLimb (iDyn::iDynLimb *limb, const yarp::sig::Matrix &H, iDyn::iDynSensor *sensor, const FlowType kinFlow=RBT_NODE_OUT, const FlowType wreFlow=RBT_NODE_IN)
 Add one limb to the node, defining its RigidBodyTransformation and the iDynSensor used to solve it after FT sensor measurements. More...
 
virtual bool solveWrench ()
 Main function to manage the exchange of wrench information among the limbs attached to the node. More...
 
virtual bool setWrenchMeasure (const yarp::sig::Matrix &F, const yarp::sig::Matrix &M, bool afterAttach=false)
 Set the Wrench measures on the limbs attached to the node. More...
 
virtual bool setWrenchMeasure (const yarp::sig::Matrix &FM, bool afterAttach=false)
 Set the Wrench measures on the limbs attached to the node. More...
 
yarp::sig::Matrix estimateSensorsWrench (const yarp::sig::Matrix &FM, bool afterAttach=false)
 Exploit iDynInvSensor methods to retrieve FT sensor measurements after solving wrenches in the limbs. More...
 
- Public Member Functions inherited from iCub::iDyn::iDynNode
 iDynNode (const NewEulMode _mode=DYNAMIC)
 Default constructor. More...
 
 iDynNode (const std::string &_info, const NewEulMode _mode=DYNAMIC, unsigned int verb=iCub::skinDynLib::VERBOSE)
 Constructor with parameters. More...
 
virtual void addLimb (iDyn::iDynLimb *limb, const yarp::sig::Matrix &H, const FlowType kinFlow=RBT_NODE_OUT, const FlowType wreFlow=RBT_NODE_IN, bool hasSensor=false)
 Add one limb to the node, defining its RigidBodyTransformation. More...
 
yarp::sig::Matrix getRBT (unsigned int iLimb) const
 Return the RBT matrix of a certain limb attached to the node. More...
 
bool solveKinematics (const yarp::sig::Vector &w0, const yarp::sig::Vector &dw0, const yarp::sig::Vector &ddp0)
 Main function to manage the exchange of kinematic information among the limbs attached to the node. More...
 
bool solveKinematics ()
 Main function to manage the exchange of kinematic information among the limbs attached to the node. More...
 
bool setKinematicMeasure (const yarp::sig::Vector &w0, const yarp::sig::Vector &dw0, const yarp::sig::Vector &ddp0)
 Set the kinematic measurement (w,dw,ddp) on the limb where the kinematic flow is of type RBT_NODE_IN. More...
 
bool solveWrench (const yarp::sig::Matrix &FM)
 This is to manage the exchange of wrench information among the limbs attached to the node. More...
 
bool solveWrench (const yarp::sig::Matrix &F, const yarp::sig::Matrix &M)
 This is to manage the exchange of wrench information among the limbs attached to the node. More...
 
virtual bool setWrenchMeasure (const yarp::sig::Matrix &F, const yarp::sig::Matrix &M)
 Set the wrench measure on the limbs with input wrench. More...
 
virtual bool setWrenchMeasure (const yarp::sig::Matrix &FM)
 Set the wrench measure on the limbs with input wrench. More...
 
yarp::sig::Vector getForce () const
 Return the node force. More...
 
yarp::sig::Vector getMoment () const
 Return the node moment. More...
 
yarp::sig::Vector getAngVel () const
 Return the node angular velocity. More...
 
yarp::sig::Vector getAngAcc () const
 Return the node angular acceleration. More...
 
yarp::sig::Vector getLinAcc () const
 Return the node linear acceleration. More...
 
yarp::sig::Matrix computeJacobian (unsigned int iChain)
 Compute the Jacobian of the limb with index iChain in the node, in its default direction (as it would be done by iKin). More...
 
yarp::sig::Matrix computeJacobian (unsigned int iChain, unsigned int iLink)
 Compute the Jacobian of the i-th link of the limb with index iChain in the node, in its default direction (as it would be done by iKin). More...
 
yarp::sig::Matrix computeJacobian (unsigned int iChainA, JacobType dirA, unsigned int iChainB, JacobType dirB)
 Compute the Jacobian between two links in two different chains. More...
 
yarp::sig::Matrix computeJacobian (unsigned int iChainA, JacobType dirA, unsigned int iChainB, unsigned int iLinkB, JacobType dirB)
 Compute the Jacobian between two links in two different chains. More...
 
yarp::sig::Vector computePose (unsigned int iChainA, JacobType dirA, unsigned int iChainB, JacobType dirB, const bool axisRep)
 Compute the Pose of the end-effector, given a "virtual" chain connecting two limbs. More...
 
yarp::sig::Vector computePose (unsigned int iChainA, JacobType dirA, unsigned int iChainB, unsigned int iLinkB, JacobType dirB, const bool axisRep)
 Compute the Pose of the end-effector, given a "virtual" chain connecting two limbs. More...
 
yarp::sig::Matrix TESTING_computeCOMJacobian (unsigned int iChain, unsigned int iLink)
 Compute the Jacobian of the COM of the i-th link of the limb with index iChain in the node. More...
 
yarp::sig::Matrix TESTING_computeCOMJacobian (unsigned int iChainA, JacobType dirA, unsigned int iChainB, unsigned int iLinkB, JacobType dirB)
 Compute the Jacobian of the COM of link iLinkB, in chainB, when two different chains (A and B) are connected. More...
 

Protected Member Functions

unsigned int howManySensors () const
 
- Protected Member Functions inherited from iCub::iDyn::iDynNode
void zero ()
 Reset all data to zero. More...
 
void compute_Pn_HAN (unsigned int iChainA, JacobType dirA, unsigned int iChainB, JacobType dirB, yarp::sig::Matrix &Pn, yarp::sig::Matrix &H_A_Node)
 Compute Pn and H_A_Node matrices given two chains. More...
 
void compute_Pn_HAN (unsigned int iChainA, JacobType dirA, unsigned int iChainB, unsigned int iLinkB, JacobType dirB, yarp::sig::Matrix &Pn, yarp::sig::Matrix &H_A_Node)
 Compute Pn and H_A_Node matrices given two chains. More...
 
void compute_Pn_HAN_COM (unsigned int iChainA, JacobType dirA, unsigned int iChainB, unsigned int iLinkB, JacobType dirB, yarp::sig::Matrix &Pn, yarp::sig::Matrix &H_A_Node)
 Compute Pn and H_A_Node matrices given two chains. More...
 
unsigned int howManyWrenchInputs (bool afterAttach=false) const
 Return the number of limbs with wrench input, i.e. More...
 
unsigned int howManyKinematicInputs (bool afterAttach=false) const
 Return the number of limbs with kinematic input, i.e. More...
 

Protected Attributes

std::deque< iDyn::iDynSensor * > sensorList
 the list of iDynSensors used to solve each limb after FT sensor measurements More...
 
- Protected Attributes inherited from iCub::iDyn::iDynNode
std::deque< RigidBodyTransformationrbtList
 the list of RBT More...
 
NewEulMode mode
 STATIC/DYNAMIC/DYNAMIC_W_ROTOR/DYNAMIC_CORIOLIS_GRAVITY. More...
 
std::string info
 info or useful notes More...
 
unsigned int verbose
 verbosity flag More...
 
yarp::sig::Vector w
 angular velocity More...
 
yarp::sig::Vector dw
 angular acceleration More...
 
yarp::sig::Vector ddp
 linear acceleration More...
 
yarp::sig::Vector F
 force More...
 
yarp::sig::Vector Mu
 moment More...
 
yarp::sig::Vector COM
 COM position of the node. More...
 
double mass
 total mass of the node More...
 

Detailed Description

A class for connecting two or mutiple limbs and exchanging kinematic and wrench information between limbs, when one or multiple limbs have FT sensors.

Definition at line 916 of file iDynBody.h.

Constructor & Destructor Documentation

◆ iDynSensorNode() [1/2]

iDynSensorNode::iDynSensorNode ( const NewEulMode  _mode = DYNAMIC)

Default constructor.

Parameters
_modethe computation mode for kinematic/wrench using Newton-Euler's formula

Definition at line 1327 of file iDynBody.cpp.

◆ iDynSensorNode() [2/2]

iDynSensorNode::iDynSensorNode ( const std::string &  _info,
const NewEulMode  _mode = DYNAMIC,
unsigned int  verb = iCub::skinDynLib::VERBOSE 
)

Constructor.

Parameters
_infosome information, ie the node name
_modethe computation mode for kinematic/wrench using Newton-Euler's formula
verbverbosity flag

Definition at line 1333 of file iDynBody.cpp.

Member Function Documentation

◆ addLimb() [1/2]

virtual void iCub::iDyn::iDynSensorNode::addLimb ( iDyn::iDynLimb limb,
const yarp::sig::Matrix &  H,
const FlowType  kinFlow = RBT_NODE_OUT,
const FlowType  wreFlow = RBT_NODE_IN 
)
virtual

Add one limb to the node, defining its RigidBodyTransformation.

A new RigidBodyTransformation is added to the RBT list. Since there's not an iDynSensor for this limb, it is set to NULL in the sensorList.

Parameters
limbpointer to generic limb
Ha (4x4) roto-translational matrix defining the transformation between node and limb base/end
kinFlowthe type of information flow of kinematics variables
wreFlowthe type of information flow of wrench variables

◆ addLimb() [2/2]

void iCub::iDyn::iDynSensorNode::addLimb ( iDyn::iDynLimb limb,
const yarp::sig::Matrix &  H,
iDyn::iDynSensor sensor,
const FlowType  kinFlow = RBT_NODE_OUT,
const FlowType  wreFlow = RBT_NODE_IN 
)

Add one limb to the node, defining its RigidBodyTransformation and the iDynSensor used to solve it after FT sensor measurements.

A new RigidBodyTransformation is added to the RBT list. The iDynSensor is added to the sensorList.

Parameters
limbpointer to generic limb
Ha (4x4) roto-translational matrix defining the transformation between node and limb base/end
sensorpointer to iDynSensor of the limb
kinFlowthe type of information flow of kinematics variables
wreFlowthe type of information flow of wrench variables

◆ estimateSensorsWrench()

Matrix iDynSensorNode::estimateSensorsWrench ( const yarp::sig::Matrix &  FM,
bool  afterAttach = false 
)

Exploit iDynInvSensor methods to retrieve FT sensor measurements after solving wrenches in the limbs.

The parameter FM is a (6xN), where each column is an external wrench to be used for initializing the wrench phase; N is the number of limbs Nlimbs attached to the node. The boolean flag is used in case the external wrench on the first limb has already been set; this is useful whenever two different nodes are connected and share information: the first node sends kinematic and wrench information to the 'first' limb of the second node (eg the torso). In that case the FM matrix should only contain external wrench for the other limbs, so it should be a (6x(Nlimbs-1)).

Parameters
FMa (6xN) matrix with the external wrenches,where N is the number of limbs if afterAttach=false, number of limbs -1 if afterAttach=true
afterAttacha flag for specifying if the external wrench of the first limb has been already set or not

Definition at line 1562 of file iDynBody.cpp.

◆ howManySensors()

unsigned int iDynSensorNode::howManySensors ( ) const
protected
Returns
the number of limbs with sensor

Definition at line 1707 of file iDynBody.cpp.

◆ setWrenchMeasure() [1/2]

virtual bool iCub::iDyn::iDynSensorNode::setWrenchMeasure ( const yarp::sig::Matrix &  F,
const yarp::sig::Matrix &  M,
bool  afterAttach = false 
)
virtual

Set the Wrench measures on the limbs attached to the node.

The parameters F and M are (3xN) matrices, where each column is an external wrench to be used for initializing the wrench phase; N is the number of limbs Nlimbs attached to the node. The boolean flag is used in case the external wrench on the first limb has already been set; this is useful whenever two different nodes are connected and share information: the first node sends kinematic and wrench information to the 'first' limb of the second node (eg the torso). In that case the F and M matrices should only contain external wrench for the other limbs, so it should be a (6x(Nlimbs-1)).

Parameters
Fa (3xN) matrix with forces, where N is the number of limbs if afterAttach=false, number of limbs -1 if afterAttach=true
Ma (3xN) matrix with moments , where N is the number of limbs if afterAttach=false, number of limbs -1 if afterAttach=true
afterAttacha flag for specifying if the external wrench of the first limb has been already set or not
Returns
true if succeeds, false otherwise

◆ setWrenchMeasure() [2/2]

virtual bool iCub::iDyn::iDynSensorNode::setWrenchMeasure ( const yarp::sig::Matrix &  FM,
bool  afterAttach = false 
)
virtual

Set the Wrench measures on the limbs attached to the node.

The parameter FM is a (6xN), where each column is an external wrench to be used for initializing the wrench phase; N is the number of limbs Nlimbs attached to the node. The boolean flag is used in case the external wrench on the first limb has already been set; this is useful whenever two different nodes are connected and share information: the first node sends kinematic and wrench information to the 'first' limb of the second node (eg the torso). In that case the FM matrix should only contain external wrench for the other limbs, so it should be a (6x(Nlimbs-1)).

Parameters
FMa (6xN) matrix with the external wrenches, where N is the number of limbs if afterAttach=false, number of limbs -1 if afterAttach=true
afterAttacha flag for specifying if the external wrench of the first limb has been already set or not
Returns
true if succeeds, false otherwise

◆ solveWrench()

bool iDynSensorNode::solveWrench ( )
virtual

Main function to manage the exchange of wrench information among the limbs attached to the node.

Multiple limbs with wrench flow of input type can exist, but at least one limb with output type must exist, to compute the wrench balance on the node. The measured/input wrenches to the limbs are here assumed to be set elsewhere: eg another class or the main is setting the measured wrenches. Note: RBT calls computeWrenchNewtonEuler in the limb, meaning that performs a "basic" wrench computation without any sensor, just setting wrenches at the end-effector or at the base, and calling recursive wrench computation.

Returns
true if succeeds, false otherwise

Reimplemented from iCub::iDyn::iDynNode.

Definition at line 1352 of file iDynBody.cpp.

Member Data Documentation

◆ sensorList

std::deque<iDyn::iDynSensor *> iCub::iDyn::iDynSensorNode::sensorList
protected

the list of iDynSensors used to solve each limb after FT sensor measurements

Definition at line 922 of file iDynBody.h.


The documentation for this class was generated from the following files: