Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
doc:common-sense_reasoning_about_object_locations [2014/06/05 11:38] – external edit 127.0.0.1doc:common-sense_reasoning_about_object_locations [2014/11/28 12:43] admin
Line 1: Line 1:
 ====== Commonsense knowledge about object locations ====== ====== Commonsense knowledge about object locations ======
 +\\
 +^ This page describes the 'catkinized' version of KnowRob that uses the [[http://wiki.ros.org/catkin/|catkin buildsystem]] and the pure Java-based [[http://wiki.ros.org/rosjava|rosjava]]. The documentation for the older version, which was based on the rosbuild buildsystem and rosjava_jni, can be found [[/doc/writing_an_interface_to_your_perception_system?rev=1417090277|here]].^
 +\\
  
 Commonsense knowledge about typical object locations was acquired by the Open Mind Indoor Common Sense (OMICS [[http://openmind.hri-us.com/]]) project. We processed the natural language database entries and translated them to well-defined concepts within the KnowRob ontology as described in [[http://ias.cs.tum.edu/_media/spezial/bib/kunze10omics.pdf|Putting People's Common Sense into Knowledge Bases of Household Robots]]. In [[http://ias.cs.tum.edu/_media/spezial/bib/kunze12objsearch.pdf| Searching Objects in Large-scale Indoor Environments: A Decision-thereotic Approach]] we applied this knowledge in object search tasks. Commonsense knowledge about typical object locations was acquired by the Open Mind Indoor Common Sense (OMICS [[http://openmind.hri-us.com/]]) project. We processed the natural language database entries and translated them to well-defined concepts within the KnowRob ontology as described in [[http://ias.cs.tum.edu/_media/spezial/bib/kunze10omics.pdf|Putting People's Common Sense into Knowledge Bases of Household Robots]]. In [[http://ias.cs.tum.edu/_media/spezial/bib/kunze12objsearch.pdf| Searching Objects in Large-scale Indoor Environments: A Decision-thereotic Approach]] we applied this knowledge in object search tasks.
  
 ===== Getting Started ===== ===== Getting Started =====
-First you have to build the rospackage knowrob_omics and then run it using rosprolog.+You have to build the //knowrob_omics// package in //knowrob_addons// and run it using rosprolog.
 <code> <code>
- rosmake knowrob_omics 
  rosrun rosprolog rosprolog knowrob_omics  rosrun rosprolog rosprolog knowrob_omics
 </code> </code>
Line 12: Line 14:
 ===== Queries about object locations ===== ===== Queries about object locations =====
 To query the probability of finding an object in a given room type you can use the following query: To query the probability of finding an object in a given room type you can use the following query:
-<code> +<code prolog
- ?- probability_given(knowrob:'OmicsLocations', Obj, knowrob:'Kitchen', Pr). +?- probability_given(knowrob:'OmicsLocations', Obj, knowrob:'Kitchen', Pr). 
- Obj = 'http://ias.cs.tum.edu/kb/knowrob.owl#CitrusFruit', +Obj = knowrob:'CitrusFruit', 
- Pr = 0.003865979381443299 +Pr = 0.0038510911424903724 
- Obj = 'http://ias.cs.tum.edu/kb/knowrob.owl#Bowl-Eating', +Obj = knowrob:'Bowl-Eating', 
- Pr = 0.006443298969072165+Pr = 0.006418485237483954 ; 
 +Obj = knowrob:'PhysicalDevice', 
 +Pr = 0.037227214377406934 ; 
 +Obj = knowrob:'Vegetable-Food', 
 +Pr = 0.006418485237483954 
 </code> </code>
  
 If you are interested in what type of room you could find a given object use the following query: If you are interested in what type of room you could find a given object use the following query:
 <code> <code>
- ?- bayes_probability_given(knowrob:'OmicsLocations', Room, +?- bayes_probability_given(knowrob:'OmicsLocations', Room, knowrob:'Sandwich',Pr). 
- knowrob:'Sandwich',Pr). +Room = knowrob:'Kitchen', 
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#Kitchen', +Pr = 0.20109219415371862 
- Pr = 0.21657432923639094 +Room = knowrob:'OfficeRoom', 
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#OfficeRoom', +Pr = 0.046915489441673196 
- Pr = 0.05065150074968034 +Room = knowrob:'Hallway', 
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#Hallway', +Pr = 0.06843635615803703 
- Pr = 0.07410126961527308 +Room = knowrob:'Classroom', 
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#Classroom', +Pr = 0.07637777632654648 
- Pr = 0.08278900467361545 ; +
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#ConferenceRoom'+
- Pr = 0.08394689285086883 ; +
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#RestaurantSpace', +
- Pr = 0.24008811355348483 +
 </code> </code>
  
 You can see the processed database table entries with: You can see the processed database table entries with:
 <code>  <code> 
- ?- rdf_has(Entry, rdf:type, knowrob:'OmicsLocations'), +?- rdf_has(Entry, rdf:type, knowrob:'OmicsLocations'), 
- rdf_has(Entry,knowrob:subject,Obj), +   rdf_has(Entry,knowrob:subject,Obj), 
- rdf_has(Entry,knowrob:object,Room). +   rdf_has(Entry,knowrob:object,Room). 
- Entry = 'http://ias.cs.tum.edu/kb/knowrob.owl#OmicsLocations-0', +Entry = knowrob:'OmicsLocations-0', 
- Obj = 'http://ias.cs.tum.edu/kb/knowrob.owl#CitrusFruit', +Obj = knowrob:'CitrusFruit', 
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#Kitchen'+Room = knowrob:'Kitchen'
- Entry = 'http://ias.cs.tum.edu/kb/knowrob.owl#OmicsLocations-1', +Entry = knowrob:'OmicsLocations-1', 
- Obj = 'http://ias.cs.tum.edu/kb/knowrob.owl#Bowl-Eating', +Obj = knowrob:'Bowl-Eating', 
- Room = 'http://ias.cs.tum.edu/kb/knowrob.owl#Kitchen' ;+Room = knowrob:'Kitchen'
 +Entry = knowrob:'OmicsLocations-10', 
 +Obj = knowrob:'PhysicalDevice', 
 +Room = knowrob:'Kitchen' ; 
 +Entry = knowrob:'OmicsLocations-100', 
 +Obj = knowrob:'Vegetable-Food', 
 +Room = knowrob:'Kitchen' 
 </code> </code>
  
 Get the list of Room types: Get the list of Room types:
-<code> +<code prolog
- ?- findall(Room, (rdf_has(Entry, rdf:type, knowrob:'OmicsLocations'), +?- findall(Room, (rdf_has(Entry, rdf:type, knowrob:'OmicsLocations'),  
- rdf_has(Entry,knowrob:object,Room)), Rooms), +                  rdf_has(Entry,knowrob:object,Room)), _Rooms),  
- list_to_set(Rooms,RoomSet).+   list_to_set(_Rooms,RoomSet)
 +RoomSet =[knowrob:'Kitchen',  
 +          knowrob:'OfficeRoom',  
 +          knowrob:'Hallway',  
 +          knowrob:'Classroom',  
 +          knowrob:'ConferenceRoom',  
 +          knowrob:'RestaurantSpace',  
 +          knowrob:'LockerRoom',  
 +          knowrob:'AuditoriumRoom',  
 +          knowrob:'Laboratory',  
 +          knowrob:'HospitalRoom'].
 </code> </code>
 +The findall may produce duplicate results, which are eliminated by the //list_to_set// predicate. The underscore in the _Rooms variable indicates that the value of this variable is not returned as a result.
 +