Running ECTO Object Recognition on Ubuntu 11.10 / ROS Electric
I am trying to install the object recognition stack on Ubuntu 11.10 / ROS Electric. I started with looking at https://github.com/wg-perception/recognition_kitchen where the Readme tells me that for Electric, I should rather look at https://github.com/wg-perception/ros-object_recognition. I am wondering whether installation can be done any easier?
Compiling ros-object_recognition
In my ROS workspace, I add to my .rosinstall file
- git: {
local-name: ros-object_recognition,
uri: 'git://github.com/wg-perception/ros-object_recognition.git',
version: master
}
and let rosinstall clone ros-object_recognition into my workspace
$ rosinstall .
$ source setup.bash
$ roscd ros-object_recognition
There are 186 packages to build on my machine (I tripled my 2 GB RAM on my notebook for this task). I had all the system dependencies installed previously. Note that I got ros-object_recognition at 56f07e1653bbf816e2f709d502b51cfd56e4ca9a.
$ rosmake
Resulting in
tabletop/src/table/TableVisualizationMsgAssembler.cpp:
In member function
‘void tabletop::TableVisualizationMsgAssembler::addConvexHullTable(const Table&)’:
tabletop/src/table/TableVisualizationMsgAssembler.cpp:215:107
After patching the broken commit (e-mail me for a patch in case), compilation stopped with another error:
$ rosmake object_recognition_core
cd /home/julius/ros/ros-object_recognition/object_recognition_core && ./pypath.sh #create a soft link to our python path
+ find lib/python2.7 -path *ecto -print0
+ libname=lib/python2.7/dist-packages/ecto
+ dirname lib/python2.7/dist-packages/ecto
+ libname2=lib/python2.7/dist-packages
+ ln -sf lib/python2.7/dist-packages pyshared
cd /home/julius/ros/ros-object_recognition/object_recognition_core
&& cp -fr ./pyshared/object_recognition_msgs/* ../object_recognition_msgs/src/object_recognition_msgs
cp: target `../object_recognition_msgs/src/object_recognition_msgs' is not a directory
-------------------------------------------------------------------------------
Being adventurous, I took the straight-forward approach to create the missing directory
$ roscd object_recognition_msgs
$ mkdir -p src/object_recognition_msgs
Compilation now succeded
[ rosmake ] Results:
[ rosmake ] Built 186 packages with 0 failures.
Initializing and tracking a template plane
So I went over to learning a reference frame (a step necessary to learn models from objects) as described in http://ecto.willowgarage.com/recognition/release/latest/capture/index.html#orb-template .
$ roscore
$ roslaunch openni_launch openni.launch
Before running anything, I sourced into another environment just because paths weren't set and env.sh is apparently setting some paths.
$ roscd object_recognition_core
$ source env.sh
Now
$ rosrun object_recognition_core orb_template.py -o ~/template_plane
This worked pretty well and the template plane was robustly tracked with or without object placed upon the plane.
$ rosrun object_recognition_core orb_track.py --track_directory ~/template_plane
Works like a charm, really.
Capturing model data
Now following http://ecto.willowgarage.com/recognition/release/latest/capture/index.html#platform-specific-instructions, I proceeded to capture a model by
$ rosrun object_recognition_core capture -i ~/template_plane --seg_z_min 0.01 -o a.bag
Unfortunately, I am running out of luck here and happen to run into some Python path troubles
Traceback (most recent call last):
File "/home/julius/ros/ros-object_recognition/object_recognition_core/bin/capture",
line 70, in <module>
use_turn_table=False)
File "/home/julius/ros/ros-object_recognition/object_recognition_core/lib/python2.7/dist-packages/capture/openni_capture.py",
line 81, in create_capture_plasm
from ecto_ros import Mat2Image, RT2PoseStamped
ImportError: cannot import name Mat2Image
Inspecting the python path, I can see
/home/julius/ros/object_recognition/object_recognition_core/lib/python2.7/dist-packages
/opt/ros/electric/ros/core/roslib/src
Manually looking into what is ...