2、使用usb_cam节点发布图像与上篇中的yolo v3 tiny检测
①在darknet_ros/darknet_ros/config/ros.yaml文件中修改订阅的图像消息
修改为/usb_cam/image_raw
roslaunch darknet_ros yolo_v3.launch
参考:冰达机器人/darknet_ros (gitee.com)
②下载usb_cam源码
git clone https://github.com/ros-drivers/usb_cam
修改launch文件
<launch> <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" > <param name="video_device" value="/dev/video0" /> <param name="image_width" value="640" /> <param name="image_height" value="480" /> <param name="pixel_format" value="yuyv" /> <param name="camera_frame_id" value="usb_cam" /> <param name="io_method" value="mmap"/> </node>
<!-- 注释掉此节点,不显示图片 <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen"> <remap from="image" to="/usb_cam/image_raw"/> <param name="autosize" value="true" /> </node>
--> </launch>
roslaunch usb_cam usb_cam-test.launch
③、使用ros usb_cam节点标注摄像头见链接:使用usb_cam软件包调试usb摄像头_通哈膨胀哈哈哈的博客-CSDN博客_usb_cam