1. ORKhtml
網址:https://wg-perception.github.io/object_recognition_core/python
ORK (Object Recognition Kitchen) 是 ROS 集成的物體識別庫,當前 Kinetic 版本的 ROS 只集成了部分功能包的二進制安裝文件,因此需經過源碼編譯安裝。git
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
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
echo "export ~/ork_ws/devel/setup.bash" >> ~/.bashrc source ~/.bashrc
2. CouchDB 創建模型庫github
ORK 中的 LINEMOD 算法基於模板匹配,須要創建已知物體的數據模型,根據採集的信息逐一匹配,找到與數據庫中匹配的物體。首先,用 CouchDB 工具建立數據庫:算法
sudo apt-get install couchdb
curl -X GET http://localhost:5984
rosrun object_recognition_core object_add.py -n "coke " -d "A universal can of coke" --commit
git clone https://github.com/wg-perception/ork_tutorials
rosrun object_recognition_core mesh_add.py bb01ae7a23033bdef1a1c3b76000092c ~/ork_ws/src/ork_tutorials/data/coke.stl --commit
sudo pip install git+https://github.com/couchapp/couchapp.git rosrun object_recognition_core push.sh
3. 模型訓練數據庫
rosrun object_recognition_core training -c `rospack find object_recognition_linemod`/conf/training.ork
訓練完以下圖所示瀏覽器
4. 物體識別bash
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
參考:https://github.com/IntelRealSense/realsense-rosapp
rosrun object_recognition_core detection -c `rospack find object_recognition_linemod`/conf/detection.ros.ork
咱們發現,detection.ros.ork 訂閱了下面幾個話題:curl
realsense 發佈的對應的話題爲:
/camera/depth/camera_info /camera/depth/image_rect_raw /camera/color/camera_info /camera/color/image_raw
所以須要用 topic_tools relay 作話題映射,以下所示:
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
但每次都作映射太麻煩,乾脆修改一下 detection.ros.ork 訂閱的話題名:
gedit `rospack find object_recognition_linemod`/conf/detection.ros.ork
修改以下:
rosrun object_recognition_core detection -c `rospack find object_recognition_linemod`/conf/detection.ros.ork
此時會出現下圖所示信息:
rostopic echo /recognized_object_array
rqt_graph
參考:
[1]. 官網:https://wg-perception.github.io/object_recognition_core/install.html#install
[2]. 《ROS機器人開發實踐》胡春旭
[3]. https://blog.csdn.net/weixin_40799950/article/details/81911877
[4]. https://blog.techbridge.cc/2016/05/14/ros-object-recognition-kitchen/