ROS获取ubuntu虚拟机摄像头数据

一、版本

  • ros为noetic
  • ubuntu为20.04
  • 虚拟机为vmware

二、安装必要软件

sudo apt-get install ros-noetic-uvc-camera
sudo apt-get install ros-noetic-image-* 
sudo apt-get install ros-noetic-rqt-image-view

三、配置

3.1虚拟机配置

虚拟机-可移动设备-(你要选择的摄像头)-连接断开

四、启动命令

roscore #启动ros服务
rosrun usb_cam usb_cam_node #启动摄像头服务
rosrun rviz rviz #启动可视化工具

五、成果检验

rostopic list #查看是否存在/usb_cam/image_raw topic

在rviz工具中,添加
在这里插入图片描述
选择topic后,就可以显示图像
在这里插入图片描述

更多推荐