ROS: OKR 簡介

 

1. ORK功能包安裝

1.1 安裝依賴

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

1.2 創造工作空間,下載源碼, 編譯(因爲功能包較多,最好重新創建一個工作空間ork_ws)

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

當執行 rosdep install --from-paths src -i -y, 在下載的過程中,出現類似 error: the following packages/stacks could not have their rosdep keys resolved to system depandencies:......錯誤時,,這是因爲缺少xdot功能包導致的,需要在src文件夾下使用如下命令下載xdot源碼,之後重新下載ork源碼。

cd src && git clone https://github.com/jbohren/xdot.git


1.3 設置環境變量
echo "export ~/ork_ws/devel/setup.bash" >> ~/.bashrc

source ~/.bashrc

 

2. ORK功能包安裝

2.1 安裝

sudo apt-get install couchdb

2.2 測試是否安裝成功

curl -X GET http://localhost:5984

 

2.3 創建一條可樂罐模型

rosrun object_recognition_core object_add.py -n "coke " -d "A universal can of coke" --commit

瀏覽器中打開網址http://localhost:5984/_utils/database.html?object_recognition/_design/objects/_view/by_object_name

2.4 下載可樂罐模型

git clone https://github.com/wg-perception/ork_tutorials

注意下載的路徑,把該文件包下載到ork_ws/src/下

2.5 模型加載到數據庫

rosrun object_recognition_core mesh_add.py bb01ae7a23033bdef1a1c3b76000092c ~/ork_ws/src/ork_tutorials/data/coke.stl --commit

2.6 安裝couchapp工具,在瀏覽器中查看具體模型

sudo pip install git+https://github.com/couchapp/couchapp.git
若執行上個命令,提示如下信息,則需要安裝pip
 sudo apt-get update
 sudo apt-get upgrade
sudo apt-get install python-pip

 

rosrun object_recognition_core push.sh

 

在瀏覽器中查看:  http://localhost:5984/or_web_ui/_design/viewer/index.html

點擊object_listing,查看數據列表

點擊mesh,查看模型,點擊後,如下圖:

 

3. 模型訓練

可以試用上述方法增加不同的所需要識別的物體模型,模型創建完成後,使用以下命令對模型進行數據訓練,生成識別所需要的匹配模板。

rosrun object_recognition_core training -c `rospack find object_recognition_linemod`/conf/training.ork

 

物體識別:
 

 

參考:https://www.cnblogs.com/dinghongkai/p/11312874.html

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章