Hi Ugo,<br><br>Are you using the grasping pipeline by calling the Pickup action? If so, the grasping pipeline will do for you all of what Kaijen explained. Here are a few notes:<br><br>- the pre-grasp stored in the database is not used. Initially we though it would be, but then we realized that how far back the pre-grasp should be from the grasp is often application-specific.<br>
<br>- the Pickup action goal thus specifies how far back the pre-grasp should be. There are two relevant fields:<br><br>float32 desired_approach_distance<br>float32 min_approach_distance<br><br>- the grasping pipeline will attempt to find a pre-grasp that is "behind" the grasp by at least min_approach_distance, and ideally desired_approach_distance. This pre-grasp must be reachable and out of collision. It will do this by starting at the grasp position, then doing interpolated IK "backwards" as far as possible, up to desired_approach_distance. This explains why Interpolated IK markers show up the at the grasp location first, then move back.<br>
<br>- what does "backwards" mean? That is specified on the parameter server. The grasping pipeline will look for a set of parameters telling it, among others:<br> * what is the tf name of reference frame of the hand - this is the frame that the grasp pose refers to<br>
 * what is the "approach" direction, relative to the hand frame, when executing a grasp. A pre-grasp will be computed by translating a grasp in the opposite of the approach direction.<br><br>For the PR2, this is specified in pr2_object_manipulation_launch/config/pr2_hand_descriptions.yaml. You will probably need to adapt this file to your hardware.<br>
<br>Let us know if you have more problems, we'd be glad to help. Also, if you could include some rviz screenshots from multiple viewpoints that would help, as it's hard to tell from one image what things look like in 3D.<br>
<br>Best,<br>Matei<br><br><div class="gmail_quote">On Thu, Feb 3, 2011 at 1:06 PM, Kaijen Hsiao <span dir="ltr"><<a href="mailto:kaijenhsiao@gmail.com">kaijenhsiao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Ugo,<br>
I'm not sure exactly which stack/code you are using, but those markers<br>
look like they're coming from the interpolated IK motion planner.  The<br>
interpolated IK motion planner can search for a consistent/feasible<br>
path starting from either end--if the start_from_end parameter is<br>
true, then the planner finds IK solutions for the end pose first, then<br>
works its way backwards towards the start pose, using the last set of<br>
found arm angles as the starting point.<br>
<br>
Typically when you're planning from pregrasp to grasp, you want to<br>
enter pregrasp as start and grasp as end so the trajectory times are<br>
correct, but you want to ask it to start searching from the grasp<br>
(end) pose and work its way backwards.  That's because you typically<br>
can't compromise on the final grasp pose, but you might not mind if<br>
the Cartesian path backwards towards the pregrasp gets almost but not<br>
all the way there.  That's what the error codes tell you--how far it<br>
got.  (You can also set the steps_before_abort param to 0 if you just<br>
want it to abort if it finds any infeasible/inconsistent poses at<br>
all.)<br>
If you get an incomplete path back, you can decide whether you're<br>
willing to just motion plan to a slightly closer pregrasp pose, or if<br>
you want to abort.  If the markers don't make it all the way to the<br>
pregrasp, it means that the path is incomplete--the next step towards<br>
the pregrasp either had no collision-free IK solution, or else had no<br>
solution consistent with the last step (within consistent_angle for<br>
all joint angles from the last step).<br>
<br>
I'm not sure what you're running to get to the pregrasp, but you<br>
probably want to use move_arm or some such to move to the start of the<br>
(completed portion of the) trajectory returned by the interpolated IK<br>
motion planner, then use a normal joint trajectory movement to get<br>
through the rest of the trajectory.  (Or you can just use a Cartesian<br>
controller, assured that there actually is a feasible/consistent path<br>
to actually reach the grasp pose from that set of joint angles.)<br>
<br>
Hope that helps.<br>
<br>
-Kaijen<br>
<div><div></div><div class="h5"><br>
<br>
On Thu, Feb 3, 2011 at 8:25 AM, Ugo Cupcic <<a href="mailto:ugo@shadowrobot.com">ugo@shadowrobot.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I'm still trying to get the manipulation stack to work with our arm and hand<br>
> and I ran into some problem:<br>
><br>
> As you can see here, A path from pregrasp to grasp is found:<br>
> <a href="http://img267.imageshack.us/img267/199/rviz013.png" target="_blank">http://img267.imageshack.us/img267/199/rviz013.png</a><br>
><br>
> But:<br>
>  > the path seems to be the wrong way around: the first markers are at the<br>
> bottom, instead of at the top.<br>
>  > when moving the arm, the arm moves maybe 5cm below the markers (on the<br>
> screenshot, it's at position 0 which should be pregrasp).<br>
><br>
> The values I put in the database are:<br>
> grasp_pregrasp_position =<br>
> "{0,0,0.281533,0.707106781186548,0.707106781186548,0,0}"<br>
> grasp_grasp_position =<br>
> "{0,0,0.213018,0.707106781186548,0.707106781186548,0,0}"<br>
><br>
> Any help greatly appreciated.<br>
><br>
> Cheers,<br>
><br>
> Ugo<br>
><br>
> --<br>
> Ugo Cupcic | Shadow Robot Company | <a href="mailto:ugo@shadowrobot.com">ugo@shadowrobot.com</a><br>
> Software Engineer | 251 Liverpool Road |<br>
> need a Hand? | London N1 1LX | +44 20 7700 2487<br>
> <a href="http://www.shadowrobot.com/hand/" target="_blank">http://www.shadowrobot.com/hand/</a> @shadowrobot<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> ros-users mailing list<br>
> <a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
> <a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
><br>
><br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Matei Ciocarlie<br>Research Scientist<br>Willow Garage Inc.<br>650-475-9780<br>