This is an old revision of the document!
Creating designators for the turtlesim
Description: In this tutorial you will learn what designators are, and in particular, work with action designators: you will learn how to define one, and how to use it.
Previous Tutorial: Implementing simple plans to move a turtle
Next Tutorial: Creating process modules
Designators: an overview
From a user's point of view, a designator is a Common Lisp object that contains a sequence of key-value pairs of symbols. The concept's power and usefulness comes from the fact that it is not required to specify all values when the designator is created. Instead, missing values will be inferred when needed, based on user-specified rules, from the context in which the robot operates; this is known as 'resolving' or '[de]referencing' a designator.
Currently there are three types of designators defined in CRAM:
- location designators: describe locations taking various constraints into account (for example, reachability, visibility etc)
- object designators: describe objects on a symbolic level (what they are, what they may be used for etc)
- action designators: describe an action that a robot should take and serve as input to process modules (covered in the next tutorial)
These types should cover most use cases in robotics, however, if needed, new designator types can be defined as subclasses of the designator class.
As a simple example of a designator creation, suppose we want to create a designator for a location from which some object (for which we already have a designator) can be seen. We would then write
(defparameter spy-location (make-designator 'location `((to see) (obj ,prime-minister))))
(do not add this code to your tutorial files, it is meant simply for illustration here.)
This line of code creates a location designator (spy-location) which 'knows' of the given object (prime-minister, which we assume is an already defined object designator), and knows that its purpose is to see the object. We do not actually specify a location in terms of coordinates at this moment. When we do want to find a suitable set of coordinates for this location, we would call
(reference spy-location)
and, assuming we have set up rules to take into account knowledge of the associated object, the environment, and the vision capabilities of the robot, we would have a process which can enumerate possible coordinates for the location that would satisfy its purpose.
For the rest of this tutorial, we will work with action designators and show a few basics of their creation and use. For a more detailed look at designators, it is recommended that you also look at the cram_designators page.
Next
Usually, a robot will have to execute more tasks at once. It's time to look at what facilities CRAM offers to accomplish that …