ROS功能包 find_object的使用
1.功能包的安装
安装依赖
sudo apt-get install ros-melodic-find-object-2d
定位到工作空间 下载源码编译
cd ~/catkin_ws
git clone https://github.com/introlab/find-object src/find_object_2d
catkin_make
2.运行功能包
1.启动roscore
roscore
2.启用摄像头节点
roslaunch usb_cam usb_cam-test.launch
3.启动功能包
rosrun find_object_2d find_object_2d image:=/usb_cam/image_raw
4.实现物体检测
- 在find_object界面左侧 Objects下面的空白界面,单击鼠标右键->Add objects form scene
- 按Take picture,选择你准备识别的物体
- 框出目标物体 点击->next,->end
5.find_object_3d
修改find_object_3d.launch 文件
<launch>
<!-- Example finding 3D poses of the objects detected -->
<!-- $roslaunch openni_launch openni.launch depth_registration:=true -->
<arg name="object_prefix" default="object"/>
<arg name="objects_path" default=""/>
<arg name="gui" default="true"/>
<arg name="approx_sync" default="true"/>
<arg name="pnp" default="true"/>
<arg name="tf_example" default="true"/>
<arg name="settings_path" default="~/.ros/find_object_2d.ini"/>
#修改为深度相机所发布的话题
<arg name="rgb_topic" default="camera/color/image_raw"/>
<arg name="depth_topic" default="camera/depth/image_rect_raw"/>
<arg name="camera_info_topic" default="camera/color/camera_info"/>
<node name="find_object_3d" pkg="find_object_2d" type="find_object_2d" output="screen">
<param name="gui" value="$(arg gui)" type="bool"/>
<param name="settings_path" value="$(arg settings_path)" type="str"/>
<param name="subscribe_depth" value="true" type="bool"/>
<param name="objects_path" value="$(arg objects_path)" type="str"/>
<param name="object_prefix" value="$(arg object_prefix)" type="str"/>
<param name="approx_sync" value="$(arg approx_sync)" type="bool"/>
<param name="pnp" value="$(arg pnp)" type="bool"/>
<remap from="rgb/image_rect_color" to="$(arg rgb_topic)"/>
<remap from="depth_registered/image_raw" to="$(arg depth_topic)"/>
<remap from="depth_registered/camera_info" to="$(arg camera_info_topic)"/>
</node>
<!-- Example of tf synchronisation with the objectsStamped message -->
<node if="$(arg tf_example)" name="tf_example" pkg="find_object_2d" type="tf_example" output="screen">
<param name="object_prefix" value="$(arg object_prefix)" type="str"/>
</node>
</launch>
启动3d物体检测
roslaunch realsense_camera rs_rgbd.launch
roslaunch find_object_2d find_object_3d.launch
rviz