Differences

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

Link to this comparison view

tutorials:beginner:motion_designators [2019/02/04 16:47]
vanessa [Using motion designators]
tutorials:beginner:motion_designators [2019/03/07 12:50] (current)
gkazhoya [Defining inference rules for designators]
Line 10: Line 10:
 From a user's point of view, a designator is a Common Lisp object that contains a sequence of key-value pairs representing a high-level, symbolic description of some aspect of robot'​s activity. The power and usefulness of the designator concept comes from the ability to infer concrete parameters when needed, based on user-specified rules, from the context in which the robot operates and the symbolic description in the designator. This is known as '​resolving'​ or '​[de]referencing'​ a designator, and it returns an object containing the newly resolved values that can then be used by the robot to specify some task. From a user's point of view, a designator is a Common Lisp object that contains a sequence of key-value pairs representing a high-level, symbolic description of some aspect of robot'​s activity. The power and usefulness of the designator concept comes from the ability to infer concrete parameters when needed, based on user-specified rules, from the context in which the robot operates and the symbolic description in the designator. This is known as '​resolving'​ or '​[de]referencing'​ a designator, and it returns an object containing the newly resolved values that can then be used by the robot to specify some task.
  
-Currently there are five types of designators defined in CRAM:+Currently there are the following ​types of designators defined in CRAM:
  
   * location designators:​ describe locations taking various constraints into account (for example, reachability,​ visibility etc)   * location designators:​ describe locations taking various constraints into account (for example, reachability,​ visibility etc)
Line 16: Line 16:
   * motion designators:​ describe a low-level motion that a robot should take and serve as input to [[tutorials:​beginner:​process_modules|process modules]]   * motion designators:​ describe a low-level motion that a robot should take and serve as input to [[tutorials:​beginner:​process_modules|process modules]]
   * action designators:​ describe an high-level action, which can't be done with a simple (single) motion   * action designators:​ describe an high-level action, which can't be done with a simple (single) motion
-  * human designators:​ describe a human actor in the scene 
  
 These types should cover most use cases in robotics, however, if needed, new designator types can be defined as subclasses of the ''​designator''​ class. These types should cover most use cases in robotics, however, if needed, new designator types can be defined as subclasses of the ''​designator''​ class.
Line 100: Line 99:
  
 ==== Defining inference rules for designators ==== ==== Defining inference rules for designators ====
 +
 +The function ''​reference''​ uses the CRAM Prolog engine to ground a motion designator into specific motion parameters.
 +CRAM Prolog engine is a Prolog interpreter / compiler implemented as a domain-specific language within Lisp.
 +To learn more about CRAM Prolog look at the [[cram_prolog|Using Prolog for reasoning]] tutorial.
 +To ''​reference''​ a motion designator, ''​motion-grounding''​ Prolog rule is being called on the given designator and the rule binds a tuple of command and specific motion parameters to its second argument.
  
 Append the following to your ''​motion-designators.lisp''​ file: Append the following to your ''​motion-designators.lisp''​ file:
Line 137: Line 141:
 Let's see what this code does. The defstruct declares a structure type to hold values resulting from the inference. It's an instantiation of our motion in a space of (possibly) continuous parameters, which we deduce from a symbolic description of the designator via rules given in the def-fact-group. Let's see what this code does. The defstruct declares a structure type to hold values resulting from the inference. It's an instantiation of our motion in a space of (possibly) continuous parameters, which we deduce from a symbolic description of the designator via rules given in the def-fact-group.
  
-As for the inference rules themselves, these are Prolog code embedded in Lisp, for it is Prolog that powers the inference behind designator resolution. To learn more about CRAM Prolog look at the [[cram_prolog|Using Prolog for reasoning]] tutorial. The ''​def-fact-group''​ is a collection of several rules, each of similar structure, so it helps to look at one of them in more detail:+As for the inference rules themselves, these are Prolog code embedded in Lisp, for it is Prolog that powers the inference behind designator resolution. The ''​def-fact-group''​ is a collection of several rules, each of similar structure, so it helps to look at one of them in more detail:
  
 <code lisp> <code lisp>