24 using namespace yarp::sig;
25 using namespace yarp::math;
32 iGenericFrame::iGenericFrame()
36 iGenericFrame::iGenericFrame(
const Matrix &_R,
double _x,
double _y,
double _z)
43 iGenericFrame::iGenericFrame(
const Matrix &_R,
const Vector &_p)
50 void iGenericFrame::initFTransform()
61 void iGenericFrame::setR(
const Matrix &_R)
65 void iGenericFrame::setP(
double _x,
double _y,
double _z)
71 void iGenericFrame::setP(
const Vector &_p)
76 void iGenericFrame::setPRH(
const Matrix &_H)
80 R=_H.submatrix(0,2,0,2);
83 void iGenericFrame::setPRH()
87 R=
H.submatrix(0,2,0,2);
89 void iGenericFrame::setPRH(
const Matrix &_R,
const Vector &_p)
94 void iGenericFrame::setH(
const Matrix &_R,
double _x,
double _y,
double _z)
97 for(
int i=0; i<3; i++)
98 for(
int j=0; j<3; j++)
104 void iGenericFrame::setH(
const Matrix &_R,
const Vector &_p)
107 for(
int i=0; i<3; i++)
109 for(
int j=0; j<3; j++)
116 void iGenericFrame::setH(
const Matrix &_H)
118 R=_H.submatrix(0,2,0,2);
123 yarp::sig::Vector iGenericFrame::setFT(
const Vector &_FT)
133 iFrameOnLink::iFrameOnLink()
139 iFrameOnLink::iFrameOnLink(
int _l)
144 void iFrameOnLink::initSFrame()
155 void iFrameOnLink::setLink(
int _l)
159 void iFrameOnLink::setFT(
const yarp::sig::Vector &_FT)
161 FT=Sensor->setFT(_FT);
165 void iFrameOnLink::setSensorKin(
int _l)
167 Link->setPRH(Limb->getH(_l));
168 H=Link->getH()*Sensor->getH();
171 void iFrameOnLink::setSensorKin()
173 Link->setPRH(Limb->getH(l));
174 Matrix H1 = Link->getH();
175 Matrix H2 = Sensor->getH();
176 H=Link->getH()*Sensor->getH();
179 void iFrameOnLink::setSensorKin(
const Matrix &_H)
185 void iFrameOnLink::setSensor(
int _l,
const yarp::sig::Vector &_FT)
191 void iFrameOnLink::setSensor(
const yarp::sig::Matrix &_H,
const yarp::sig::Vector &_FT)
197 void iFrameOnLink::setSensor(
const yarp::sig::Vector &_FT)
203 Vector iFrameOnLink::getFT()
207 Matrix iFrameOnLink::getH()
222 iFrameOnLink::~iFrameOnLink()
233 iFTransformation::iFTransformation()
239 initiFTransformation();
241 iFTransformation::iFTransformation(
int _l)
248 initiFTransformation();
254 initiFTransformation();
256 Limb = _iDynChainWithSensor->
chain;
257 SensorFrame =
new iGenericFrame(_iDynChainWithSensor->
getH().submatrix(0,2,0,2),_iDynChainWithSensor->
getH().submatrix(0,2,0,3).getCol(3));
261 Sensor->attach(Limb);
262 Sensor->attach(SensorFrame);
271 Sensor->attach(_Limb);
276 Sensor->attach(_Sensor);
278 void iFTransformation::initiFTransformation()
306 void iFTransformation::setLink(
int _l)
311 void iFTransformation::setSensor(
const Vector &_FT)
314 Sensor->setSensor(_FT);
317 void iFTransformation::setSensor(
int _l,
const Vector &_FT)
321 Sensor->setSensor(_l, _FT);
324 void iFTransformation::setSensor(
const Matrix &_H,
const Vector &_FT)
327 Sensor->setSensor(_H, _FT);
330 void iFTransformation::setHe()
332 EndEffector->setH(Limb->getH());
333 He=EndEffector->getH();
335 void iFTransformation::setHe(
int _l)
337 EndEffector->setH(Limb->getH(_l));
338 He=EndEffector->getH();
340 void iFTransformation::setHe(
const Matrix &_H)
342 EndEffector->setH(_H);
343 He=EndEffector->getH();
345 void iFTransformation::setTeb()
350 for(
int j=0; j<3; j++)
353 Teb(i+3,j+3)=He(i,j);
357 yarp::sig::Vector iFTransformation::getEndEffWrench()
363 yarp::sig::Vector iFTransformation::getEndEffWrench(
const Vector &_FT)
366 return getEndEffWrench();
368 yarp::sig::Vector iFTransformation::getEndEffWrenchAsBase()
374 yarp::sig::Vector iFTransformation::getEndEffWrenchAsBase(
const Vector &_FT)
377 return getEndEffWrenchAsBase();
379 void iFTransformation::setFe()
383 void iFTransformation::setTse()
388 for(
int i=0; i<3;i++)
390 d(i)=(Hs(i,3)-He(i,3));
392 d=He.submatrix(0,2,0,2).transposed()*d;
400 R=He.submatrix(0,2,0,2).transposed()*Hs.submatrix(0,2,0,2);
403 for(
int i=0; i<3;i++)
405 for(
int j=0; j<3;j++)
415 iFTransformation::~iFTransformation()
A Base class for defining a Serial Link Chain, using dynamics and kinematics.
A class for computing force/moment of a sensor placed anywhere in a kinematic chain; its position in ...
yarp::sig::Matrix getH() const
Get the sensor roto-translational matrix defining its position/orientation wrt the link.
unsigned int getSensorLink() const
iDynChain * chain
the iDynChain describing the robotic chain
A Base class for defining the FT sensor over a generic link of a kinematic chain inherited by iKinLim...
A Base class for defining the Transformation of a Wrench from a frame to another.
A Base class for defining a Serial Link Chain.
yarp::sig::Matrix getH(const unsigned int i, const bool allLink=false)
Returns the rigid roto-translation matrix from the root reference frame to the ith frame in Denavit-H...