在Ubuntu 16.04下通过ROS使用 realsense D435i 获取点云数据

一、驱动安装

librealsense安装

librealsnese的安装网址

我是通过指令安装的,总的来说就是一下步骤:

  • Register the server's public key:

    sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE


    In case the public key still cannot be retrieved, check and specify proxy settings: export http_proxy="http://<proxy>:<port>"
    , and rerun the command. See additional methods in the following link.

  • Add the server to the list of repositories:
    Ubuntu 16 LTS:

    sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main" -u

     

  • Install the libraries (see section below if upgrading packages):

    sudo apt-get install librealsense2-dkms
    sudo apt-get install librealsense2-utils

     

  • Optionally install the developer and debug packages:

    sudo apt-get install librealsense2-dev

     

Reconnect the Intel RealSense depth camera and run: realsense-viewer to verify the installation.

Verify that the kernel is updated :
modinfo uvcvideo | grep "version:" should include realsense string

realsense-ros的安装

realsense-ros的安装网址

  • Create a catkin workspace
  • mkdir -p ~/catkin_ws/src
    cd ~/catkin_ws/src/

     

  • Clone the latest Intel® RealSense™ ROS from here into 'catkin_ws/src/'
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^\d+\.\d+\.\d+" | tail -1`
cd ..
  • Make sure all dependent packages are installed. You can check .travis.yml file for reference.
  • Specifically, make sure that the ros package ddynamic_reconfigure is installed. If ddynamic_reconfigure cannot be installed using APT, you may clone it into your workspace 'catkin_ws/src/' from here (Version 0.2.0)
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

二、显示点云

1、安装rgbd_launch 

cd ~/catkin_ws/src/
git clone https://github.com/ros-drivers/rgbd_launch.git
cd ..
catkin_make

2、修改launch文件

将rs_rgbd.launch和rs_camera.launch文件中的<arg name="enable_pointcloud" default="true"/>由false改为true

3、运行RGBD

roslaunch realsense2_camera rs_rgbd.launch

 三、遇到的问题

1、realsense-ros的安装需要librealsense2-dev的依赖,虽然是说是可选,但是不安装的话,realsense-ros会报错找不到librealsense的依赖

2、librealsense安装的时候可能会报错,找不到ddynamic_reconfigure。

在GitHub中找到源码,克隆到工作空间的 src 文件夹下,就可以了。

  • 6
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值