OROCOS 网上注释文档

    博客分类:
  • 机器人和PLC

Twist是代表速度和角速度的6x1矩阵,Wrench是代表力和力矩的6x1矩阵,两者可相互转化

KDL::Twist

link to API documentation

A Twist is the 6x1 matrix that represents the velocity of a Frame using a 3D translational velocity Vector vel and a 3D angular velocity Vector rot:

<equation id="twist"><equation>

Creating Twists

 Twist t1; //Default constructor, initializes both vel and rot to Zero Twist t2(vel,rot);//Vector vel, and Vector rot Twist t3 = Twist::Zero();//Zero twist

Note: in contrast to the creation of Frames, the order in which vel and rot Vectors are supplied to the constructor is important.

Getting values

Using the operators [ ] and ( ), the indices from 0..2 return the elements of vel, the indices from 3..5 return the elements of rot:

 double vx = t1(0); double omega_y = t1[4]; t1(1) = vy; t1[5] = omega_z;

Because some robotics literature put the rotation part on top it is safer to use the vel, rot members to access the individual elements:

 double vx = t1.vel.x();//or vx = t1.vel(0); double omega_y = t1.rot.y();//or omega_y = t1.rot(1); t1.vel.y(v_y);//or t1.vel(1)=v_y; //etc

Multiply/Divide with a scalar

The same operators as for Vector are available:

 t2=2*t1; t2=t1*2; t2=t1/2;

Adding/subtracting Twists

The same operators as for Vector are available:

 t1+=t2; t1-=t2; t3=t1+t2; t3=t1-t2;

Comparing Twists

Element by element comparison with or without user-defined accuracy:

 t1==t2; t1!=t2; Equal(t1,t2,eps);

 

KDL::Wrench

  • link to API documentation

A Wrench is the 6x1 matrix that represents a force on a Frame using a 3D translational force Vector force and a 3D moment Vector torque:

<equation id="wrench"><equation>

Creating Wrenches

 Wrench w1; //Default constructor, initializes force and torque to Zero Wrench w2(force,torque);//Vector force, and Vector torque Wrench w3 = Wrench::Zero();//Zero wrench

Getting values

Using the operators [ ] and ( ), the indices from 0..2 return the elements of force, the indices from 3..5 return the elements of torque:

 double fx = w1(0); double ty = w1[4]; w1(1) = fy; w1[5] = tz;

Because some robotics literature put the torque part on top it is safer to use the torque, force members to access the individual elements:

 double fx = w1.force.x();//or fx = w1.force(0); double ty = w1.torque.y();//or ty = w1.torque(1); w1.force.y(fy);//or w1.force(1)=fy;//etc

Multiply/Divide with a scalar

The same operators as for Vector are available:

 w2=2*w1; w2=w1*2; w2=w1/2;

Adding/subtracting Wrenchs

The same operators as for Twist are available:

 w1+=w2; w1-=w2; w3=w1+w2; w3=w1-w2;

Comparing Wrenchs

Element by element comparison with or without user-defined accuracy:

 w1==w2; w1!=w2; Equal(w1,w2,eps);

 

Twist and Wrench transformations

Wrenches and Twists are expressed in a certain reference frame; the translational Vector vel of the Twists and the moment Vector torque of the Wrenches represent the velocity of, resp. the moment on, a certain reference point in that frame. Common choices for the reference point are the origin of the reference frame or a task specific point.

The values of a Wrench or Twist change if the reference frame or reference point is changed.

Changing only the reference point

If you want to change the reference point you need the Vector v_old_new from the old reference point to the new reference point expressed in the reference frame of the Wrench or Twist:

t2 = t1.RefPoint(v_old_new); w2 = w1.RefPoint(v_old_new);

 

Changing only the reference frame

If you want to change the reference frame but want to keep the reference point intact you can use a Rotation matrix R_AB which expresses the rotation of the current reference frame B wrt to the new reference frame A:

ta = R_AB*tb; wa = R_AB*wb;

 

Note: This operation seems to multiply a 3x3 matrix R_AB with 6x1 matrices tb or wb, while in reality it uses the 6x6 Screw transformation matrix derived from R_AB.

Changing both the reference frame and the reference point

If you want to change both the reference frame and the reference point you can use a Frame F_AB which contains (i) Rotation matrix R_AB which expresses the rotation of the current reference frame B wrt to the new reference frame A and (ii) the Vector v_old_new from the old reference point to the new reference point expressed in A:

ta = F_AB*tb; wa = F_AB*wb;

 

Note: This operation seems to multiply a 4x4 matrix F_AB with 6x1 matrices tb or wb, while in reality it uses the 6x6 Screw transformation matrix derived from F_AB.

First order differentiation and integration

t = diff(F_w_A,F_w_B,timestep)//differentiation F_w_B = F_w_A.addDelta(t,timestep)//integration

t is the twist that moves frame A to frame B in timestep seconds. t is expressed in reference frame w using the origin of A as velocity reference point.

参考坐标系和参考点

分享到:
orocos-kdl中文注释之one example | orocos-kdl中文注释之Geometric primitives ...

你可能感兴趣的:(OROCOS 网上注释文档)