A object recognition framework based on learned object classes.
-
Get the PCL source code:
git clone https://github.com/PointCloudLibrary/pcl pcl-trunk
-
Configure and compile PCL:
NOTE: when compiling PCL please make sure that "opt/ros/groovy/setup.bash" is NOT sourced (see http://www.pcl-users.org/PCL-1-7-Compilation-Problems-td4028868.html)
cd pcl-trunk && mkdir build && cd build ccmake ..
In the interactive menu of ccmake hit
c
for configure. Then enable the variableBUILD_apps
(by setting it toON
) and hitc
for configure. Afterward set the varibaleBUILD_app_3d_rec_framework
toON
and configure again (hitc
). Finally, hitg
for generate and exit.Back on the command line type:
make
The installation of PCL is optional, as we can build the ROS package against the library in PCL's
build
directory:sudo make install
-
Get the code:
git clone https://github.com/arbeitor/strands-object-classification
-
Compile the code using catkin (Please note: it will fail! Just continue with the next step):
cd strands-object-classification catkin_make --force-cmake -DPCL_DIR=/path/tp/pcl/build
-
As the compilation above fails, configure now two missing variables:
PCL_APP_3D_REC_FRAMEWORK_INCLUDE_DIR
andPCL_APP_3D_REC_FRAMEWORK_LIBRARY
. Do this as follows:cd build ccmake ../src -DCATKIN_DEVEL_PREFIX=../devel -DPCL_DIR=/path/to/pcl/build
Within the interactive menu of
ccmake
set the variables:PCL_APP_3D_REC_FRAMEWORK_INCLUDE_DIR
to/path/to/pcl/pcl/apps/3d_rec_framework/include
andPCL_APP_3D_REC_FRAMEWORK_LIBRARY
to �/path/to/pcl/build/lib/libpcl_3d_rec_framework.so
Finally, configure (press
c
), and generate and exit (pressg
). -
Compile again:
cd .. catkin_make --force-cmake -DPCL_DIR=/path/tp/pcl/build
Get a models archive and unzip somewhere on your disk.
Start some terminals and run the commands below:
-
Fire up roscore:
$ roscore
-
Start the recognition service (The duration of the training phase depends on how many models you use):
$ rosrun shape_simple_classifier shape_simple_classifier_node -models_dir /path/to/models/data/ -training_dir /path/to/models/trained/ -nn 10
Use
-chop_z
to cut off all information beyond a given distance. FOr example:-chop_z 2
-
Plug-in the kinect and start openni:
$ roslaunch openni_launch openni.launch
-
Run a client to test the service:
$ rosrun soc_test soc_test_node