Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:beginner:high_level_plans [2019/07/29 10:37] – renaming navigating -> navigate amar | tutorials:beginner:high_level_plans [2022/03/15 13:29] (current) – [Writing the plans] schimpf | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| **Next Tutorial:** [[tutorials: | **Next Tutorial:** [[tutorials: | ||
| + | To run the code in the tutuorial the roscore and the turtlesim need to be started over the terminal. Each in their own tab. | ||
| + | <code bash> | ||
| + | $ roscore | ||
| + | </ | ||
| + | <code bash> | ||
| + | $ rosrun turtlesim turtlesim_node | ||
| + | </ | ||
| + | |||
| + | And in the REPL the following commands should be executed: | ||
| + | <code lisp> | ||
| + | CL-USER> | ||
| + | ... | ||
| + | CL-USER> | ||
| + | ... | ||
| + | TUT> | ||
| + | </ | ||
| ===== Designators: | ===== Designators: | ||
| Line 93: | Line 109: | ||
| (def-fact-group turtle-action-designators (action-grounding) | (def-fact-group turtle-action-designators (action-grounding) | ||
| - | (<- (desig: | ||
| - | (desig-prop ?desig (:type :drawing)) | ||
| - | (desig-prop ?desig (:shape :house))) | ||
| - | (<- (desig: | + | (<- (desig: |
| - | (desig-prop ?desig (:type :drawing)) | + | |
| - | (desig-prop ?desig (:shape :rectangle)) | + | |
| - | (desig-prop ?desig (: | + | |
| - | (desig-prop ?desig (:height ?height)) | + | (< |
| - | (lisp-fun get-shape-vertices | + | (desig-prop ?action-designator |
| + | (desig-prop ?action-designator (:shape :house))) | ||
| - | (<- (desig: | + | (<- (desig: |
| - | (desig-prop ?desig (:type : | + | (desig-prop ?action-designator |
| - | (desig-prop ?desig (:shape :triangle)) | + | (desig-prop ?action-designator |
| - | (desig-prop ?desig (:base-width ?base-width)) | + | (desig-prop ?action-designator |
| - | (desig-prop ?desig (:height ?height)) | + | (desig-prop ?action-designator |
| - | (lisp-fun get-shape-vertices :triangle | + | (lisp-fun get-shape-vertices :rectangle |
| - | + | (desig: | |
| - | (<- (desig: | + | (:vertices ? |
| - | (desig-prop ?desig (:type :navigating)) | + | ? |
| - | (desig-prop ?desig (:target | + | |
| + | (<- (desig: | ||
| + | (desig-prop ?action-designator | ||
| + | (desig-prop ?action-designator (:shape : | ||
| + | (desig-prop ? | ||
| + | (desig-prop ? | ||
| + | (lisp-fun get-shape-vertices :triangle ?base-width ?height ? | ||
| + | (desig: | ||
| + | (:vertices ? | ||
| + | ? | ||
| </ | </ | ||
| Line 130: | Line 153: | ||
| TUT> (reference (desig:an action (type drawing) (shape rectangle) (width 5) (height 4))) | TUT> (reference (desig:an action (type drawing) (shape rectangle) (width 5) (height 4))) | ||
| (DRAW-SIMPLE-SHAPE | (DRAW-SIMPLE-SHAPE | ||
| - | ((3.077953338623047d0 11.088889122009277d0 | + | #<A ACTION |
| - | (8.077953338623047d0 11.088889122009277d0 | + | (TYPE DRAWING) |
| - | (8.077953338623047d0 15.088889122009277d0 | + | (VERTICES |
| - | (3.077953338623047d0 15.088889122009277d0 | + | |
| + | | ||
| + | | ||
| TUT> (reference (desig:an action (type drawing) (shape house))) | TUT> (reference (desig:an action (type drawing) (shape house))) | ||
| - | (DRAW-HOUSE) | + | (DRAW-HOUSE |
| + | #< | ||
| + | (TYPE DRAWING) | ||
| + | (SHAPE HOUSE)>) | ||
| </ | </ | ||
| Line 148: | Line 176: | ||
| (in-package :tut) | (in-package :tut) | ||
| - | (defun draw-house () | + | (defun draw-house (&key ((:shape ?shape)) |
| + | & | ||
| + | (declare (type (or keyword) ?shape)) | ||
| (with-fields (x y) | (with-fields (x y) | ||
| (value *turtle-pose*) | (value *turtle-pose*) | ||
| Line 159: | Line 189: | ||
| (exe: | (exe: | ||
| - | (defun draw-simple-shape (vertices) | + | (defun draw-simple-shape (&key |
| + | ((:vertices | ||
| + | & | ||
| + | (declare (type (or list null) ?vertices)) | ||
| (mapcar | (mapcar | ||
| | | ||
| | | ||
| - | | + | ?vertices)) |
| (defun navigate-without-pen (?target) | (defun navigate-without-pen (?target) | ||
| Line 170: | Line 204: | ||
| (exe: | (exe: | ||
| - | (defun navigate (?v) | + | (defun navigate (&key ((: |
| - | (exe: | + | & |
| + | (declare (type (or list null) ?target)) | ||
| + | (exe: | ||
| </ | </ | ||

