realsense-ros的github教程的翻译(我自己注释)

黄色部分为我注释的。

https://github.com/IntelRealSense/realsense-ros

ROS Wrapper for Intel® RealSense™ Devices

These are packages for using Intel RealSense cameras (D400 series SR300 camera and T265 Tracking Module) with ROS.

LibRealSense supported version: v2.36.0 (see realsense2_camera release notes)

 

Installation Instructions

The following instructions are written for ROS Kinetic, on Ubuntu 16.04 but apply to ROS Melodic on Ubuntu 18.04 as well, by replacing kinetic with melodic wherever is needed.

//这里说明下面两种安装方法的前提要装好Ubuntu和ROS

Step 1: Install the ROS distribution

  •  

 

There are 2 sources to install realsense2_camera from:

  •  

  • Method 1: The ROS distribution://我很好奇方法一都这么方便了为什么还要用方法2?

    realsense2_camera is available as a debian package of ROS distribution. It can be installed by typing:

    export ROS_VER=kinetic 
    

    or

    export ROS_VER=melodic 
    

    sudo apt-get install ros-$ROS_VER-realsense2-camera`     //这个似乎就是ROS功能包的安装语句,因为我再ROS书上看他们功能包的安装也是这样的语句。是啊,我觉得既然已经是ROS功能包了,可以这样安装。我现在确认了一下这确实就是ROS功能包安装的标准语句,看我下面拍自《ROS机器人开发实践》里面的。明白了这个,你上面指令感觉都不需要什么$ROS_VER,直接把ROS的版本号写上就可以了。你清楚了功能包名词的命名规则。

    • The version of librealsense2 is almost always behind the one availeable in RealSense™ official repository.
    • librealsense2 is not built to use native v4l2 driver but the less stable RS-USB protocol. That is because the last is more general and operational on a larger variety of platforms.
    • realsense2_description is available as a separate debian package of ROS distribution. It includes the 3D-models of the devices and is necessary for running launch files that include these models (i.e. rs_d435_camera_with_model.launch). It can be installed by typing: sudo apt-get install ros-$ROS_VER-realsense2-description
  • This will install both realsense2_camera and its dependents, including librealsense2 library.//这里的意思是说这种安装方法会把SDK也自动安装了,对比方法二要先装SDK再装ROS功能包。

  • Notice:

  •  

Method 2: The RealSense™ distribution:

This option is demonstrated in the .travis.yml file. It basically summerize the elaborate instructions in the following 2 steps:

 

Step 1: Install the latest Intel® RealSense™ SDK 2.0

  •  
  • Install from Debian Package - In that case treat yourself as a developer. Make sure you follow the instructions to also install librealsense2-dev and librealsense-dkms packages.

OR

  •  

 

  • Step 2: Install Intel® RealSense™ ROS from Sources

    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.2)
    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

 

Usage Instructions

 

Start the camera node

//开启摄像头节点

To start the camera node in ROS:

roslaunch realsense2_camera rs_camera.launch

This will stream all camera sensors and publish on the appropriate ROS topics.

Other stream resolutions and frame rates can optionally be provided as parameters to the 'rs_camera.launch' file.

 

Published Topics 

//ROS里发布话题

The published topics differ according to the device and parameters. After running the above command with D435i attached, the following list of topics will be available (This is a partial list. For full one type rostopic list):

  • /camera/color/camera_info
  • /camera/color/image_raw
  • /camera/depth/camera_info
  • /camera/depth/image_rect_raw
  • /camera/extrinsics/depth_to_color
  • /camera/extrinsics/depth_to_infra1
  • /camera/extrinsics/depth_to_infra2
  • /camera/infra1/camera_info
  • /camera/infra1/image_rect_raw
  • /camera/infra2/camera_info
  • /camera/infra2/image_rect_raw
  • /camera/gyro/imu_info
  • /camera/gyro/sample
  • /camera/accel/imu_info
  • /camera/accel/sample
  • /diagnostics

The "/camera" prefix is the default and can be changed. Check the rs_multiple_devices.launch file for an example. If using D435 or D415, the gyro and accel topics wont be available. Likewise, other topics will be available when using T265 (see below).

猜你喜欢

转载自blog.csdn.net/sinat_16643223/article/details/107739689