User Tools

Site Tools


software:cram:tutorials:pick-and-place-primer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:cram:tutorials:pick-and-place-primer [2013/03/28 09:28] winklersoftware:cram:tutorials:pick-and-place-primer [2016/05/19 09:19] (current) – external edit 127.0.0.1
Line 11: Line 11:
  
 ==== Prerequisites ==== ==== Prerequisites ====
-It is assumed that you successfully completed the [[software:cram:setup|installation of the CRAM system]] before starting this lesson.+It is assumed that you successfully completed the [[software:cram:setup:auto-install|installation of the CRAM system]] before starting this lesson.
  
 ==== Getting the Code ==== ==== Getting the Code ====
Line 71: Line 71:
 This will start Gazebo, spawn a PR2 robot and a table with two mugs on it. This will start Gazebo, spawn a PR2 robot and a table with two mugs on it.
 {{ :software:cram:tutorials:gazebo_lesson01_spawn.png?800 |}} {{ :software:cram:tutorials:gazebo_lesson01_spawn.png?800 |}}
-The PR2 and the mugs are dynamic objects while the table is fixed to the ground, i.e. you can't move it.+The PR2 and the mugs are dynamic objects while the table is fixed to the ground, i.e. you can't move it. (If you encounter problems with parts of the simulation not showing up correctly, see [[pick-and-place-primer# Pitfalls and known issues |here]].) 
 In yet another terminal, open rviz: In yet another terminal, open rviz:
 <code bash> <code bash>
Line 204: Line 205:
 The PR2 will drive around and will try to get into a suitable position for grasping. It then will try to grasp the object. The PR2 will drive around and will try to get into a suitable position for grasping. It then will try to grasp the object.
  
 +Once the object is being grasped, the robot will execute a motion to achieve the following grasp and carrying pose:
 +
 +{{ :software:cram:tutorials:pr2_mug_carry.png?370| }}
 +{{ :software:cram:tutorials:pr2_grasp_mug.png?300 |}}
 +
 +=== Handle-based grasping ===
 +The fact that the PR2 grasps the mug on it's handle results from two things:
 +  * An extensive reasoning machinery that checks for the existance of handles on an object to grasp, plus an algorithm that calculates the respective grasp poses
 +  * The definition of the object handle in the source code
 +
 +The system relies on information given to it about handles. This information if thought to be stored in an external knowledge source such as [[software:knowrob|KnowRob]] but can be given by hand here.
 +
 +The important part in the source code for handle definition is found here:
 +<code lisp>
 +(with-designators
 +    ((handle-loc (location
 +                  `((desig-props:pose
 +                     ,(tf:make-pose
 +                       (tf:make-3d-vector
 +                        -0.12 0.0 0.07)
 +                       (tf:euler->quaternion
 +                        :ax (/ pi 2)))))))
 +     (mug-handle (object
 +                  `((desig-props:type desig-props:handle)
 +                    (desig-props:at ,handle-loc))))
 +     (mug (object `((desig-props:name "mug_1")
 +                    (desig-props:handle ,mug-handle)))))
 +</code>
 +
 +The variable ''handle-loc'' defines the relative pose of the handle with respect to the bottom-most center point of the mug, i.e. the pose that is returned by the ''gazebo_perception_process_module''.
 +
 +''mug-handle'' then defined a handle-object that is then placed as a handle into the actual mug-object, ''mug''.
 +
 +
 +==== Completing the Pick and Place Task ====
 +To make the robot execute the task at hand, the function ''displace-mug-1'' has been prepared. You can find it in ''lesson01.lisp''. It is started by:
 +<code lisp>
 +LESSON01> (displace-mug-1)
 +</code>
 +
 +During the runtime of this function, the robot will try to get hold of the object (i.e., pick it up) and then put it down on a different spot of the table.
 +
 +Since finding a good spot to put the object down on the table isn't that easy, it is possible that the PR2 will drive around a bit and try different spots before it finds a suitable location.
 +
 +For putting down the object, the same techniques with respect to location costmaps are used as in the pick-up part of this tutorial.
 +
 +==== Pitfalls and known issues ====
 +In case the table doesn't show up completely when starting the lesson launchfile (and, Gazebo in particular), you have to restart the Gazebo client GUI. The problem will show you a scene similar to this one:
 +
 +{{ :software:cram:tutorials:issue_pr2_table_nospawn.png?300 |}}
 +
 +Just close the Gazebo window and restart the client, using:
 +<code bash>
 +$ `rospack find gazebo`/gazebo/bin/gzclient -g `rospack find gazebo`/lib/libgazebo_ros_paths_plugin.so
 +</code>
 +The (simulated) table is physically there, but the visual is missing. The simulation could go on without it, but for the scenery's sake, you can get it back into the scene with this fix.
  
-==== Open Topics / Unfinished Sections ==== + --- //[[|Winkler, Jan]] 2013/03/28 11:10//
-Parts missing from this lesson: +
-  * Handle based grasping +
-    * Handle definition in the object (mug, in this example) +
-  * Pictures and logs from successful grasps +
---- //[[|Winkler, Jan]] 2013/03/26 14:21//+
software/cram/tutorials/pick-and-place-primer.1364462935.txt.gz · Last modified: 2016/05/19 09:18 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki