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
cfor configure. Then enable the variableBUILD_apps(by setting it toON) and hitcfor configure. Afterward set the varibaleBUILD_app_3d_rec_frameworktoONand configure again (hitc). Finally, hitgfor generate and exit.Back on the command line type:
makeThe installation of PCL is optional, as we can build the ROS package against the library in PCL's
builddirectory: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_DIRandPCL_APP_3D_REC_FRAMEWORK_LIBRARY. Do this as follows:cd build ccmake ../src -DCATKIN_DEVEL_PREFIX=../devel -DPCL_DIR=/path/to/pcl/buildWithin the interactive menu of
ccmakeset the variables:PCL_APP_3D_REC_FRAMEWORK_INCLUDE_DIRto/path/to/pcl/pcl/apps/3d_rec_framework/includeandPCL_APP_3D_REC_FRAMEWORK_LIBRARYto �/path/to/pcl/build/lib/libpcl_3d_rec_framework.soFinally, 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 10Use
-chop_zto 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