Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorials:beginner:process_modules [2016/01/22 16:54] – gkazhoya | tutorials:beginner:process_modules [2016/01/25 11:30] – gkazhoya | ||
---|---|---|---|
Line 70: | Line 70: | ||
" | " | ||
" | " | ||
+ | </ | ||
+ | |||
+ | Finally, let's also add '': | ||
+ | <code lisp> | ||
+ | (:use :cpl :roslisp : | ||
+ | : | ||
</ | </ | ||
Line 132: | Line 138: | ||
(in-package :tut) | (in-package :tut) | ||
- | (cram-process-modules: | + | (def-process-module turtle-actuators (action-designator) |
(roslisp: | (roslisp: | ||
" | " | ||
action-designator) | action-designator) | ||
- | (destructuring-bind (cmd action-goal) (reference action-designator) | + | (destructuring-bind (command |
- | (ecase | + | (ecase |
- | (shape | + | (draw-shape |
- | | + | |
- | :edges (turtle-shape-edges action-goal) | + | :edges (turtle-shape-edges action-goal) |
- | :radius (turtle-shape-radius action-goal)))))) | + | :radius (turtle-shape-radius action-goal)))))) |
+ | |||
+ | (defmacro with-turtle-process-modules (&body body) | ||
+ | `(with-process-modules-running | ||
+ | | ||
+ | , | ||
</ | </ | ||
- | First, we use the '' | + | First, we use the '' |
- | destructuring-bind will map the results from (reference action-designator) to the variables cmd and action-goal respectively. Note that the inference rules we defined previously provide a name for the kind of action goal we have (currently, all are " | + | The '' |
- | The with-turtle-process-modules macro is a macro we define for convenience. It allows us to set up a context in which to run commands, knowing that the turtle process modules are all running concurrently. Right now we only have one defined, turtle-actuators. When we will have several, we will add them to the list we pass to cpm: | + | Let's try this out. Make sure you have '' |
- | + | ||
- | Let's try this out. Make sure you have roscore, turtlesim, and turtle_actionlib running. In a terminal tab for each, | + | |
< | < | ||
Line 158: | Line 167: | ||
</ | </ | ||
- | (**Note** on Oct. 21st 2014: you should check out then catkin_make the ROS common_tutorials from github to make sure you have the newest turtle_actionlib version available, otherwise the turtle might not move. To clone the ros_common tutorials, you will need to | + | For convenience, |
- | + | ||
- | < | + | |
- | git clone https:// | + | |
- | </ | + | |
- | + | ||
- | inside the src folder of a ROS workspace, then catkin_make it.) | + | |
- | + | ||
- | For convenience, | + | |
<code lisp> | <code lisp> |