基于handle_detector的机器人对目标定位

来源:互联网 发布:批处理执行python 编辑:程序博客网 时间:2024/06/06 05:01

一、handle_detector包安装和编译
handle_detector包功能:
可以在三维点云中定位操作器械,让机器人从桌子上抓取物体,然后放在箱子中。


需要的依赖软件和工程包
1.ROS Indigo
2.Lapack
3.Openni_launch


在ubuntu安装handle_detector(命令行安装)
sudo apt-get install ros-indigo-handle-detector 
source /opt/ros/indigo/setup.bash
克隆github的handle_detector包到catkin_ws/src
catkin_make
编译报错: 
Could not find a package configuration file provided by “Eigen” with any of 
the following names:
EigenConfig.cmake
eigen-config.cmake
Add the installation prefix of “Eigen” to CMAKE_PREFIX_PATH or set 
“Eigen_DIR” to a directory containing one of the above files. If “Eigen” 
provides a separate development package or SDK, be sure it has been 
installed.
则再修改补充如下
sudo apt-get install libeigen3-dev1
在CMakeLists.txt中将 Eigen改为 Eigen3,即
find_package(Eigen3 REQUIRED) 


include_directories(
 ${EIGEN3_INCLUDE_DIR} 
 ${EIGEN3_LIBRARIES}
)
修改后一切正常,成功安装handle_detector,yeah


图1  成功编译和安装handle_detector
二、使用handle_detector包定位和识别目标
两种方式定位操作器械:
1.从包含点云数据的.pcd文件
roslaunch handle_detector localization_pcd_file.launch 
rosrun rviz rviz
运行报错: no tf data
图2  在RVIZ中无法显示,运行报错
待解决中。。。
分析:
       直接从.pcd文件加载显示和定位这种方法比较传统,属于离线识别,无法实时定位,应用具有一定的局限性,不便广泛开展,所以本人并不打算使用这种方法,而是采用第二种方式。


2.从可以提供点云数据的深度相机,例如kinect


roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true
roslaunch handle_detector localization_sensor.launch
rosrun rviz rviz
运行报错:
terminate called after throwing an instance of 'tf2::LookupException' 
  what():  "base" passed to lookupTransform argument target_frame does not exist. 
[localization-1] process has died [pid 27706, exit code -6, cmd 


怎么解决阿。。。。。。。
一系列操作终于解决
更改https://github.com/atenpas/handle_detector/blob/master/src/localization.cpp这个文件,然后就可以了大笑


图2  效果图










## 相关链接


说明 :  http://wiki.ros.org/handle_detector
资源: https://github.com/atenpas/handle_detector
文章: www.ccs.neu.edu/home/atp/publications/affordances_iser2014_final.pdf

原创粉丝点击