Re: [ros-users] kdl_parser error?

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: User discussions
日付:  
To: User discussions
題目: Re: [ros-users] kdl_parser error?
Hi Kristof,

On Thu, Jan 20, 2011 at 4:16 AM, Kristof Berx
<> wrote:
>    for(int i=0;i<chain_.getNrOfJoints();++i)
>    {
>        cout<<"Segment "<<i<<": "<<chain_.getSegment(i).getName()<<" Joint "<<i<<": "<<chain_.getSegment(i).getJoint().getName()<<endl;
>    }


I think the number of joints is not necessarily equal to the number of
segments. I use code similar to this:

  for (int i=0; i<int(kdl_chain_.segments.size()); ++i)
  {
    const KDL::Segment& segment = kdl_chain_.segments[i];
    const KDL::Joint& joint = segment.getJoint();
    if (joint.getType() != KDL::Joint::None)
    {
      // do something with this joint
    }
  }



Hope this helps,
- Mrinal