Differences

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

Link to this comparison view

create_and_load_a_semantic_map [2013/02/12 18:41]
127.0.0.1 external edit
create_and_load_a_semantic_map [2014/06/05 13:38] (current)
Line 1: Line 1:
-====== Create and load a semantic map ====== +#REDIRECT doc:create_and_load_a_semantic_map
- +
-Semantic maps are descriptions of an environment in terms of localized object instances and are stored in OWL files. Much of the environment- and object-related functionality in KnowRob depends of having a valid semantic map, so you may want to create one for your robot'​s environment. +
- +
-===== Create your semantic map ===== +
- +
-There are different ways how to create a semantic map in OWL: +
- +
-==== Semantic Map Editor ==== +
-The [[Semantic Map Editor]] is a graphical editor for semantic maps. It can be used to create object instances and to set their positions. +
- +
-==== SemanticMapToOWL ==== +
-If you already have a map datastructure and would like to create a semantic map from your program, you can use the SemanticMapToOWL ROS service described here: http://​ias.in.tum.de/​kb/​wiki/​index.php/​Mod_semantic_map#SemanticMapToOWL If you do not want to use the service, you can still have a look at how the OWL is generated using the OWLAPI, but since the internal object representation is quite a complex thing, I'd recommend to start with that service. +
- +
-The object types in the semantic map message need to correspond to the object classes in KnowRob. If the identifiers do not match, you need to create a mapping at some point; if you use the conversion service, the easiest place would be to have the mapping in your code for now. You can get a list of all object classes in KnowRob using the following command: +
-<​code>​ +
-rosrun mod_semantic_map SemanticMapToOWL list +
-</​code>​ +
- +
- +
-==== Robot perception system ==== +
-If you have [[Write an interface to your perception system|integrated a perception system]] with KnowRob, a kind of semantic map is automatically created by the objects the robot perceives. You can save the in-memory map to an OWL file using the methods in the [[http://​ros.org/​wiki/​knowrob_common|//​owl_export//​ module]]. +
- +
- +
-==== Manual creation of the OWL file ==== +
-In some cases, it may actually be the fastest to create the map manually in a good text editor in which you can copy and paste the object instances and their pose matrices. Especially if you would like to set many semantic object properties beyond their poses, this may be a good option. If you plan to do this, you should have well understood [[object pose representation|how object poses are represented in KnowRob]]. +
- +
- +
-===== Load the map into KnowRob ===== +
-To make the map available for querying and inference in KnowRob, you just need to parse the OWL file. You can either do this manually after having started the KnowRob shell using the //​owl_parse//​ predicate given below, or you can put that command into the init.pl of a [[Create your own KnowRob package|package you have created]]. +
- +
-<​code>​ +
- $ rosrun rosprolog rosprolog ias_knowledge_base +
- ?- owl_parse('​path/​to/​file.owl',​ false, false, true). +
-</​code>​ +
- +