raspberri pi 3 + v2 camera 树莓派摄像头 发布到ros 节点上 远程电脑查看视频

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010918541/article/details/70332235

树莓派3+ros kinetic 版本

远程电脑+ros indigo 版本


首先开启树莓派的摄像头功能

sudo raspi-config

启动摄像头功能

然后重启树莓派


在github 上打开 树莓派官方驱动节点

https://github.com/UbiquityRobotics/raspicam_node

做以下步骤

进入工作空间的源目录

$cd ~/catkin_ws/src

复制该驱动包

$git clone https://github.com/UbiquityRobotics/raspicam_node.git

创建一个依赖文件 必须是下面这个路径 名字也一样

/etc/ros/rosdep/sources.list.d/30-ubiquity.list

然后将下面这句话复制进去

yaml https://raw.githubusercontent.com/UbiquityRobotics/rosdep/master/raspberry-pi.yaml

运行

$rosdep update

cd ~/catkin_ws
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
最后

catkin_make


双机通信

在树莓派的.bashrc 文件中写入

export ROS_HOSTNAME=raspberrypi_ip

export ROS_MASTER_URI=http://raspberrypi_ip:11311  

在远程电脑中.bashrc 文件中写入

export ROS_HOSTNAME=laptop_ip

export ROS_MASTER_URI=http://raspberrypi_ip:11311 


在树莓派和电脑都启动roscore

在树莓派上

Once you have the node built, you can run it using a launch file.

For a V2.x camera, run roslaunch raspicam_node camerav2_1280x960.launch

For a V1.x camera, run roslaunch raspicam_node camerav1_1280x720.launch

在电脑上运行

$rqt_image_view


最后如图


猜你喜欢

转载自blog.csdn.net/u010918541/article/details/70332235
今日推荐