Table of Contents
Homework: ROS packages for knowledge representation
The aim of this assignment is to learn the basics of creating ROS packages, editing knowledge in the KnowRob knowledge base, and querying the knowledge base from another program via the ROS communication middleware. The task is to create (1) an extension package to the KnowRob knowledge base that contains information about objects in a living room as well as a simple 'semantic map' describing the arrangement of objects in the room, and (2) a (very simple) chat client that accepts questions in natural English language and converts them into queries to the knowledge base.
Installation
Please install the system according to the instructions here: https://ai.uni-bremen.de/wiki/software/ros/installation
Getting started
Before starting with the implementation, you should be familiar with ROS and the basic usage of the KnowRob knowledge base. The following tutorials will help you get into it:
Workspace setup
We have created a git repository for the code that you will develop. You can find it at https://github.com/ai-seminar/group-knowledge and add it to your ROS workspace with
rosws set group_knowledge --git https://github.com/ai-seminar/group-knowledge.git rosws update source ~/.bashrc
Implementation
The following list is meant as a guidance to help you realize the functionality.
- Create two ROS packages 'livingroom_map' and 'chat_client' and configure the dependencies between them and to other ROS packages correctly.
- Set up the 'livingroom_map' package as KnowRob package
- Configure the 'chat_client' package to compile Java code and add a simple (empty) Java file in the folder 'src/org/knowrob/tutorials/chat/ChatClient.java'.
- Compile your packages with 'rosmake' and debug all remaining errors. You can have a look at other packages in the KnowRob stack (e.g. mod_vis) to get examples how to configure the CMakeLists.txt
- Create an OWL file 'owl/living_room_objects.owl' in the 'livingroom_map' package using Protege. Import the knowrob.owl ontology from the ias_semantic_map package and create a few object classes as subclasses of the existing classes. Search for 'FurniturePiece', 'FoodVessel', 'BookCopy', etc as starting points.
- Create another file 'owl/living_room_map.owl' that imports 'owl/living_room_objects.owl'. Open this file with the semantic map editor and create instances of a few objects (e.g. a 'Table', two 'Cupboard's and a 'Sofa-PieceOfFurniture').
- Remember to create *.owl.in files from the OWL files in which the global include paths are replaced with placeholders as described here and set up your CMakeLists.txt accordingly. The *.owl.in files are the ones that should be in the repository, not the *.owl files that are generated from them.
- Compile your packages using rosmake and make sure the *.owl files are correctly generated.
- If everything builds fine, add the changed files to the repository and commit them using a meaningful commit message.
- Load KnowRob with the newly created 'livingroom_map' package as argument. The system should load without any errors, and you should see two lines saying that living_room_objects.owl and living_room_map.owl have been parsed.
- Try to visualize the newly added objects and ask for their positions and properties.
- Start with developing the chat client, starting from the test client in json_prolog/examples/JSONPrologTestClient.java (or one of the other example clients in whatever language you prefer). The json_prolog node offers a ROS service through which queries can be sent, the equivalent to the normal interactive Prolog shell that you have used before, just through ROS.
- Extend the client such that it interprets simple natural-language commands like “Where is the sofa?”, generates a Prolog query to read the (x,y,z) position of the sofa, and creates a simple response like “The sofa is at 0.2, 2.4, 0.3”.