Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:knowrob_basics [2012/12/01 11:40] – [Setting up KnowRob] tenorth | tutorial:knowrob_basics [2014/06/05 11:38] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== KnowRob basics ====== | + | #REDIRECT doc:knowrob_basics |
- | ~~NOTOC~~ | + | |
- | + | ||
- | ===== Setting up KnowRob ===== | + | |
- | If you would just like to try KnowRob, you can use the binary packages, but if you would like to experiment more and adapt the packages, you should install the source distribution. Please refer to the [[download|installation guide]] for instructions. | + | |
- | + | ||
- | You can now launch the system using the // | + | |
- | < | + | |
- | | + | |
- | </ | + | |
- | You should now see the Prolog console. | + | |
- | + | ||
- | ===== Querying the KnowRob ontology ===== | + | |
- | + | ||
- | The KnowRob taxonomy is loaded by default since mod_vis, the module we loaded, depends on ias_knowledge_base which contains the taxonomy. So you can start exploring the available classes, e.g. with | + | |
- | ?- owl_subclass_of(A, | + | |
- | A = ' | + | |
- | A = ' | + | |
- | A = ' | + | |
- | A = ' | + | |
- | A = ' | + | |
- | A = ' | + | |
- | | + | |
- | + | ||
- | Some notes on the query syntax: Predicates in a query can be linked with a comma, denoting the logical AND, or a semicolon for the logical OR. Each query is finished with a full stop. You can step through the results with the semicolon or just hit < | + | |
- | + | ||
- | Before continuing with the tutorial, try to get familiar with the taxonomy and its main [[KnowRob_Taxonomy|classes]] and properties, either by exploring the hierarchy from Prolog or, more convenient, by loading knowrob.owl into the Protege editor. | + | |
- | + | ||
- | ===== Loading and querying environment information ===== | + | |
- | + | ||
- | So far, we only performed reasoning on the class level. For robotic applications, | + | |
- | + | ||
- | An example set of instances are the semantic maps, contained as OWL file in the [[http:// | + | |
- | | + | |
- | + | ||
- | The package [[http:// | + | |
- | | + | |
- | + | ||
- | Instances are queried using the rdf_has(S, | + | |
- | ?- owl_has(A, rdf:type, knowrob:' | + | |
- | A = ' | + | |
- | A = ' | + | |
- | A = ' | + | |
- | | + | |
- | + | ||
- | For getting an overview of the information that is available about one object instance, we can query for all triples where the respective instance fills the Subject slot: | + | |
- | ?- owl_has(' | + | |
- | P = ' | + | |
- | O = ' | + | |
- | P = ' | + | |
- | O = ' | + | |
- | P = ' | + | |
- | O = ' | + | |
- | P = ' | + | |
- | O = literal(type(' | + | |
- | P = ' | + | |
- | O = literal(type(' | + | |
- | P = ' | + | |
- | O = ' | + | |
- | P = ' | + | |
- | O = ' | + | |
- | P = ' | + | |
- | O = literal(type(' | + | |
- | | + | |
- | + | ||
- | ===== Visualizing objects ===== | + | |
- | + | ||
- | A visualization often helps to find problems with information in the knowledge base, and is also useful to demonstrate what the robot knows about the world. Therefore, we created a [[http:// | + | |
- | + | ||
- | For launching the launch visualization module, type | + | |
- | | + | |
- | + | ||
- | By default, the system loads the kitchen background. We will now clear the canvas, manually select some objects from the map, and push them to the visualization. | + | |
- | | + | |
- | + | ||
- | Note: $C refers to the last binding of the top-level variable C, in this case the handle identifying the canvas. To select and visualize object instances, we call | + | |
- | | + | |
- | + | ||
- | When skipping through the results with the semicolon ;, you'll see the cupboards appear on the canvas. You will notice that they do not have any handles - when pushing just the object itself, the canvas does not draw its children. You can, however, tell it to do so by using the add_object_with_children predicate: | + | |
- | | + | |
- | + | ||
- | The small window that has opened in addition to the visualization canvas contains some control routines that mainly interact with the right section of the canvas, which displays action sequences. In addition, it can show information about any kind of instance in the system, for instance the objects we just added to the canvas. One way of displaying this information is simply by clicking on the object, but you can also update the content from Prolog: | + | |
- | | + |