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
Last revisionBoth sides next revision
tutorials:beginner:location_designators_2 [2019/07/03 12:00] – [Location designator generators] tlippstutorials:beginner:location_designators_2 [2019/07/09 19:21] – [Using a location designator] gkazhoya
Line 32: Line 32:
 ===== Location designator generators ===== ===== Location designator generators =====
  
-Let's create a new file called ''location-designators.lisp'' in our tutorial's ''src'' directory and add it to the ''*.asd'' file with ''process-modules'' depending on it. The resulting ''cram-my-beginner-tutorial.asd'' should now look like this:+Let's create a new file called ''location-designators.lisp'' in our tutorial's ''src'' directory and add it to the ''*.asd'' file. The resulting ''cram-my-beginner-tutorial.asd'' should now look like this:
  
 <code lisp> <code lisp>
Line 62: Line 62:
        (make-designator :location '((:vertical-position :bottom) (:horizontal-position :left))))        (make-designator :location '((:vertical-position :bottom) (:horizontal-position :left))))
 TUT> goal-desig TUT> goal-desig
-#<LOCATION-DESIGNATOR ((:VERTICAL-POSITION :BOTTOM) +#<LOCATION 
-                       (:HORIZONTAL-POSITION :LEFT)) {1008548CD3}>+​    (VERTICAL-POSITION BOTTOM) 
 +    (HORIZONTAL-POSITION LEFT)>
 </code> </code>
  
Line 194: Line 195:
 </code> </code>
  
-Depending on the random number generator we will get some or none of the solutions rejected and, therefore, ''<='' number of valid solutions for our designator ''another-goal''.+Depending on the random number generator we will get some or none of the solutions rejected and, therefore, ''<='' number of valid solutions for our designator ''another-goal''That means, you might get a different number of solutions than what we got: we got 3 but you might be 4 or 5 or something else. 
  
  
Line 231: Line 233:
          (let ((target-point (reference motion)))          (let ((target-point (reference motion)))
            (roslisp:ros-info (turtle-process-modules)            (roslisp:ros-info (turtle-process-modules)
-                             "Goint to point ~a." target-point)+                             "Going to point ~a." target-point)
            (move-to target-point)))))))            (move-to target-point)))))))
  
Line 269: Line 271:
                                (horizontal-position ?horizontal-position)                                (horizontal-position ?horizontal-position)
                                (vertical-position ?vertical-position)))                                (vertical-position ?vertical-position)))
-               (goal (desig:a motion (type :going-to) (:goal ?area))))+               (goal (desig:a motion (type going-to) (goal ?area))))
           (cram-executive:perform goal))))))           (cram-executive:perform goal))))))
 </code> </code>
  
-In ''goto-location'' we use ''perform'', which means we have to make sure the right process module for our ''going-to'' designator can be found. For that we add a rule to the fact-group ''available-turtle-process-modules'':+In ''goto-location'' we use ''perform'', which means we have to make sure the right process module for our ''going-to'' designator can be found. For that we add a rule to the fact-group ''available-turtle-process-modules'' from the ''selecting-process-modules.lisp'' file. The file should now look like this:
  
 <code lisp> <code lisp>
Line 310: Line 312:
 [(ROSLISP TOP) INFO] 1501153969.641: master URI is 127.0.0.1:11311 [(ROSLISP TOP) INFO] 1501153969.641: master URI is 127.0.0.1:11311
 [(ROSLISP TOP) INFO] 1501153970.649: Node startup complete [(ROSLISP TOP) INFO] 1501153970.649: Node startup complete
-[(TURTLE-PROCESS-MODULES) INFO] 1501153970.689: TurtleSim navigation invoked with motion designator `#<MOTION-DESIGNATOR ((TYPE +[(TURTLE-PROCESS-MODULES) INFO] 1562698457.619: TurtleSim navigation invoked with motion designator `#<MOTION 
-                                                                           GOING-TO) +    (TYPE GOING-TO) 
-                                                                          (GOAL +    (GOAL #<LOCATION 
-                                                                           #<LOCATION-DESIGNATOR +    (HORIZONTAL-POSITION RIGHT) 
-                                                                             ((HORIZONTAL-POSITION +    (VERTICAL-POSITION TOP)>)>'
-                                                                               RIGHT) +[(TURTLE-PROCESS-MODULES) INFO] 1501153970.691: Going to point #<3D-VECTOR (10.131428718566895d0 8.874866485595703d0 0.0d0)>.
-                                                                              (VERTICAL-POSITION +
-                                                                               TOP)+
-                                                                             {1005139363}>)) {1005139703}>'+
-[(TURTLE-PROCESS-MODULES) INFO] 1501153970.691: Goint to point #<3D-VECTOR (10.131428718566895d0 8.874866485595703d0 0.0d0)>.+
 T T
 +</code>
 +
 +If you already had a running node in the REPL, you might get the error shown below but that is absolutely normal: ROS simply notifies you that it is going to shut down the previous node and start a new one.
 +<code lisp>
 +WARNING:
 +   Before starting node, node-status equalled RUNNING instead of :shutdown.  Shutting the previous node invocation down now.
 </code> </code>