Re: [ros-users] kdl_parser error?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: 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