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:new_actions [2018/12/30 15:42] – [Pick-action-designator] vanessatutorials:intermediate:new_actions [2019/01/02 16:17] – [Pick-action-designator] vanessa
Line 166: Line 166:
 ====== Pick-action-designator ====== ====== Pick-action-designator ======
  
-TODO: Write when the new manipulation interface is done. 
  
 +
 +Now it is necessary to define a action designator of the new type for pick-up e.g.
 +
 +<code lisp>
 +;;cram/cram_common/cram_mobile_pick_place_plans/src/pick-place-designators.lisp
 +(def-fact-group pick-and-place-plans (desig:action-grounding)
 +  (<- (desig:action-grounding ?action-designator (pick-up ?current-object-desig ?arm
 +                                                          ?gripper-opening ?effort ?grasp
 +                                                          ?left-reach-poses ?right-reach-poses
 +                                                          ?left-grasp-poses ?right-grasp-poses
 +                                                          ?left-lift-poses ?right-lift-poses))
 +    ;; extract info from ?action-designator
 +    (spec:property ?action-designator (:type :picking-up))
 +    (spec:property ?action-designator (:object ?object-designator))
 +    (desig:current-designator ?object-designator ?current-object-desig)
 +    (spec:property ?current-object-desig (:type ?object-type))
 +    (spec:property ?current-object-desig (:name ?object-name))
 +    (-> (spec:property ?action-designator (:arm ?arm))
 +        (true)
 +        (man-int:robot-free-hand ?_ ?arm))
 +    (lisp-fun man-int:get-object-transform ?current-object-desig ?object-transform)
 +    ;; infer missing information like ?grasp type, gripping ?maximum-effort, manipulation poses
 +    (lisp-fun man-int:calculate-object-faces ?object-transform (?facing-robot-face ?bottom-face))
 +    (-> (man-int:object-rotationally-symmetric ?object-type)
 +        (equal ?rotationally-symmetric t)
 +        (equal ?rotationally-symmetric nil))
 +    (-> (spec:property ?action-designator (:grasp ?grasp))
 +        (true)
 +        (and (lisp-fun man-int:get-object-type-grasps ?object-type ?arm ?object-transform ?grasps)
 +             (member ?grasp ?grasps)))
 +    (lisp-fun man-int:get-object-type-gripping-effort ?object-type ?effort)
 +    (lisp-fun man-int:get-object-type-gripper-opening ?object-type ?gripper-opening)
 +    (lisp-fun man-int:get-object-grasping-poses
 +              ?object-name ?object-type :left ?grasp ?object-transform
 +              ?left-poses)
 +    (lisp-fun man-int:get-object-grasping-poses
 +              ?object-name ?object-type :right ?grasp ?object-transform
 +              ?right-poses)
 +    (lisp-fun extract-pick-up-manipulation-poses ?arm ?left-poses ?right-poses
 +              (?left-reach-poses ?right-reach-poses
 +                                 ?left-grasp-poses ?right-grasp-poses
 +                                 ?left-lift-poses ?right-lift-poses)))
 +
 +  
 +</code>
 +
 +
 +
 +First all of the information from the ?action-designator will be extract. After that  all information that are missing from the ?action-designator will be inferred. <code lisp>     (lisp-fun man-int:calculate-object-faces ?object-transform (?facing-robot-face ?bottom-face))
 +    (-> (man-int:object-rotationally-symmetric ?object-type)
 +        (equal ?rotationally-symmetric t)
 +        (equal ?rotationally-symmetric nil))
 +    (-> (spec:property ?action-designator (:grasp ?grasp))
 +        (true)
 +        (and (lisp-fun man-int:get-object-type-grasps ?object-type ?arm ?object-transform ?grasps)
 +             (member ?grasp ?grasps))) </code>   
 +             
 +The system needs to know how the object, that will be picked up, is facing so that the rotation is correctly and the transformation from gripper to object will be properly.
 ====== Get-trajectory ====== ====== Get-trajectory ======
  
  
 ====== Write a Demo====== ====== Write a Demo======