1. 程式人生 > >開源機器人庫orocos KDL 學習筆記:Kinematric Trees

開源機器人庫orocos KDL 學習筆記:Kinematric Trees

上一篇主要講述了機器人學中用到的幾何基礎知識,以及在KDL中的實現和使用。本篇將更加深入的涉及到機器人學中的內容,主要是如何表示串聯型機械臂,以及KDL中的實現方式。 KDL中使用了兩個使用廣泛且技術成熟的機器人作為例子:puma560(六自由度)和kukaLWR(七自由度)。本篇主要使用六自由度的puma560作為例子。閱讀本篇需要有一定的機器人學常識,至少要讀過《機器人學導論》的前三章。 在KDL中建立puma560機器人很簡單,只需要呼叫一個函式就可以了。

Chain p560=Puma560();

要想知道這個函式裡面做了什麼,首先有三個KDL裡的概念要清楚:Joint,Segment,Chain。

1. KDL::Joint

A Joint allows translation or rotation in one degree of freedom between two Segments

Joint(關節)可以使兩個Segments之間有一個自由度的旋轉或平移。

1.1 建立一個Joint

首先,Joint類裡面定義了一個Joint的型別(平移、旋轉、None):

typedef enum { RotAxis,RotX,RotY,RotZ,TransAxis,TransX,TransY,TransZ,None} JointType;

建立Joint的函式有幾個,先看第一個:

explicit Joint(const std::string& name, const JointType& type=None,const double& scale=1,const double& offset=0,
              const double& inertia=0,const double& damping=0,const double& stiffness=0);

各個引數的含義如下: name: Joint的名字; type: Joint的型別,旋轉、平移還是None; scale: the scale between joint input and actual geometric movement, default: 1; offset: offset between joint input and actual geometric input, default: 0; inertia: 沿關節軸向的慣性,預設:0; damping: 沿關節軸向的阻尼,預設:0; stiffness: 沿關節軸向的剛度,預設:0;