Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:beginner:motion_designators [2019/07/03 11:55] – [Using motion designators] tlipps | tutorials:beginner:motion_designators [2022/02/25 23:14] (current) – [Creating motion designators for the TurtleSim] schimpf | ||
---|---|---|---|
Line 3: | Line 3: | ||
**Description: | **Description: | ||
- | **Previous Tutorial:** [[tutorials: | + | **Previous Tutorial:** [[tutorials: |
**Next Tutorial:** [[tutorials: | **Next Tutorial:** [[tutorials: | ||
+ | |||
+ | To run the code in the tutuorial the roscore and the turtlesim need to be started in the terminal. Each in their own tab. | ||
+ | <code bash> | ||
+ | $ roscore | ||
+ | </ | ||
+ | <code bash> | ||
+ | $ rosrun turtlesim turtlesim_node | ||
+ | </ | ||
===== Designators: | ===== Designators: | ||
Line 22: | Line 30: | ||
<code lisp> | <code lisp> | ||
- | (defparameter spy-location (desig:a location (to see) (object ? | + | (defparameter |
</ | </ | ||
(Do not add this code to your tutorial files, it is meant simply for illustration here.) | (Do not add this code to your tutorial files, it is meant simply for illustration here.) | ||
- | This line of code creates a location designator ('' | + | This line of code creates a location designator ('' |
<code lisp> | <code lisp> | ||
- | (reference spy-location) | + | (reference |
</ | </ | ||
Line 46: | Line 54: | ||
</ | </ | ||
- | In your '' | + | In your '' |
<code lisp> | <code lisp> | ||
(defsystem cram-my-beginner-tutorial | (defsystem cram-my-beginner-tutorial | ||
- | :depends-on (cram-language roslisp turtlesim-msg geometry_msgs-msg cl-transforms | + | :depends-on (cram-language roslisp turtlesim-msg |
+ | geometry_msgs-msg cl-transforms | ||
| | ||
:components | :components | ||
Line 70: | Line 79: | ||
</ | </ | ||
- | Now, reload the tutorial in '' | + | Now, reload the tutorial in '' |
+ | |||
+ | <code lisp> | ||
+ | PROLOG> (ros-load: | ||
+ | PROLOG> (in-package :tut) | ||
+ | </ | ||
==== Creating a motion designator ==== | ==== Creating a motion designator ==== | ||
Line 77: | Line 91: | ||
<code lisp> | <code lisp> | ||
- | TUT> (defparameter my-desig (desig:a motion (type driving) (speed 1.5))) | + | TUT> (defparameter |
- | MY-DESIG | + | *MY-DESIG* |
- | TUT> (desig-prop-value my-desig :speed) | + | TUT> (desig-prop-value |
1.5 | 1.5 | ||
</ | </ | ||
+ | |||
+ | We call the variable '' | ||
We use the '' | We use the '' | ||
Line 88: | Line 104: | ||
<code lisp> | <code lisp> | ||
- | TUT> (reference my-desig) | + | TUT> (reference |
Cannot resolve motion designator #< | Cannot resolve motion designator #< | ||
| | ||
Line 181: | Line 197: | ||
<code lisp> | <code lisp> | ||
- | TUT> (defparameter my-desig2 (desig:a motion (type driving) (speed 1.5) (angle 2))) | + | TUT> (defparameter |
- | MY-DESIG2 | + | *MY-DESIG2 |
- | TUT> (reference my-desig2) | + | TUT> (reference |
(DRIVE # | (DRIVE # | ||
</ | </ | ||
Line 228: | Line 244: | ||
<code lisp> | <code lisp> | ||
TUT> (desig:a motion (type moving) (goal (1 1 0))) | TUT> (desig:a motion (type moving) (goal (1 1 0))) | ||
- | #<MOTION-DESIGNATOR | + | #<A MOTION |
+ | | ||
+ | | ||
</ | </ | ||
Line 281: | Line 299: | ||
<code lisp> | <code lisp> | ||
- | TUT> (defparameter my-desig3 (desig:a motion (type setting-pen) (r 100) (g 150) (b 0) (width 5))) | + | TUT> (defparameter |
- | MY-DESIG3 | + | *MY-DESIG3* |
- | TUT> (reference my-desig3) | + | TUT> (reference |
(SET-PEN # | (SET-PEN # | ||
</ | </ |