0
$\begingroup$

Rosanswers logo

I am trying to experiment with code that uses the TRAK_IK_LIB, before implementing it into my robot. The source code may be found here (https://bitbucket.org/traclabs/trac_ik/src/8bc7356ba6da?at=master). The Readme for it provides the following as the example for use: TRAC_IK::TRAC_IK ik_solver(KDL::Chain chain, KDL::JntArray lower_joint_limits, KDL::JntArray upper_joint_limits, double timeout_in_ms, double error, TRAC_IK::SolveType type=TRAC_IK::Speed);

May someone provide an example of how to initialize JntArray and specify a value for TRAC_IK::Speed?

Thank you in advance.


Originally posted by jzhan1 on ROS Answers with karma: 1 on 2016-01-15

Post score: 0


Original comments

Comment by gvdhoorn on 2016-01-15:
Might be a good idea to describe what you want to do with it exactly. If it's just for a MoveIt Configuration for instance, you don't need to do any programming.

Comment by jzhan1 on 2016-01-15:
Ultimately, I hope to configure it for a robot with 6 degrees of freedom, but for now, I'm just hoping to figure out how to run this code. Ideally, without MoveIt! configuration, though that could be a last resort.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

  1. v1.3.9 of trac_ik now has a constructor that takes the base_link name, tip_link name, and rosparam location of the URDF (typically "/robot_description") and handles the URDF parsing into KDL for you.

  2. If you are hard coding all this without a URDF for some reason, a JntArray is easy to initialize and populate from an existing array.

    KDL::JntArray a; a.resize(6); for(int i=0;i<6;i++) a(i)=arr[i];

  3. The timeout is actually in seconds (I need to fix that readme typo) so a reasonable timeout is usually 0.01 or even 0.005.

  4. TRAC_IK::Speed in an enumerated type in the TRAC_IK namespace saying that the MODE is to return as soon as any IK is found, There are other modes you can set. These should be in the trac_ik.h header and explained on the Bitbucket README.md.


Originally posted by pbeeson with karma: 276 on 2016-01-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by jzhan1 on 2016-01-15:
Thanks a lot, I posted it as an issue. I didn't realize URDF was supposed to be used, but am now using it. The descriptions helped me a lot with further understanding the code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.