Commonsense knowledge about object locations


This page describes the 'catkinized' version of KnowRob that uses the catkin buildsystem and the pure Java-based rosjava. The documentation for the older version, which was based on the rosbuild buildsystem and rosjava_jni, can be found 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 Putting People's Common Sense into Knowledge Bases of Household Robots. In Searching Objects in Large-scale Indoor Environments: A Decision-thereotic Approach we applied this knowledge in object search tasks.

Getting Started

You have to build the knowrob_omics package in knowrob_addons and run it using rosprolog.

 rosrun rosprolog rosprolog knowrob_omics

Queries about object locations

To query the probability of finding an object in a given room type you can use the following query:

?- probability_given(knowrob:'OmicsLocations', Obj, knowrob:'Kitchen', Pr).
Obj = knowrob:'CitrusFruit',
Pr = 0.0038510911424903724 ;
Obj = knowrob:'Bowl-Eating',
Pr = 0.006418485237483954 ;
Obj = knowrob:'PhysicalDevice',
Pr = 0.037227214377406934 ;
Obj = knowrob:'Vegetable-Food',
Pr = 0.006418485237483954 

If you are interested in what type of room you could find a given object use the following query:

?- bayes_probability_given(knowrob:'OmicsLocations', Room, knowrob:'Sandwich',Pr).
Room = knowrob:'Kitchen',
Pr = 0.20109219415371862 ;
Room = knowrob:'OfficeRoom',
Pr = 0.046915489441673196 ;
Room = knowrob:'Hallway',
Pr = 0.06843635615803703 ;
Room = knowrob:'Classroom',
Pr = 0.07637777632654648 

You can see the processed database table entries with:

 
?- rdf_has(Entry, rdf:type, knowrob:'OmicsLocations'),
   rdf_has(Entry,knowrob:subject,Obj),
   rdf_has(Entry,knowrob:object,Room).
Entry = knowrob:'OmicsLocations-0',
Obj = knowrob:'CitrusFruit',
Room = knowrob:'Kitchen' ;
Entry = knowrob:'OmicsLocations-1',
Obj = knowrob:'Bowl-Eating',
Room = knowrob:'Kitchen' ;
Entry = knowrob:'OmicsLocations-10',
Obj = knowrob:'PhysicalDevice',
Room = knowrob:'Kitchen' ;
Entry = knowrob:'OmicsLocations-100',
Obj = knowrob:'Vegetable-Food',
Room = knowrob:'Kitchen' 

Get the list of Room types:

?- findall(Room, (rdf_has(Entry, rdf:type, knowrob:'OmicsLocations'), 
                  rdf_has(Entry,knowrob:object,Room)), _Rooms), 
   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'].

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.