Welcome to the fourth lab session of CoTeSys-ROS Fall School on Cognition-enabled Mobile Manipulation on KnowledgeProcessing
The presentation slides, exercise sheet and a cheat sheet are available on-line.
After having installed the system as described in the next section, you can start with the presentation slides and do the exercises once they are mentioned in the slides. You find the solution of the tasks in the tum-ros-pkg repository: https://svn.code.sf.net/p/tum-ros-pkg/code/knowledge/knowrob_tutorial/
Preparation
If you encounter problems while setting up the system, have a look at the FAQ below!
Install the Protege OWL editor: Download Protege WITHOUT JAVA VM from http://protege.stanford.edu/download/protege/4.1/installanywhere/ and follow these instructions. The default values in the graphical installer should be fine.
cd ~/Downloads sh install_protege_4.1.bin ~/Protege_4.1_beta/Protege &
- Update your ROS overlay:
rosinstall $HOME/ros https://svn.code.sf.net/p/tum-ros-pkg/code/rosinstall/fall_school2010.rosinstall $HOME/ros/sandbox
Unpack the template for the tutorial package to your sandbox directory and add the package to your SVN repository knowrob_tutorial.tar.gz
cd ~/ros/sandbox tar xvzf knowrob_tutorial.tar.gz rospack find knowrob_tutorial roscd knowrob_tutorial
- Install the system requirements (call the sudo apt-get install ... command output by rosdep) and rosmake the tutorial:
rosdep satisfy knowrob_tutorial sudo apt-get install [...] # only if something is missing rosmake knowrob_tutorial
Launching the system
The launch procedure for the first part of the tutorial will be explained during the presentation.
For the second part, the interface to the perception component, you can use two alternatives.
tabletop_object_detector perception system
The slides explain how to interface the perception module developed during the Fall School. This requires Gazebo to run properly, which is rather slow on most laptops. It is recommended that you interface the tabletop_object_detector instead, the perception component of the Willow Garage Manipulation Pipeline, and use a bag file to replay the data.
Download the bag file tabletop.bag from http://fallschool2010.informatik.tu-muenchen.de/public/
- Launch using the tabletop.launch in your tutorial package
roslaunch knowrob_tutorial tabletop.launch
Play the bag tabletop.bag while sending a query (you can use rosbag play --loop tabletop.bag to play it in loop)
- Restart tabletop.launch if you get complaints about TF_OLD_DATA
Alternative: use the system developed in the Fall School
This system is based on the simulated environment. You can use the same launch script as on Thursday afternoon for the planning session, and launch the KnowRob system in a separate console. Make sure you have set up your system according to the instructions for Day4
You will need to adapt the explanations in a few details:
- Be sure to use the right template for the tutorial files
- call the /detect_objects_srv/get_table_objects instead of /object_detection
Adapt the Java code to use the GetCurrentObjects service
Launching:
- Terminal1:
export ROBOT_INITIAL_POSE="-x 3 -Y 2.9" roslaunch cram_tutorials cram_tutorials_gazebo.launch
- Terminal 2:
roslaunch cram_tutorials manipulation.launch
- Terminal 3:
rosrun pr2_tuckarm tuck_arms.py -r t -l t rosrun rosprolog rosprolog knowrob_tutorial
FAQ
How do I load the updated Prolog file?
Just restart the Prolog console (CTRL-D to close, rosrun rosprolog rosprolog knowrob_tutorials to start again)checking if java works... configure: error: The Java VM java failed (see config.log, check the CLASSPATH?) You have to temporarily unset the CLASSPATH for making jpl
unset CLASSPATH rosmake jpl export CLASSPATH=`rospack find rosjava_deps`/rosjava_msgs.jar'
Package sun-java6-jdk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source You do not have all required Ubuntu software sources. This can be fixed by first issuing the following:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get update
java.lang.IllegalArgumentException: Malformed \uxxxx encoding
You can also download the jar and run java -jar install_protege_4.1.jar
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.... JAVA_INCLUDE_PATH...
What is probably wrong is your "JAVA_HOME" environment variable used by cmake. Reset it by calling export JAVA_HOME=/usr/lib/jvm/java-6-sun
Links
KnowRob wiki: http://ias.in.tum.de/kb/wiki
ROS packages: http://ias.in.tum.de/kb/wiki/index.php/Knowrob_ROS_modules
Basic tutorial: http://ias.in.tum.de/kb/wiki/index.php/Tutorial:_KnowRob_basics
SWI Prolog manual: http://www.swi-prolog.org/pldoc/refman/
- JPL Java/Prolog interface:
Prolog tutorials: http://www.learnprolognow.org/
Protege/OWL tutorial: http://www.co-ode.org/resources/tutorials/ProtegeOWLTutorial-p4.0.pdf