赞
踩
ubuntu20.04 noetic
usb_cam
宏基暗影骑士笔记本
# 创建工作空间
mkdir -p usb_cam_ws/src
# 克隆仓库
cd usb_cam_ws/src
git clone https://github.com/bosch-ros-pkg/usb_cam.git
sudo apt-get update
sudo apt-get install libv4l-dev
# 编译
cd ..
catkin_make
source ./devel/setup.bash
roslaunch usb_cam usb_cam-test.launch
ls /dev/video*
ls /dev/video*
电脑自带的是video0和video1,外置相机是video2和video3
所以要运行 usb_cam 需要将video0为video2
修改目录:usb_cam / launch
建议修改ros 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>
Add–Bytopic–Image–OK
source ./devel/setup.bash
roslaunch usb_cam usb_cam-test.launch
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。