1. ORK
Website: https://wg-perception.github.io/object_recognition_core/
ORK (Object Recognition Kitchen) is an ROS integrated object recognition library. Current Kinetic version of ROS only integrates some binary installation files of feature packages, so it needs to be compiled and installed through source code.
- Install Dependent Libraries
sudo apt-get install meshlab sudo apt-get install libosmesa6-dev sudo apt-get install python-pyside.qtcore sudo apt-get install python-pyside.qtgui
- Create workspace, download feature pack source, compile
mkdir ork_ws && cd ork_ws wstool init src https://raw.github.com/wg-perception/object_recognition_core/master/doc/source/ork.rosinstall.kinetic.plus cd src && wstool update -j8 cd .. && rosdep install --from-paths src -i -y catkin_make
- Setting environment variables
echo "export ~/ork_ws/devel/setup.bash" >> ~/.bashrc source ~/.bashrc
2. CouchDB Building Model Library
The LINEMOD algorithm in ORK is based on template matching. It needs to build a data model of known objects, match one by one according to the collected information, and find the matching objects in the database.First, create the database with the CouchDB tool:
- install
sudo apt-get install couchdb
- Test whether the installation was successful, as shown in the diagram, indicating that the installation was successful
curl -X GET http://localhost:5984
- Data for creating a Coca-Cola can model in a database
rosrun object_recognition_core object_add.py -n "coke " -d "A universal can of coke" --commit
- View in Browser http://localhost:5984/_utils/database.html?object_recognition/_design/objects/_view/by_object_name , copy the id (a string of numbers like scrambles), and use
- Loading a 3D model of a Coke can, including a coke.stl model in ork_tutorials, downloads it directly.Download ork_tutorials
git clone https://github.com/wg-perception/ork_tutorials
- Loading the coke.stl model into the data
rosrun object_recognition_core mesh_add.py bb01ae7a23033bdef1a1c3b76000092c ~/ork_ws/src/ork_tutorials/data/coke.stl --commit
- Open the above web address in the browser again, as shown in the following image
- Install the couchapp tool to view specific models in the browser
sudo pip install git+https://github.com/couchapp/couchapp.git rosrun object_recognition_core push.sh
- View in browser
3. Model Training
rosrun object_recognition_core training -c `rospack find object_recognition_linemod`/conf/training.ork
The training is completed as shown in the following figure
4. Object recognition
- Start realsense d435i camera
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
Reference resources: https://github.com/IntelRealSense/realsense-ros
- Run the following command for object detection
rosrun object_recognition_core detection -c `rospack find object_recognition_linemod`/conf/detection.ros.ork
We found that detection.ros.ork subscribed to the following topics:
The corresponding topic published by realsense is:
/camera/depth/camera_info /camera/depth/image_rect_raw /camera/color/camera_info /camera/color/image_raw
So you need to use topic_tools relay for topic mapping, as follows:
rosrun topic_tools relay /camera/depth/camera_info /camera/depth_registered/camera_info rosrun topic_tools relay /camera/depth/image_rect_raw /camera/depth_registered/image_raw rosrun topic_tools relay /camera/color/camera_info /camera/rgb/icamera_info rosrun topic_tools relay /camera/color/image_raw /camera/rgb/image_rect_color
But mapping each time is too cumbersome, just change the topic name of the detection.ros.ork subscription:
gedit `rospack find object_recognition_linemod`/conf/detection.ros.ork
Modify as follows:
- After you have mapped the topic or set up the above, run the detection command again:
rosrun object_recognition_core detection -c `rospack find object_recognition_linemod`/conf/detection.ros.ork
The following information appears:
- Open rviz view
- Add Pointcloud 2, select topic/camera/depth/color/points
- Add OrkObject, select topic/recognized_object_array (this topic will be published if it is successfully identified)
- View the real-time content of the / recognized_object_array topic
rostopic echo /recognized_object_array
- View Node Diagram
rqt_graph
Reference resources:
[1]. Official website: https://wg-perception.github.io/object_recognition_core/install.html#install
[2]. ROS Robot Development Practice Hu Chunxu
[3]. https://blog.csdn.net/weixin_40799950/article/details/81911877
[4]. https://blog.techbridge.cc/2016/05/14/ros-object-recognition-kitchen/