Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
reason_using_computables [2012/12/01 12:58] – created tenorth | reason_using_computables [2014/06/05 11:38] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Computables in the knowledge representation serve for // | + | #REDIRECT doc:reasoning_using_computables |
- | + | ||
- | When you wish to include answers generated by computables into the result set, you need to use // | + | |
- | + | ||
- | We will now present a few applications of computables - if you wish to define custom computables, | + | |
- | + | ||
- | === Qualitative spatial relations | + | |
- | + | ||
- | An important application of computables is to calculate qualitative spatial relations between objects, e.g. if one object is on top of, inside or below another object. Such relations can, of course, simply be asserted: | + | |
- | | + | |
- | + | ||
- | However, there are different problems with this approach: First, the number of relations between objects grows quickly as more and more objects are present in a scene, and all of these would have to be stored, even if they are never needed. Second, scenes are dynamic: Robots are supposed to interact with objects and to move them. Whenever this happens, the system would have to check which relations still hold and which ones have to be updated or retracted from the knowledge base. | + | |
- | + | ||
- | With computables, | + | |
- | | + | |
- | | + | |
- | + | ||
- | In this example, we are loading the ias_semantic_map package that provides a set of object instances, namely pieces of furniture in a kitchen. It already references the package comp_spatial which provides the computables for qualitative spatial relations. The map only consists of typed object instances at different locations. We can query for all objects that are on top of another, or for all objects that are on top of a specific object using the following queries: | + | |
- | | + | |
- | | + | |
- | + | ||
- | The computation is performed by the predicate on_Physical that is defined in the file comp_spatial.pl in the package comp_spatial. | + | |
- | + | ||
- | === Matrix and point identifiers | + | |
- | + | ||
- | In order to facilitate the exchange of spatial information with other parts of the system, KnowRob supports simple matrix and point identifiers. Normally, the location and orientation of objects is described using 4x4 homography matrices, which are rather tedious to handle. Especially when reading information from remote sources, it is much more convenient to get the whole pose information using just one query in form of string that can then be split up into the respective components. | + | |
- | + | ||
- | A [[http:// | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | + | ||
- | We can easily use these computables, | + | |
- | + | ||
- | | + | |
- | | + | |
- | B = literal(type(' | + | |
- | + | ||
- | === Reading information from external sources | + | |
- | + | ||
- | Examples for loading information from external sources, like other ROS nodes, are given in the following packages: | + | |
- | + | ||
- | * comp_cop for reading information from the CoP perception system | + | |
- | * tf_prolog reads coordinate transformations from tf | + | |
- | + | ||
- | Depending on the kind of information to be included, these interfaces need to be adapted, but the general principle should stay the same. | + |