Hi Patrick,
we recently got Pick working with our 5DoF arm (whooo!), so I'm
supplying a few of my random notes and speculations inline.
On Sun, 19 Jan 2014 11:47:22 -0800
Patrick Goebel <
pat...@pirobot.org> wrote:
> I am using the MoveIt! Python API in ROS Hydro (Debian install) with
> Ubuntu 12.04. My 6-dof arm is working well in demo mode [...]
Same setup I'm using, except I'm using either Gazebo or the real robot,
not the demo mode.
> [ INFO] [1390160394.780762801]: Planning attempt 1 of at most 1
> [ INFO] [1390160394.781137260]: Added plan for pipeline 'pick'. Queue
> is now of size 1
> [ INFO] [1390160394.830357392]: Manipulation plan 0 failed at stage
> 'reachable & valid pose filter' on thread 0
> [ WARN] [1390160394.830569822]: All supplied grasps failed. Retrying
> last grasp in verbose mode.
> [ INFO] [1390160394.830677452]: Re-added last failed plan for
> pipeline 'pick'. Queue is now of size 1
> [ INFO] [1390160394.850568729]: IK failed
> [ INFO] [1390160394.868562234]: IK failed
> [ INFO] [1390160394.883219633]: IK failed
> [ INFO] [1390160394.883286820]: Sampler failed to produce a state
> [ INFO] [1390160394.883364968]: Manipulation plan 0 failed at stage
> 'reachable & valid pose filter' on thread 0
> [ INFO] [1390160394.883587365]: Pickup planning completed after
> 0.049711 seconds
That's the same error I used to get until I fixed it (see below).
> My script tries to make it easy for the planner by initially
> positioning the gripper in nearly the exactly correct posture for
> grasping the target object named "part" in the script. (See the RViz
> screen capture below for where the arm and gripper are moved relative
> to the target object before the pick operation is run.) So I am not
> sure why IK is failing. I only vaguely understand the various parts
> of the grasp message and how to set the various fields properly so no
> doubt I am missing something essential.
>
> Any hints would be appreciated!
>
>
>
>
>
Maybe it's not super helpful that you're placing the gripper
initially at the grasp pose, since it has to go from there to the
pregrasp, then back to the grasp. This first movement is done with
collision checks with "part" enabled, so that may be a problem later.
On the other hand, you can already move there just fine, so there's no
reason it can't also move back from there. Also, this shows that the
grasp is reachable. Maybe you should calculate a pregrasp and move the
gripper there initially, just to make sure it can go there.
> rospy.sleep(2)
>
> # set the grasp pose
> g.grasp_pose = grasp_pose
>
> # define the pre-grasp approach
> g.pre_grasp_approach.direction.header.frame_id = "base_footprint"
This should be your gripper tool frame, since you usually want the
approach to happen along a specific axis of the gripper, not the base.
> g.pre_grasp_approach.direction.vector.x = 1.0
> g.pre_grasp_approach.direction.vector.y = 0.0
> g.pre_grasp_approach.direction.vector.z = 0.0
> g.pre_grasp_approach.min_distance = 0.001
This might be a little low. I guess the min_distance should be at least
big enough that the resulting pose is out of collision with the
"part" (but I might be wrong). For me, 0.05 m worked fine.
> g.pre_grasp_approach.desired_distance = 0.1
>
> g.pre_grasp_posture.header.frame_id = "right_gripper_base_link"
> g.pre_grasp_posture.joint_names = ["right_gripper_finger_joint"]
>
> pos = JointTrajectoryPoint()
> pos.positions.append(0.0)
>
> g.pre_grasp_posture.points.append(pos)
>
> # set the grasp posture
> g.grasp_posture.header.frame_id = "right_gripper_base_link"
> g.grasp_posture.joint_names = ["right_gripper_finger_joint"]
>
> pos = JointTrajectoryPoint()
> pos.positions.append(0.2)
> pos.effort.append(0.0)
>
> g.grasp_posture.points.append(pos)
>
> # set the post-grasp retreat
> g.post_grasp_retreat.direction.header.frame_id = "base_footprint"
This is okay, since you want the retreat to be "up", no matter how the
gripper is oriented.
> g.post_grasp_retreat.direction.vector.x = 0.0
> g.post_grasp_retreat.direction.vector.y = 0.0
> g.post_grasp_retreat.direction.vector.z = 1.0
> g.post_grasp_retreat.desired_distance = 0.25
> g.post_grasp_retreat.min_distance = 0.01
>
> g.allowed_touch_objects = ["table"]
This should definitely include "part", and I'm not sure it should have
"table". The allowed_touch_objects are only taken into account when
going from pre_grasp to grasp, and that's where we want to allow these
collisions.
Actually, adding "part" here made picking work for me; before, I used
to get the same errors you do, probably indicating that the gripper was
in collision with the "part" in the grasp pose.
> [...]
If you want to have a look, our (still very hacky) C++ code is here:
https://github.com/uos/calvin_robot/blob/hydro/calvin_pick_n_place/src/demo2.cpp
It usually picks successfully, but group.pick() never returns. If you
want, you can run it like this:
roslaunch calvin_gazebo calvin_table_world.launch
roslaunch calvin_moveit_config moveit_planning_execution.launch
roslaunch calvin_moveit_config moveit_rviz.launch config:=true
rosrun calvin_pick_n_place demo2
Cheers,
Martin