Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
playground:playground [2019/07/09 07:54] – tlipps | playground:playground [2019/07/10 11:58] – tlipps | ||
---|---|---|---|
Line 16: | Line 16: | ||
After that the robot gets correctly positioned and kitchen objects spawned before starting. | After that the robot gets correctly positioned and kitchen objects spawned before starting. | ||
- | {{playground: | + | {{ playground: |
Since we passed '' | Since we passed '' | ||
<code lisp> | <code lisp> | ||
(when (eq ? | (when (eq ? | ||
- | (cpl: | + | |
- | ((common-fail: | + | ((common-fail: |
- | (roslisp: | + | (roslisp: |
- | (return))) | + | (return))) |
- | (let ((?loc (cdr (assoc : | + | (let ((?loc (cdr (assoc : |
- | (exe: | + | (exe: |
- | (desig:an action | + | (desig:an action |
- | (type searching) | + | (type searching) |
- | (object (desig:an object (type breakfast-cereal))) | + | (object (desig:an object (type breakfast-cereal))) |
- | (location ?loc)))))) | + | (location ?loc)))))) |
(cpl: | (cpl: | ||
- | ((common-fail: | + | |
- | (roslisp: | + | (roslisp: |
- | (return))) | + | (return))) |
- | (if (eq ? | + | (if (eq ? |
- | (exe: | + | (exe: |
- | (desig:an action | + | |
- | (type transporting) | + | |
- | (object ? | + | |
- | ;; (arm right) | + | |
- | (location ? | + | |
- | (target ? | + | |
</ | </ | ||
Line 52: | Line 51: | ||
<code lisp> | <code lisp> | ||
(defun search-for-object (&key | (defun search-for-object (&key | ||
- | ((:object ? | + | ((:object ? |
- | ((:location ? | + | |
- | ((: | + | |
- | (retries 3) | + | |
- | & | + | & |
(declare (type desig: | (declare (type desig: | ||
;; location desigs can turn NILL in the course of execution | ;; location desigs can turn NILL in the course of execution | ||
Line 70: | Line 69: | ||
<code lisp> | <code lisp> | ||
(cpl: | (cpl: | ||
- | ((desig: | + | |
- | (roslisp: | + | (roslisp: |
- | "Desig ~a could not be resolved: ~a~%Propagating up." | + | "Desig ~a could not be resolved: ~a~%Propagating up." |
- | ? | + | ? |
- | (cpl:fail ' | + | (cpl:fail ' |
- | : | + | : |
</ | </ | ||
- | If the referencing of below designators | + | If the referencing of below designators |
- | The basic idea is the following: First the robot tries to navigate to the location ''? | + | The basic idea is the following: First the robot tries to navigate to the location ''? |
Now if the robot cannot detect the object or cannot navigate to the ''? | Now if the robot cannot detect the object or cannot navigate to the ''? | ||
Line 86: | Line 85: | ||
;; take new `? | ;; take new `? | ||
(cpl: | (cpl: | ||
- | (cpl: | + | |
- | ((common-fail: | + | ((common-fail: |
- | (common-fail: | + | (common-fail: |
- | ? | + | ? |
- | outer-search-location-retries | + | outer-search-location-retries |
- | (: | + | (: |
- | : | + | : |
- | : | + | : |
- | : | + | : |
- | (roslisp: | + | |
- | " | + | |
</ | </ | ||
Line 104: | Line 103: | ||
;; if the going action fails, pick another `? | ;; if the going action fails, pick another `? | ||
(cpl: | (cpl: | ||
- | (cpl: | + | |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | common-fail: | + | common-fail: |
- | (common-fail: | + | |
- | ? | + | |
- | robot-location-retries | + | |
- | (: | + | |
- | : | + | : |
- | : | + | : |
- | : | + | : |
- | ;; navigate | + | ;; navigate |
- | (exe: | + | |
- | (type navigating) | + | (type navigating) |
- | (location ? | + | (location ? |
</ | </ | ||
Line 200: | Line 199: | ||
;; if perception action fails, try another `? | ;; if perception action fails, try another `? | ||
(cpl: | (cpl: | ||
- | (cpl: | + | |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | (common-fail: | + | |
- | ? | + | |
- | search-location-retries | + | |
- | (: | + | |
- | : | + | : |
- | : | + | : |
- | (exe: | + | (exe: |
- | (type turning-towards) | + | (type turning-towards) |
- | (target ? | + | (target ? |
- | (exe: | + | |
- | (type detecting) | + | (type detecting) |
- | (object ? | + | (object ? |
</ | </ | ||
Here we try to turn towards the location to search for and try to detect the object. If on of these action fails, we try like the parameter '' | Here we try to turn towards the location to search for and try to detect the object. If on of these action fails, we try like the parameter '' | ||
The detection action calls the '' | The detection action calls the '' | ||
- | At the end the function '' | + | At the end the function '' |
<code lisp> | <code lisp> | ||
#<A OBJECT | #<A OBJECT | ||
(LOCATION #<A LOCATION | (LOCATION #<A LOCATION | ||
- | (ON #<A OBJECT | + | (ON #<A OBJECT |
- | (TYPE COUNTER-TOP) | + | (TYPE COUNTER-TOP) |
- | (URDF-NAME SINK-AREA-SURFACE) | + | (URDF-NAME SINK-AREA-SURFACE) |
- | (OWL-NAME " | + | (OWL-NAME " |
- | (PART-OF KITCHEN)> | + | (PART-OF KITCHEN)> |
- | (SIDE LEFT) | + | (SIDE LEFT) |
- | (SIDE FRONT) | + | (SIDE FRONT) |
- | (RANGE-INVERT 0.5)>) | + | (RANGE-INVERT 0.5)>) |
(TYPE BOWL) | (TYPE BOWL) | ||
(NAME BOWL-1) | (NAME BOWL-1) | ||
Line 260: | Line 260: | ||
<code lisp> | <code lisp> | ||
(defun transport (&key | (defun transport (&key | ||
- | ((:object ? | + | |
- | ((: | + | ((: |
- | ((: | + | ((: |
- | ((: | + | ((: |
- | ((:arm ?arm)) | + | ((:arm ?arm)) |
- | ((:grasp ?grasp)) | + | ((:grasp ?grasp)) |
- | ((:arms ?arms)) | + | ((:arms ?arms)) |
- | ((:grasps ?grasps)) | + | ((:grasps ?grasps)) |
- | ((: | + | ((: |
- | ((: | + | ((: |
- | search-location-accessible | + | search-location-accessible |
- | delivery-location-accessible | + | delivery-location-accessible |
- | & | + | & |
</ | </ | ||
- | text... | + | |
<code lisp> | <code lisp> | ||
(unless search-location-accessible | (unless search-location-accessible | ||
- | (exe: | + | |
- | (type accessing) | + | |
- | (location ? | + | |
- | (distance 0.3)))) | + | |
+ | </ | ||
+ | If the object is not accessible e. g. if you want to pick up a fork in a drawer, this drawer has to be first | ||
+ | be opened by the robot. For this the action '' | ||
+ | |||
+ | <code lisp> | ||
(unwind-protect | (unwind-protect | ||
- | (let ((? | + | (let ((? |
- | (exe: | + | |
- | (type searching) | + | (type searching) |
- | (object ? | + | (object ? |
- | (location ? | + | (location ? |
- | (desig:when ? | + | (desig:when ? |
- | (robot-location ? | + | (robot-location ? |
- | (?robot-name | + | </ |
- | (cut:var-value '? | + | To fetch the object the object first has to be searched. For this we create |
- | (car (prolog:prolog '(rob-int:robot ?robot-name)))))) | + | and resolve an action designator of type searching with set object-designator, |
- | (roslisp: | + | the robot-location if available and the search-location like for the bowl e. g. this: |
- | "Found object of type ~a." | + | <code lisp> |
- | (desig: | + | (desig:a location |
+ | | ||
+ | (type counter-top) | ||
+ | (urdf-name sink-area-surface) | ||
+ | | ||
+ | | ||
+ | (side left) | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | <code lisp> | ||
(unless ? | (unless ? | ||
- | (setf ? | + | (setf ? |
- | (desig:a location | + | |
- | (reachable-for ? | + | (reachable-for ? |
- | (desig:when ?arm | + | (desig:when ?arm |
- | (arm ?arm)) | + | (arm ?arm)) |
- | (object ? | + | (object ? |
- | (unless ? | + | |
- | (setf ? | + | |
- | (desig:a location | + | |
- | (reachable-for ? | + | (reachable-for ? |
- | (location ? | + | (location ? |
+ | </ | ||
+ | Moreover, we need the fetch- and deliver-robot-locations. The ? | ||
- | ;; If running on the real robot, execute below task tree in projection | + | <code lisp> |
- | ;; N times first, then pick the best parameterization | + | ;; If running on the real robot, execute below task tree in projection |
- | ;; and use that parameterization in the real world. | + | |
- | ;; If running in projection, just execute the task tree below as normal. | + | |
- | (let (? | + | |
- | (proj-reasoning: | + | |
- | (? | + | |
- | ? | + | |
- | 3 | + | ? |
- | #' | + | |
+ | | ||
- | (let ((? | + | (let ((? |
- | (exe: | + | |
- | (type fetching) | + | (type fetching) |
- | (desig:when ?arm | + | (desig:when ?arm |
- | (arm ?arm)) | + | (arm ?arm)) |
- | (desig:when ?grasp | + | (desig:when ?grasp |
- | (grasp ?grasp)) | + | (grasp ?grasp)) |
- | (desig:when ?arms | + | (desig:when ?arms |
- | (arms ?arms)) | + | (arms ?arms)) |
- | (desig:when ?grasps | + | (desig:when ?grasps |
- | (grasps ?grasps)) | + | (grasps ?grasps)) |
- | (object ? | + | (object ? |
- | (robot-location ? | + | (robot-location ? |
- | (pick-up-action ? | + | (pick-up-action ? |
+ | </ | ||
+ | Now we create the action designator fetching and execute it. If the arms and graps are given we set them so they will be used by '' | ||
- | (roslisp: | + | <code lisp> |
- | (cpl: | + | |
- | ((common-fail: | + | |
- | (declare (ignore e)) | + | |
- | (drop-at-sink) | + | |
- | ;; (return) | + | |
- | )) | + | |
(unless delivery-location-accessible | (unless delivery-location-accessible | ||
- | (exe: | + | (exe: |
- | (type accessing) | + | (type accessing) |
- | (location ? | + | (location ? |
- | (distance 0.3)))) | + | (distance 0.3)))) |
- | (unwind-protect | + | |
- | (exe: | + | (exe: |
- | (type delivering) | + | |
- | (desig:when ?arm | + | |
- | (arm ?arm)) | + | |
- | (object ? | + | |
- | (target ? | + | |
- | (robot-location ? | + | |
- | (place-action ? | + | |
- | (unless delivery-location-accessible | + | |
- | (exe: | + | |
- | (type sealing) | + | (type sealing) |
- | (location ? | + | (location ? |
- | (distance 0.3)))))))))) | + | (distance 0.3)))))))))) |
+ | </ | ||
+ | In the last part of this function we first check if the deliver location is accessible ('' | ||
- | (unless search-location-accessible | + | <code lisp> |
- | (exe: | + | (unless search-location-accessible |
- | (type sealing) | + | (exe: |
- | (location ? | + | |
- | (distance 0.3)))))) | + | |
+ | | ||
</ | </ | ||
- | more text... | + | |
+ | At the end we seal the e. g. drawer we got our fork from with a specific distance towards the drawer. | ||
**go-without-collisions** | **go-without-collisions** | ||
Line 375: | Line 393: | ||
<code lisp> | <code lisp> | ||
(defun go-without-collisions (&key | (defun go-without-collisions (&key | ||
- | ((:location ? | + | |
- | & | + | & |
- | (declare (type desig: | + | (declare (type desig: |
- | "Check if navigation goal is in reach, if not propagate failure up, | + | "Check if navigation goal is in reach, if not propagate failure up, |
if yes, perform GOING action while ignoring failures." | if yes, perform GOING action while ignoring failures." | ||
- | \end{lstlisting} | + | |
- | The only input parameter is the location going to which has to be a location designator. | + | (exe: |
- | \begin{lstlisting} | + | |
- | (exe: | + | |
- | (type positioning-arm) | + | |
- | (left-configuration park) | + | |
- | (right-configuration park))) | + | |
</ | </ | ||
- | First we move the arms in the park position, so the don' | + | First we move the arms in the park position, so they do not hit anything on their way. |
<code lisp> | <code lisp> | ||
(proj-reasoning: | (proj-reasoning: | ||
Line 399: | Line 416: | ||
(setf ? | (setf ? | ||
- | (cpl: | + | |
- | ((common-fail: | + | ((common-fail: |
- | (roslisp: | + | |
- | " | + | |
- | (return))) | + | |
- | (exe: | + | (exe: |
- | (type going) | + | |
- | (target ? | + | |
</ | </ | ||
Line 415: | Line 432: | ||
<code lisp> | <code lisp> | ||
(defun turn-towards (&key | (defun turn-towards (&key | ||
- | ((:target ? | + | ((:target ? |
- | ((: | + | |
- | & | + | |
- | (declare (type desig: | + | (declare (type desig: |
- | " | + | " |
- | turn the robot base such that it looks in the direction of target | + | turn the robot base such that it looks in the direction of target and look again." |
- | and look again." | + | |
</ | </ | ||
Line 427: | Line 443: | ||
<code lisp> | <code lisp> | ||
- | (cpl: | + | (cpl: |
- | ((desig: | + | ((desig: |
- | (roslisp: | + | |
- | "Desig ~a could not be resolved: ~a~%Cannot look." | + | |
- | ? | + | |
- | (cpl:fail ' | + | |
- | (common-fail: | + | (common-fail: |
- | (roslisp: | + | |
- | "When turning around navigation failure happened: ~a~%~ | + | |
- | Cannot look." | + | Cannot look." |
- | e) | + | |
- | (cpl:fail ' | + | |
</ | </ | ||
- | If the referencing | + | If the referencing of the designators |
<code lisp> | <code lisp> | ||
- | (cpl: | + | (cpl: |
- | (cpl: | + | (cpl: |
- | ((common-fail: | + | ((common-fail: |
- | (roslisp: | + | |
- | (cpl: | + | |
- | (cpl:par | + | |
- | (exe: | + | |
- | (type navigating) | + | (type navigating) |
- | (location ? | + | (location ? |
- | (exe: | + | |
- | (type looking) | + | (type looking) |
- | (direction forward)))) | + | (direction forward)))) |
- | (cpl: | + | |
- | (roslisp: | + | |
- | (cpl:fail ' | + | |
- | (exe: | + | |
- | (type looking) | + | |
- | (target ? | + | |
</ | </ | ||
Now the robot tries with | Now the robot tries with | ||
<code lisp> | <code lisp> | ||
- | (exe: | + | (exe: |
- | (type looking) | + | |
- | (target ? | + | |
</ | </ | ||
to look at a location. If this fails with an '' | to look at a location. If this fails with an '' | ||
Line 477: | Line 490: | ||
<code lisp> | <code lisp> | ||
(defun fetch (&key | (defun fetch (&key | ||
- | ((:object ? | + | |
- | ((:arms ?arms)) | + | ((:arms ?arms)) |
- | ((:grasps ?grasps)) | + | ((:grasps ?grasps)) |
- | ((: | + | ((: |
- | pick-up-action | + | pick-up-action |
- | & | + | & |
- | (declare (type desig: | + | (declare (type desig: |
- | (type list ?arms ?grasps) | + | |
- | ;; ? | + | |
- | ;; but can become NULL during execution of the plan | + | |
- | (type (or desig: | + | |
- | (type (or desig: | + | |
- | " | + | " |
- | one of arms in the `? | + | one of arms in the `? |
- | in `? | + | while standing at `? |
and using the grasp and arm specified in `pick-up-action' | and using the grasp and arm specified in `pick-up-action' | ||
</ | </ | ||
Line 499: | Line 512: | ||
<code lisp> | <code lisp> | ||
(cpl: | (cpl: | ||
- | ((desig: | + | |
- | (roslisp: | + | |
- | (cpl:fail ' | + | |
- | :object ? | + | |
- | : | + | |
</ | </ | ||
Line 509: | Line 522: | ||
<code lisp> | <code lisp> | ||
- | ;; take a new `? | + | ;; take a new `? |
- | (cpl: | + | (cpl: |
- | (cpl: | + | (cpl: |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | common-fail: | + | common-fail: |
- | common-fail: | + | common-fail: |
- | common-fail: | + | common-fail: |
- | (common-fail: | + | |
- | ? | + | |
- | relocation-for-ik-retries | + | |
- | (: | + | |
- | (format NIL " | + | (format NIL " |
- | (desig: | + | (desig: |
- | : | + | : |
- | : | + | : |
</ | </ | ||
Line 530: | Line 543: | ||
<code lisp> | <code lisp> | ||
- | ;; navigate, look, detect and pick-up | + | ;; navigate, look, detect and pick-up |
- | (exe: | + | (exe: |
- | (type navigating) | + | |
- | (location ? | + | |
</ | </ | ||
- | The first action should move the robot without any collisions to the location ''? | + | The first action should move the robot without any collisions to the location ''? |
<code lisp> | <code lisp> | ||
Line 584: | Line 597: | ||
<code lisp> | <code lisp> | ||
(exe: | (exe: | ||
- | (type turning-towards) | + | (type turning-towards) |
- | (target (desig:a location (of ? | + | |
</ | </ | ||
Line 594: | Line 608: | ||
(TYPE TURNING-TOWARDS) | (TYPE TURNING-TOWARDS) | ||
(TARGET #<A LOCATION | (TARGET #<A LOCATION | ||
- | (OF #<A OBJECT | + | (OF #<A OBJECT |
- | (LOCATION #<A LOCATION | + | (LOCATION #<A LOCATION |
- | (ON #<A OBJECT | + | (ON #<A OBJECT |
- | (TYPE COUNTER-TOP) | + | (TYPE COUNTER-TOP) |
- | (URDF-NAME SINK-AREA-SURFACE) | + | (URDF-NAME SINK-AREA-SURFACE) |
- | (OWL-NAME kitchen_sink_block_counter_top) | + | (OWL-NAME kitchen_sink_block_counter_top) |
- | (PART-OF KITCHEN)> | + | (PART-OF KITCHEN)> |
- | (SIDE LEFT) | + | (SIDE LEFT) |
- | (SIDE FRONT) | + | (SIDE FRONT) |
- | (RANGE-INVERT 0.5)>) | + | (RANGE-INVERT 0.5)>) |
- | (TYPE BOWL) | + | (TYPE BOWL) |
- | (NAME BOWL-1) | + | (NAME BOWL-1) |
(POSE ((POSE | (POSE ((POSE | ||
#< | #< | ||
Line 633: | Line 647: | ||
#<A LOCATION | #<A LOCATION | ||
(OF #<A OBJECT | (OF #<A OBJECT | ||
- | (LOCATION #<A LOCATION | + | (LOCATION #<A LOCATION |
- | (ON #<A OBJECT | + | (ON #<A OBJECT |
- | (TYPE COUNTER-TOP) | + | (TYPE COUNTER-TOP) |
- | (URDF-NAME SINK-AREA-SURFACE) | + | (URDF-NAME SINK-AREA-SURFACE) |
- | (OWL-NAME " | + | (OWL-NAME " |
- | (PART-OF KITCHEN)> | + | (PART-OF KITCHEN)> |
- | (SIDE LEFT) | + | (SIDE LEFT) |
- | (SIDE FRONT) | + | (SIDE FRONT) |
- | (RANGE-INVERT 0.5)>) | + | (RANGE-INVERT 0.5)>) |
- | (TYPE BOWL) | + | (TYPE BOWL) |
- | (NAME BOWL-1) | + | (NAME BOWL-1) |
(POSE ((:POSE | (POSE ((:POSE | ||
#< | #< | ||
Line 666: | Line 680: | ||
</ | </ | ||
- | and returns a lazy list of pose-stamped with which then a looking action can be executed. | + | and returns a lazy list of pose-stamped with which then a looking action can be executed. |
<code lisp> | <code lisp> | ||
Line 672: | Line 686: | ||
(TYPE LOOKING) | (TYPE LOOKING) | ||
(TARGET #<A LOCATION | (TARGET #<A LOCATION | ||
- | (OF #<A OBJECT | + | (OF #<A OBJECT |
- | (LOCATION #<A LOCATION | + | (LOCATION #<A LOCATION |
- | (ON #<A OBJECT | + | (ON #<A OBJECT |
- | (TYPE COUNTER-TOP) | + | (TYPE COUNTER-TOP) |
- | (URDF-NAME SINK-AREA-SURFACE) | + | (URDF-NAME SINK-AREA-SURFACE) |
- | (OWL-NAME kitchen_sink_block_counter_top) | + | (OWL-NAME kitchen_sink_block_counter_top) |
- | (PART-OF KITCHEN)> | + | (PART-OF KITCHEN)> |
- | (SIDE LEFT) | + | (SIDE LEFT) |
- | (SIDE FRONT) | + | (SIDE FRONT) |
- | (RANGE-INVERT 0.5)>) | + | (RANGE-INVERT 0.5)>) |
- | (TYPE BOWL) | + | (TYPE BOWL) |
- | (NAME BOWL-1) | + | (NAME BOWL-1) |
- | (POSE ((POSE | + | (POSE ((POSE |
#< | #< | ||
FRAME-ID: " | FRAME-ID: " | ||
Line 707: | Line 721: | ||
<code lisp> | <code lisp> | ||
- | (cpl: | + | (cpl: |
- | (cpl: | + | (cpl: |
- | ((common-fail: | + | ((common-fail: |
- | (roslisp: | + | |
- | (cpl: | + | |
- | (roslisp: | + | |
- | (exe: | + | |
- | (type positioning-arm) | + | (type positioning-arm) |
- | (left-configuration park) | + | (left-configuration park) |
- | (right-configuration park))) | + | (right-configuration park))) |
- | (cpl: | + | |
- | (roslisp: | + | |
- | (cpl:fail ' | + | |
- | : | + | |
</ | </ | ||
Line 726: | Line 740: | ||
<code lisp> | <code lisp> | ||
- | (let ((? | + | (let ((? |
- | (exe: | + | (exe: |
- | (type detecting) | + | |
- | (object ? | + | |
</ | </ | ||
Line 735: | Line 749: | ||
<code lisp> | <code lisp> | ||
- | (let ((?arm (cut: | + | (let ((?arm (cut: |
- | ;; if picking up fails, try another arm | + | ;; if picking up fails, try another arm |
- | (cpl: | + | (cpl: |
- | (cpl: | + | (cpl: |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | desig: | + | desig: |
- | (common-fail: | + | |
- | ?arms | + | |
- | arm-retries | + | |
- | (: | + | |
- | (format NIL " | + | (format NIL " |
- | : | + | : |
- | : | + | : |
- | (setf ?arm (cut: | + | |
- | (let ((?grasp (cut: | + | |
- | ;; if picking up fails, try another grasp orientation | + | ;; if picking up fails, try another grasp orientation |
- | (cpl: | + | (cpl: |
- | (cpl: | + | (cpl: |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | desig: | + | desig: |
- | (common-fail: | + | |
- | ?grasps | + | |
- | grasp-retries | + | |
- | (: | + | |
- | (format NIL " | + | (format NIL " |
- | : | + | : |
- | (setf ?grasp (cut: | + | |
</ | </ | ||
- | To allow the robotor | + | To allow the robot to access the object with both arms and all possible grasps, the lists '' |
<code lisp> | <code lisp> | ||
(let ((pick-up-action | (let ((pick-up-action | ||
- | ;; if pick-up-action already exists, | + | |
- | ;; use its params for picking up | + | ;; use its params for picking up |
- | (or (when pick-up-action | + | (or (when pick-up-action |
- | (let* ((referenced-action-desig | + | (let* ((referenced-action-desig |
- | (desig: | + | |
- | (?arm | + | |
- | (desig: | + | |
- | referenced-action-desig | + | referenced-action-desig |
- | :arm)) | + | :arm)) |
- | (?grasp | + | |
- | (desig: | + | |
- | referenced-action-desig | + | referenced-action-desig |
- | :grasp))) | + | :grasp))) |
- | (desig:an action | + | (desig:an action |
- | (type picking-up) | + | (type picking-up) |
- | (arm ?arm) | + | (arm ?arm) |
- | (grasp ?grasp) | + | (grasp ?grasp) |
- | (object | + | (object |
- | ? | + | |
- | (desig:an action | + | |
- | (type picking-up) | + | |
- | (desig:when ?arm | + | |
- | (arm ?arm)) | + | |
- | (desig:when ?grasp | + | |
- | (grasp ?grasp)) | + | |
- | (object | + | |
- | ? | + | |
</ | </ | ||
Line 817: | Line 823: | ||
<code lisp> | <code lisp> | ||
- | (exe: | + | (exe: |
- | (type positioning-arm) | + | |
- | (left-configuration park) | + | |
- | (right-configuration park))) | + | |
- | (desig: | + | (desig: |
</ | </ | ||
Line 831: | Line 837: | ||
**deliver** | **deliver** | ||
+ | |||
<code lisp> | <code lisp> | ||
(defun deliver (&key | (defun deliver (&key | ||
- | ((:object ? | + | |
- | ((:arm ?arm)) | + | ((:arm ?arm)) |
- | ((:target ? | + | ((:target ? |
- | ((: | + | ((: |
- | place-action | + | place-action |
- | & | + | & |
- | (declare (type desig: | + | (declare (type desig: |
- | (type (or keyword null) ?arm) | + | |
- | ;; don't pass NULL as ? | + | |
- | ;; they can turn NULL during execution but not at the beginning | + | |
- | (type (or desig: | + | |
- | (type (or desig: | + | |
- | " | + | " |
and the robot should stand at `? | and the robot should stand at `? | ||
If a failure happens, try a different `? | If a failure happens, try a different `? | ||
</ | </ | ||
+ | The documentation of this method describes the input parameters and in the declare section you see which types the designators have. | ||
<code lisp> | <code lisp> | ||
- | ;; Reference the `? | + | |
- | ;; If not, delivering is impossible so throw a OBJECT-UNDERLIVERABLE failure | + | ;; If not, delivering is impossible so throw a OBJECT-UNDERLIVERABLE failure |
- | (cpl: | + | (cpl: |
- | ((desig: | + | ((desig: |
- | (roslisp: | + | |
- | (cpl:fail ' | + | |
- | : | + | |
</ | </ | ||
- | If the resolving from a designator fails we throw the above error. | + | If the resolving from a designator |
<code lisp> | <code lisp> | ||
- | (cpl: | + | |
- | (cpl: | + | (cpl: |
- | (((or desig: | + | (((or desig: |
- | common-fail: | + | common-fail: |
- | (common-fail: | + | |
- | ? | + | |
- | outer-target-location-retries | + | |
- | (: | + | |
- | (format NIL " | + | (format NIL " |
- | : | + | : |
- | : | + | : |
- | : | + | : |
</ | </ | ||
- | Again this method uses same thinking as [[playground: | + | Again this method uses same thinking as [[playground: |
<code lisp> | <code lisp> | ||
;; take a new `? | ;; take a new `? | ||
- | (cpl: | + | |
- | (cpl: | + | (cpl: |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | common-fail: | + | common-fail: |
- | (common-fail: | + | |
- | ? | + | |
- | relocation-for-ik-retries | + | |
- | (: | + | |
- | (format NIL " | + | (format NIL " |
- | : | + | : |
- | : | + | : |
+ | |||
+ | ;; navigate | ||
+ | (exe: | ||
+ | (type navigating) | ||
+ | | ||
- | ;; navigate | ||
- | (exe: | ||
- | (type navigating) | ||
- | (location ? | ||
</ | </ | ||
Line 919: | Line 927: | ||
(RANGE-INVERT 0.5)> | (RANGE-INVERT 0.5)> | ||
</ | </ | ||
- | As you can see we have again like in [[playground: | + | As you can see we have again like in [[playground: |
If the navigation fails, we try four times another robot location where it can place the object. At the fifth retry the delivering method fails with an '' | If the navigation fails, we try four times another robot location where it can place the object. At the fifth retry the delivering method fails with an '' | ||
If everything goes as intended the robot will stay in front of his target robot location like seen here. | If everything goes as intended the robot will stay in front of his target robot location like seen here. | ||
Line 928: | Line 936: | ||
<code lisp> | <code lisp> | ||
- | ;; take a new `? | + | ;; take a new `? |
- | (cpl: | + | (cpl: |
- | (cpl: | + | (cpl: |
- | (((or common-fail: | + | (((or common-fail: |
- | common-fail: | + | common-fail: |
- | common-fail: | + | common-fail: |
- | (common-fail: | + | |
- | ? | + | |
- | target-location-retries | + | |
- | (: | + | |
- | : | + | : |
- | : | + | : |
- | : | + | : |
- | (roslisp: | + | |
- | " | + | |
- | ;; look | + | |
- | (exe: | + | (exe: |
- | (type turning-towards) | + | |
- | (target ? | + | |
</ | </ | ||
Line 959: | Line 967: | ||
<code lisp> | <code lisp> | ||
- | ;; place | + | ;; place |
- | (let ((place-action | + | (let ((place-action |
- | (or (when place-action | + | (or (when place-action |
- | (let* ((referenced-action-desig | + | (let* ((referenced-action-desig |
- | (desig: | + | |
- | (?arm | + | |
- | (desig: | + | |
- | (? | + | |
- | (desig: | + | |
- | (desig:an action | + | (desig:an action |
- | (type placing) | + | (type placing) |
- | (arm ?arm) | + | (arm ?arm) |
- | (object ? | + | (object ? |
- | (target ? | + | (target ? |
- | (desig:an action | + | (desig:an action |
- | (type placing) | + | (type placing) |
- | (desig:when ?arm | + | (desig:when ?arm |
- | (arm ?arm)) | + | (arm ?arm)) |
- | (object ? | + | (object ? |
- | (target ? | + | (target ? |
</ | </ | ||
Line 1000: | Line 1008: | ||
;; test function throws a high-level-failure if not good pose | ;; test function throws a high-level-failure if not good pose | ||
(proj-reasoning: | (proj-reasoning: | ||
- | ? | + | ? |
</ | </ | ||
Line 1010: | Line 1018: | ||
(TYPE PLACING) | (TYPE PLACING) | ||
(OBJECT #<A OBJECT | (OBJECT #<A OBJECT | ||
- | (LOCATION #<A LOCATION | + | (LOCATION #<A LOCATION |
- | (ON #<A OBJECT | + | (ON #<A OBJECT |
- | (TYPE COUNTER-TOP) | + | (TYPE COUNTER-TOP) |
- | (URDF-NAME SINK-AREA-SURFACE) | + | (URDF-NAME SINK-AREA-SURFACE) |
- | (OWL-NAME " | + | (OWL-NAME " |
- | (PART-OF KITCHEN)> | + | (PART-OF KITCHEN)> |
- | (SIDE LEFT) | + | (SIDE LEFT) |
- | (SIDE FRONT) | + | (SIDE FRONT) |
- | (RANGE-INVERT 0.5)>) | + | (RANGE-INVERT 0.5)>) |
- | (TYPE BOWL) | + | (TYPE BOWL) |
- | (NAME BOWL-1) | + | (NAME BOWL-1) |
- | (POSE ((:POSE | + | (POSE ((:POSE |
#< | #< | ||
FRAME-ID: " | FRAME-ID: " | ||
Line 1041: | Line 1049: | ||
#< | #< | ||
#< | #< | ||
- | (TARGET #<A LOCATION | + | (TARGET #<A LOCATION |
- | (ON #<A OBJECT | + | (ON #<A OBJECT |
- | (TYPE COUNTER-TOP) | + | (TYPE COUNTER-TOP) |
- | (URDF-NAME KITCHEN-ISLAND-SURFACE) | + | (URDF-NAME KITCHEN-ISLAND-SURFACE) |
- | (OWL-NAME " | + | (OWL-NAME " |
- | (PART-OF KITCHEN)> | + | (PART-OF KITCHEN)> |
- | (CONTEXT TABLE-SETTING) | + | (CONTEXT TABLE-SETTING) |
- | (FOR #<A OBJECT | + | (FOR #<A OBJECT |
- | (TYPE BOWL)> | + | (TYPE BOWL)> |
- | (OBJECT-COUNT 3) | + | (OBJECT-COUNT 3) |
- | (SIDE BACK) | + | (SIDE BACK) |
- | (SIDE RIGHT) | + | (SIDE RIGHT) |
- | (RANGE-INVERT 0.5)> | + | (RANGE-INVERT 0.5)> |
- | (exe: | + | |
</ | </ | ||
+ | |||
After all this we can finally execute the place action. | After all this we can finally execute the place action. | ||
+ | |||
+ | <code lisp> | ||
+ | (exe: | ||
+ | </ | ||
{{playground: | {{playground: | ||