This is an old revision of the document!


Performing Activities

This is a short tutorial to showcase how to call plans through performing action designators.

Let's first load the plan library system and switch to its corresponding Lisp package:

CL-USER> (ros-load:load-system "cram_plan_library" :cram-plan-library)
;; or ,r-l-s RET cram_plan_library RET RET
CL-USER> (in-package :cram-plan-library)

Next, let's define the actual plan we want to execute:

PLAN-LIB> (cpl:def-cram-function eat (stuff)
            (format t "hmmm... nomnomnom... ~a~%" stuff))

Because we want to trigger this plan via an action designator, let's define that as well:

PLAN-LIB> (prolog:def-fact-group eating-plans (desig:action-desig)
            (prolog:<- (desig:action-desig ?action-designator (eat ?object))
              (desig:desig-prop ?action-designator (:to :eat))
              (desig:desig-prop ?action-designator (:yummy ?object))))

Now let's try to perform the designator we just defined.

Pay attention that `perform` calls can only be done within a task tree.

PLAN-LIB> (cpl:top-level
            (cpl:perform (desig:an action (to eat) (yummy pizza))))
 
hmmm... nomnomnom... PIZZA