Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
tutorials:beginner:controlling_turtlesim_2 [2017/09/07 11:40] – [ASDF dependencies] cpo | tutorials:beginner:controlling_turtlesim_2 [2017/09/07 12:52] – cpo |
---|
==== ASDF dependencies ==== | ==== ASDF dependencies ==== |
| |
Now open ''cram-beginner-tutorial.asd'' and update the system dependencies to include the system ''roslisp'', ''turtlesim-msg'', ''geometry_msgs-msg'' and ''cl-transforms''. The systems that correspond to the messages of a package are always named like the package name with a ''-msg'' suffix. Your system should now look like this: | Now open ''cram-beginner-tutorial.asd'' and update the system dependencies to include the system ''roslisp'', ''turtlesim-msg'', ''turtlesim-srv'', ''geometry_msgs-msg'' and ''cl-transforms''. The systems that correspond to the messages of a package are always named like the package name with a ''-msg'' suffix. Your system should now look like this: |
| |
<code lisp> | <code lisp> |
:angular (make-msg "geometry_msgs/Vector3" :z ang)))) | :angular (make-msg "geometry_msgs/Vector3" :z ang)))) |
| |
(defun set-pen (r g b width off) | (defun call-set-pen (r g b width off) |
"Function to call the SetPen service." | "Function to call the SetPen service." |
(call-service *pen-srv* 'turtlesim-srv:SetPen | (call-service *pen-srv* 'turtlesim-srv:SetPen |
| |
<code lisp> | <code lisp> |
TUT> (init-ros-turtle "/turtle1") | TUT> (init-ros-turtle "turtle1") |
</code> | </code> |
| |
We also can change how the turtle writes on the background. Try: | We also can change how the turtle writes on the background. Try: |
<code lisp> | <code lisp> |
TUT> (set-pen 255 0 0 10 0) | TUT> (call-set-pen 255 0 0 10 0) |
</code> | </code> |
| |
We use the ''set-pen'' function, also defined in ''control-turtlesim.lisp''. The line the turtle leaves on the ground should be red. Try moving the turtle, either with the teleop or the ''send-vel-cmd'' function. | We use the ''call-set-pen'' function, also defined in ''control-turtlesim.lisp''. The line the turtle leaves on the ground should be red. Try moving the turtle, either with the teleop or the ''send-vel-cmd'' function. |
| |
| |