Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:beginner:assigning_actions [2016/01/25 22:12] gkazhoyatutorials:beginner:assigning_actions [2016/03/04 14:25] (current) – old revision restored (2016/01/25 23:21) gkazhoya
Line 76: Line 76:
  
 <code lisp> <code lisp>
-CL-USER> (in-package :tut+TUT> (defparameter center-location 
-TUT> (defparameter shape-action (make-designator 'action `((type shape) (shape triangle) (radius 1.6))))+       (make-designator :location '((:horizontal-position :center) (:vertical-position :center)))) 
 +CENTER-LOCATION 
 +TUT> (defparameter goal-action 
 +       (make-designator :action `((:type :goal(:goal ,center-location)))) 
 +GOAL-ACTION 
 +TUT> (defparameter shape-action 
 +       (make-designator :action '((:type :shape) (:shape :triangle) (:radius 1.6))))
 SHAPE-ACTION SHAPE-ACTION
-TUT> (defparameter navigation-action (make-designator 'action `((type navigation) (goal ,(make-designator 'location `((vpos center) (hpos center))))))) 
-NAVIGATION-ACTION 
 </code> </code>
  
-With these designators defined, see what happens if you try to call them. For example,+With these designators defined, see what happens if you try to execute them. For example,
  
 <code lisp> <code lisp>
-TUT> (do-action-designator shape-action)+TUT> (perform-some-action goal-action)
 WARNING: WARNING:
    Before starting node, node-status equalled RUNNING instead of :shutdown.  Shutting the previous node invocation down now.    Before starting node, node-status equalled RUNNING instead of :shutdown.  Shutting the previous node invocation down now.
-[(ROSLISP EVENT-LOOP) INFO] 1415203378.618: Terminating ROS Node event loop +[(ROSLISP EVENT-LOOP) INFO] 1453760373.719: Terminating ROS Node event loop 
-[(ROSLISP TOP) INFO] 1415203379.040: Shutdown complete +[(ROSLISP TOP) INFO] 1453760374.142: Shutdown complete 
-[(ROSLISP TOP) INFO] 1415203379.042: Node name is /turtle1 +[(ROSLISP TOP) INFO] 1453760374.149: Node name is /turtle1 
-[(ROSLISP TOP) INFO] 1415203379.042: Namespace is / +[(ROSLISP TOP) INFO] 1453760374.149: Namespace is / 
-[(ROSLISP TOP) INFO] 1415203379.042: Params are NIL +[(ROSLISP TOP) INFO] 1453760374.150: Params are NIL 
-[(ROSLISP TOP) INFO] 1415203379.042: Remappings are: +[(ROSLISP TOP) INFO] 1453760374.150: Remappings are: 
-[(ROSLISP TOP) INFO] 1415203379.042: master URI is 127.0.0.1:11311 +[(ROSLISP TOP) INFO] 1453760374.150: master URI is 127.0.0.1:11311 
-[(ROSLISP TOP) INFO] 1415203380.047: Node startup complete +[(ROSLISP TOP) INFO] 1453760375.155: Node startup complete 
-[(TURTLE-PROCESS-MODULES) INFO] 1415203380.190: Turtle navigation invoked with action designator `#<ACTION-DESIGNATOR ((TYPE +[(TURTLE-PROCESS-MODULES) INFO] 1453760375.181: Turtle simple navigation invoked with action designator `#<ACTION-DESIGNATOR ((TYPE 
-                                                                        SHAPE+                                                                               GOAL
-                                                                       (SHAPE +                                                                              (GOAL 
-                                                                        TRIANGLE+                                                                               #<LOCATION-DESIGNATOR 
-                                                                       (RADIUS +                                                                                 ((HORIZONTAL-POSITION 
-                                                                        1.6)) {1005C58BE3}>'+                                                                                   CENTER
-[(TURTLE-SHAPE-ACTION-CLIENT) INFO] 1415203380.231Waiting for turtle shape action server... +                                                                                  (VERTICAL-POSITION 
-[(TURTLE-SHAPE-ACTION-CLIENTINFO] 1415203382.278: Turtle shape action client created+                                                                                   CENTER)) 
-[(TURTLE-SHAPE-ACTION-CLIENT) INFO] 1415203394.276: Nav action finished. +                                                                                 {100A70EDE3}>)) {100B05B333}>'
-[TURTLE_ACTIONLIB-MSG:SHAPERESULT +[(TURTLE-PROCESS-MODULES) INFO] 1453760375.184Going to point #<3D-VECTOR (4.381962776184082d0 4.012950897216797d0 0.0d0)>
-   INTERIOR_ANGLE: +T
-     1.0471975803375244d0 +
-   APOTHEM: +
-     0.800000011920929d0]+
 </code> </code>
  
-The turtle should also have moved and traced the requested triangle. We can also try and bring it somewhere near the center of its screen:+The turtle should have moved somewhere to the center of its screen
 + 
 +Let's see if it will draw the triangle shape:
  
 <code lisp> <code lisp>
-TUT> (do-action-designator navigation-action)+TUT> (perform-some-action shape-action)
 WARNING: WARNING:
    Before starting node, node-status equalled RUNNING instead of :shutdown.  Shutting the previous node invocation down now.    Before starting node, node-status equalled RUNNING instead of :shutdown.  Shutting the previous node invocation down now.
-[(ROSLISP EVENT-LOOP) INFO] 1415203565.890: Terminating ROS Node event loop +[(ROSLISP EVENT-LOOP) INFO] 1453760384.426: Terminating ROS Node event loop 
-[(ROSLISP TOP) INFO] 1415203566.382: Shutdown complete +[(ROSLISP TOP) INFO] 1453760384.903: Shutdown complete 
-[(ROSLISP TOP) INFO] 1415203566.385: Node name is /turtle1 +[(ROSLISP TOP) INFO] 1453760384.906: Node name is /turtle1 
-[(ROSLISP TOP) INFO] 1415203566.385: Namespace is / +[(ROSLISP TOP) INFO] 1453760384.907: Namespace is / 
-[(ROSLISP TOP) INFO] 1415203566.385: Params are NIL +[(ROSLISP TOP) INFO] 1453760384.907: Params are NIL 
-[(ROSLISP TOP) INFO] 1415203566.385: Remappings are: +[(ROSLISP TOP) INFO] 1453760384.907: Remappings are: 
-[(ROSLISP TOP) INFO] 1415203566.386: master URI is 127.0.0.1:11311 +[(ROSLISP TOP) INFO] 1453760384.907: master URI is 127.0.0.1:11311 
-[(ROSLISP TOP) INFO] 1415203567.392: Node startup complete +[(ROSLISP TOP) INFO] 1453760385.913: Node startup complete 
-[(TURTLE-PROCESS-MODULES) INFO] 1415203567.525: Turtle navigation invoked with action designator `#<ACTION-DESIGNATOR ((TYPE +[(TURTLE-PROCESS-MODULES) INFO] 1453760385.930: Turtle shape navigation invoked with action designator `#<ACTION-DESIGNATOR ((TYPE 
-                                                                        NAVIGATION+                                                                              SHAPE
-                                                                       (GOAL +                                                                             (SHAPE 
-                                                                        #<LOCATION-DESIGNATOR +                                                                              TRIANGLE
-                                                                          ((VPOS +                                                                             (RADIUS 
-                                                                            CENTER+                                                                              1.6)) {100BA6F7A3}>'
-                                                                           (HPOS +[(TURTLE-SHAPE-ACTION-CLIENT) INFO] 1453760385.968Waiting for turtle shape action server... 
-                                                                            CENTER)) +[(TURTLE-SHAPE-ACTION-CLIENT) INFO] 1453760387.968: Turtle shape action client created. 
-                                                                          {10074B8163}>)) {10074B8533}>'+[(TURTLE-SHAPE-ACTION-CLIENT) INFO] 1453760399.919: Nav action finished. 
- +[TURTLE_ACTIONLIB-MSG:SHAPERESULT 
-#<CL-TRANSFORMS:3D-VECTOR (5.806711673736572d0 5.260904312133789d0 0.0d0)>  +   INTERIOR_ANGLE: 
-T+     1.0471975803375244d0 
 +   APOTHEM: 
 +     0.800000011920929d0]
 </code> </code>
- 
-You should also see the turtle move to a central location.