How to programmatically "Allow Approximate IK Solutions"

1,798 views
Skip to first unread message

Sietse Achterop

unread,
Nov 26, 2015, 4:17:30 AM11/26/15
to MoveIt! Users
   Hello List,

We have a 4DOF arm, and try to get ik working with Moveit!.
I used  "ROS By Example" volume 2 as my starting point and created an URDF.
Everything is working, also using moveit from within the Rviz plugin.
Only to use the markers to set new goals I have to set "Allow Approximate IK Solutions" in the planning interface.

Now I want to control this planning from a python program. I have a simple moveit_ik_demo.py script
that only sets a pose, plans and executes it.
There always are errors like
  [ERROR] [1448525835.713454524]: LBKPIECE1: Unable to sample any valid states for goal tree
and often warnings like
  [ WARN] [1448525776.227503592]: Orientation constraint for link 'arm_wrist_roll_link' is probably incorrect: 0.000000, -0.700000, 0.000000, 0.700000. Assuming identity instead.

The pose I try is very close to the pose that it has at that moment (using get_current_pose).
So I assume planning should work. But it doesn't.

Please find the moveit stuff and the python scripts in http://fwn06.housing.rug.nl/ros/arm/.
The scripts are in smart_arm_nav.

Why is planning not working? Maybe it can be solved if it is possible to programmatically do the same as "Allow Approximate IK Solutions" in the Rviz plugin.
How can this be done via the python API?

    Thanks in advance,
        Sietse


Ruben Burger

unread,
Nov 27, 2015, 2:58:09 AM11/27/15
to MoveIt! Users
Hi Sietse,

Perhaps you can take a look at set_joint_value_target(pose, string, bool) which allows a bool to set whether the pose is approximate (link to api) no idea if it works the same as the Rviz setting though.

Good luck,

Ruben


Op donderdag 26 november 2015 10:17:30 UTC+1 schreef Sietse Achterop:

Sietse Achterop

unread,
Dec 7, 2015, 7:50:52 AM12/7/15
to MoveIt! Users
  Hello Ruben,

thanks, that's it.
I earlier learned that I could use the C++ function  setApproximateJointValueTarget  for this (thanks Natalia), but I couldn't find it in Python.
But this python function does the trick!
    Thanks again.
       Sietse

Op vrijdag 27 november 2015 08:58:09 UTC+1 schreef Ruben Burger:
Reply all
Reply to author
Forward
0 new messages