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
Next revisionBoth sides next revision
tutorials:intermediate:simple_mobile_manipulation_plan [2019/08/02 13:19] – Added details about the reachability costmap in the end amartutorials:intermediate:simple_mobile_manipulation_plan [2022/04/13 08:27] – [Constructing plans] schimpf
Line 42: Line 42:
       * <code lisp> (desig:a motion (type going) (target ?loc-desig)) </code> is a motion that moves the body of the robot and expects a key ''target'', whose value should be of type ''location-designator''.       * <code lisp> (desig:a motion (type going) (target ?loc-desig)) </code> is a motion that moves the body of the robot and expects a key ''target'', whose value should be of type ''location-designator''.
       * <code lisp> (desig:a motion (type looking) (target ?loc-desig))</code> is a motion that moves the head of the robot to look at the specfied location. It expects a key ''target'' with value of type ''location'' designator.        * <code lisp> (desig:a motion (type looking) (target ?loc-desig))</code> is a motion that moves the head of the robot to look at the specfied location. It expects a key ''target'' with value of type ''location'' designator. 
-      * <code lisp> (desig:a motion (type detecting) (object ?obj-desig)) </code> is a a motion that perceives and detects the specified object. It expects a key ''object'' with a value of type ''object-designator''+      * <code lisp> (desig:a motion (type detecting) (object ?obj-desig)) </code> is a a motion that perceives and detects the specified object. It expects a key ''object'' with a value of type ''object-designator''. An example is <code lisp>  
 +      (desig:a motion (type detecting) (desig:an object (type bowl))) </code>. This motion perceives and tries to find an object of type bowl in the field of view where the camera of the robot is pointed to. The resultant of this is also an object designator, but it has much more information. A sample is given below <code lisp> 
 +    #<A OBJECT 
 +    (TYPE BOWL) 
 +    (NAME BOWL-1) 
 +    (POSE ((:POSE 
 +            #<CL-TRANSFORMS-STAMPED:POSE-STAMPED  
 +   FRAME-ID: "base_footprint", STAMP: 1.564755796743144d9 
 +   #<3D-VECTOR (0.7672472770564228d0 -0.35741216776250767d0 0.888642116546631d0)> 
 +   #<QUATERNION (-0.005783746257358676d0 -0.0013544535828327665d0 -0.26923602469246516d0 0.9630558655492675d0)>>
 +           (:TRANSFORM 
 +            #<CL-TRANSFORMS-STAMPED:TRANSFORM-STAMPED  
 +   FRAME-ID: "base_footprint", CHILD-FRAME-ID: "bowl_1", STAMP: 1.564755796743144d9 
 +   #<3D-VECTOR (0.7672472770564228d0 -0.35741216776250767d0 0.888642116546631d0)> 
 +   #<QUATERNION (-0.005783746257358676d0 -0.0013544535828327665d0 -0.26923602469246516d0 0.9630558655492675d0)>>
 +           (:POSE-IN-MAP 
 +            #<CL-TRANSFORMS-STAMPED:POSE-STAMPED  
 +   FRAME-ID: "map", STAMP: 1.564755796743144d9 
 +   #<3D-VECTOR (1.5255411783854167d0 0.761638069152832d0 0.8886421203613282d0)> 
 +   #<QUATERNION (-0.005410938989371061d0 -0.0024511234369128942d0 -0.07722260057926178d0 0.9969961643218994d0)>>
 +           (:TRANSFORM-IN-MAP 
 +            #<CL-TRANSFORMS-STAMPED:TRANSFORM-STAMPED  
 +   FRAME-ID: "map", CHILD-FRAME-ID: "bowl_1", STAMP: 1.564755796743144d9 
 +   #<3D-VECTOR (1.5255411783854167d0 0.761638069152832d0 0.8886421203613282d0)> 
 +   #<QUATERNION (-0.005410938989371061d0 -0.0024511234369128942d0 -0.07722260057926178d0 0.9969961643218994d0)>>)))> </code> Note that this resulting object designator has the name of the object along with the coordinate of the object w.r.t the robot coordinate frame and other useful coordinate transformations which can later be used to calculate the pose of the end effector for grasping.
     * **Action Designators** - These describe the high-level actions which may consist of multiple calls to different low-level motion to carry out a small plan.     * **Action Designators** - These describe the high-level actions which may consist of multiple calls to different low-level motion to carry out a small plan.
         * <code lisp> (desig:an action (type picking-up) (arm ?grasp-arm) (grasp ?grasp-pose-identifier) (object ?obj-desig)) </code> is an action that picks an object with the specified arm and grasp pose. It expects an ''object'' key with value of type ''object-designator'', an ''arm'' with the value of type keyword for the arm to choose, and a ''grasp'' key whose value specifies a keyword which is an identifier of the grasp pose to pick the object with.         * <code lisp> (desig:an action (type picking-up) (arm ?grasp-arm) (grasp ?grasp-pose-identifier) (object ?obj-desig)) </code> is an action that picks an object with the specified arm and grasp pose. It expects an ''object'' key with value of type ''object-designator'', an ''arm'' with the value of type keyword for the arm to choose, and a ''grasp'' key whose value specifies a keyword which is an identifier of the grasp pose to pick the object with.
Line 73: Line 97:
 <code lisp> <code lisp>
 BTW-TUT> BTW-TUT>
-(defparameter *final-object-destination*+ (defparameter *final-object-destination*
   (cl-transforms-stamped:make-pose-stamped   (cl-transforms-stamped:make-pose-stamped
    "map" 0.0    "map" 0.0
    (cl-transforms:make-3d-vector -0.8 2 0.9)    (cl-transforms:make-3d-vector -0.8 2 0.9)
-   (cl-transforms:make-identity-rotation)))+   (cl-transforms:make-quaternion 0.0d0 0.0d0 -1.0d0 0.0d0)))
  
 (defparameter *base-pose-near-table* (defparameter *base-pose-near-table*
Line 111: Line 135:
 (defun move-bottle () (defun move-bottle ()
   (spawn-bottle)   (spawn-bottle)
-  (pr2-proj:with-simulated-robot+  (urdf-proj:with-simulated-robot
     (let ((?navigation-goal *base-pose-near-table*))     (let ((?navigation-goal *base-pose-near-table*))
       (cpl:par       (cpl:par
Line 119: Line 143:
         (pp-plans::park-arms)         (pp-plans::park-arms)
         ;; Moving the robot near the table.         ;; Moving the robot near the table.
-        (exe:perform (desig:a motion+        (exe:perform (desig:an action
                               (type going)                               (type going)
                               (target (desig:a location                                (target (desig:a location 
Line 125: Line 149:
     ;; Looking towards the bottle before perceiving.     ;; Looking towards the bottle before perceiving.
     (let ((?looking-direction *downward-look-coordinate*))     (let ((?looking-direction *downward-look-coordinate*))
-      (exe:perform (desig:a motion +      (exe:perform (desig:an action 
                             (type looking)                             (type looking)
                             (target (desig:a location                              (target (desig:a location 
Line 144: Line 168:
       ;; Moving the robot near the counter.       ;; Moving the robot near the counter.
       (let ((?nav-goal *base-pose-near-counter*))       (let ((?nav-goal *base-pose-near-counter*))
-        (exe:perform (desig:a motion+        (exe:perform (desig:an action
                               (type going)                               (type going)
                               (target (desig:a location                                (target (desig:a location 
Line 160: Line 184:
 </code> </code>
  
-Note that the plan is nested under ''pr2-proj:with-simulated-robot'' indicating that all the methods resolved by the designators is being called for the projection environment (You can see these low level methods being called under the ''cram_pr2_projections'' package under ''low-level.lisp''). If ''pr2-pms:with-real-robot'' is used to replace this, the functions from the real robot ROS interfaces will be called. Also note that it is possible to execute actions which are independent in parallel (In this case, moving the robot torso up and moving the robot base are independent actions done in parallel)+Note that the plan is nested under ''urdf-proj:with-simulated-robot'' indicating that all the methods resolved by the designators is being called for the projection environment (You can see these low level methods being called under the ''cram_urdf_projections'' package under ''low-level.lisp''). If ''pr2-pms:with-real-robot'' is used to replace this, the functions from the real robot ROS interfaces will be called. Also note that it is possible to execute actions which are independent in parallel (In this case, moving the robot torso up and moving the robot base are independent actions done in parallel)
  
 Now run ''(move-bottle)'' and you will see that the robot successfully picks the bottle and places it on the counter. Now run ''(move-bottle)'' and you will see that the robot successfully picks the bottle and places it on the counter.
Line 360: Line 384:
                                (object ?perceived-bottle)))                                (object ?perceived-bottle)))
 </code> </code>
-We see that the robot defaults the right arm when the object is in the center and will always try to grasp the left side of the bottle, even when the object is slightly favoring the left side under it (Refer the figure below).+We see that the robot defaults the right arm when the object is in the center and will always try to grasp the left side of the bottle, even when the object is slightly favoring the left side under it (Refer the figure below).  
 + 
 +Note: ''We have been using left-side here a lot. In the context of (grasp left-side), it refers to the left-side of the bottle. But what defines the "left-side"?'' 
 + 
 +''Before we understand it, we have to acknowledge that every object spawned in the bullet world has its own coordinate axes - even rotationally symmetric objects like the bottle here. And the definition for left-side is the side of the -ve Y-axis in the bottle coordinate frame. Similarly right-side is +ve Y-axis, front is denoted by +ve X-axis and the back by -ve X-axis. '' 
 +''With this the "left-side" grasp can change based on how the object is oriented in the world. But it remains the w.r.t the object coordinate frame.'' 
 + 
 +''The file at <your workspace>/cram/cram_common/cram_object_knowledge/src/household.lisp holds some definitions for grasps supported by the household objects supporte in CRAM.''
  
 {{:tutorials:intermediate:btw-tut-grasp-config-fail.png?800|}} {{:tutorials:intermediate:btw-tut-grasp-config-fail.png?800|}}