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:location_designators [2016/01/25 21:44] gkazhoyatutorials:beginner:location_designators [2016/03/04 14:25] (current) – old revision restored (2016/01/26 10:38) gkazhoya
Line 56: Line 56:
 </code> </code>
  
-Now we'll want some code to generate a location based on a symbolic description found in a designator. There are two interfaces for resolving location designators: one analogous to action designators' ''(action-desig ?desig ?solution)'' Prolog predicate, for locations it's ''(desig-solution ?desig ?solution)'' (predicate names could've been more similar, but, oh well). However, with Prolog rules all solutions have more or less the same priority, and if one constraint can be resolved to multiple solutions there is no way to prioritize one over the other. One use case of priorities is to always just in case check robot's current position when a pose for the robot base is being resolved: if robot's current pose is already sufficient to execute some task (location validator says '':accept'') this mechanism can save some time on re-positioning. In this case robot's current pose will always have higher priority over the rest of location generators. In this tutorial we will implement the same functionality using both interfaces and compare the pros and cons of both.+Now we'll want some code to generate a location based on a symbolic description found in a designator. There are two interfaces for resolving location designators: one analogous to action designators' ''(action-desig ?desig ?solution)'' Prolog predicate, for locations it's ''(desig-solution ?desig ?solution)'' (predicate names could've been more similar, but, oh well), the mechanism is exactly the same as for action designators. However, with Prolog rules all solutions have more or less the same priority, and if one constraint can be resolved to multiple solutions there is no way to prioritize one over the other. One use case of priorities is to always just in case check robot's current position when a pose for the robot base is being resolved: if robot's current pose is already sufficient to execute some task (location validator says '':accept'') this mechanism can save some time on re-positioning. In this case robot's current pose will always have higher priority over the rest of location generators. In this tutorial we will implement a custom generator function that can be prioritized. In fact, the solutions coming from Prolog predicate ''(desig-solution ?location-desig ?solution)'' are also implemented as a custom generator with priority 10. We will discuss priorities in more detail below.
  
 We would like to specify locations for the turtle to go using spatial relations, e.g.: We would like to specify locations for the turtle to go using spatial relations, e.g.: