Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:intermediate:performing_plans [2016/07/21 15:18] – gkazhoya | tutorials:intermediate:performing_plans [2022/03/30 21:26] (current) – [Plan goals] schimpf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Performing | + | ====== Performing |
- | ==== Basic functionality ==== | + | ===== Basic functionality |
This is a short tutorial to showcase how to call plans through performing action designators. | This is a short tutorial to showcase how to call plans through performing action designators. | ||
Line 8: | Line 8: | ||
<code lisp> | <code lisp> | ||
- | CL-USER> (ros-load: | + | CL-USER> (ros-load: |
- | ;; or ,r-l-s RET cram_plan_library | + | ;; or ,r-l-s RET cram_executive |
</ | </ | ||
Line 15: | Line 15: | ||
<code lisp> | <code lisp> | ||
- | CL-USER> (cpl: | + | CL-USER> (cpl: |
- | | + | |
+ | | ||
</ | </ | ||
Line 22: | Line 23: | ||
<code lisp> | <code lisp> | ||
- | CL-USER> (prolog: | + | CL-USER> (prolog: |
- | | + | |
- | | + | (desig: |
- | | + | (desig: |
</ | </ | ||
Line 34: | Line 35: | ||
<code lisp> | <code lisp> | ||
CL-USER> (cpl: | CL-USER> (cpl: | ||
- | (plan-lib:perform (desig:an action (to eat) (yummy pizza)))) | + | (exe:perform (desig:an action (to eat) (yummy pizza)))) |
hmmm... nomnomnom... PIZZA | hmmm... nomnomnom... PIZZA | ||
+ | NIL | ||
+ | #<A ACTION | ||
+ | (TO EAT) | ||
+ | (YUMMY PIZZA)> | ||
</ | </ | ||
- | ==== Plan goals ==== | + | ===== Plan goals ===== |
Now, let's assume that our action has an explicit effect we would like to follow: | Now, let's assume that our action has an explicit effect we would like to follow: | ||
Line 44: | Line 49: | ||
<code lisp> | <code lisp> | ||
CL-USER> (cpl: | CL-USER> (cpl: | ||
- | (plan-lib:perform (desig:an action (to eat) (yummy pizza) (goal (object-eaten pizza))))) | + | (exe:perform (desig:an action (to eat) (yummy pizza) (goal (object-eaten pizza))))) |
WARNING: | WARNING: | ||
| | ||
Line 62: | Line 67: | ||
CL-USER> (defparameter *pizza-eaten-p* nil) | CL-USER> (defparameter *pizza-eaten-p* nil) | ||
*PIZZA-EATEN-P* | *PIZZA-EATEN-P* | ||
- | CL-USER> (cpl: | + | CL-USER> (cpl: |
- | | + | |
+ | | ||
(setf *pizza-eaten-p* t)) | (setf *pizza-eaten-p* t)) | ||
- | STYLE-WARNING: redefining COMMON-LISP-USER:: | + | ; in: CRAM-LANGUAGE-IMPLEMENTATION: |
+ | ; (TYPE (OR STRING NULL) ?YUMMY) | ||
+ | ; | ||
+ | ; caught WARNING: | ||
+ | ; | ||
+ | ; | ||
+ | ; compilation unit finished | ||
+ | ; | ||
+ | ; ? | ||
+ | ; | ||
+ | WARNING: redefining COMMON-LISP-USER:: | ||
EAT | EAT | ||
CL-USER> (prolog: | CL-USER> (prolog: | ||
- | | + | |
| | ||
| | ||
Line 79: | Line 95: | ||
<code lisp> | <code lisp> | ||
PLAN-LIB> | PLAN-LIB> | ||
- | (plan-lib:perform (desig:an action (to eat) (yummy pizza) (goal (object-eaten pizza))))) | + | (exe:perform (desig:an action (to eat) (yummy pizza) (goal (object-eaten pizza))))) |
hmmm... nomnomnom... PIZZA | hmmm... nomnomnom... PIZZA | ||
NIL | NIL | ||
</ | </ | ||
+ | ===== Restrictions ===== | ||
- | + | Please keep in mind that if there are multiple solutions to a particular action designator, i.e. it resolves to different plans, the first one that is defined will be executed. Ordering is not yet implemented and should probably be taken care of explicitly in the plans anyway. | |
+ | Summary: **make sure an action designator you use for plans can only be resolved to one unique CRAM plan.** |