Ubuntu下安装RealSense的Ros包

Ubuntu下安装RealSense的Ros包

melodic版本对应的官方教程:GitHub - IntelRealSense/realsense-ros: Intel(R) RealSense(TM) ROS Wrapper for D400 series, SR300 Camera and T265 Tracking Module

1.介绍

准备工作:
首先需要在Ubuntu中安装Ros(Ubuntu16.04对应的Ros版本为ROS Kinetic),关于Ubuntu下Ros的安装大家可参考下面网址:

    http://wiki.ros.org/kinetic/Installation/Ubuntu
    https://blog.csdn.net/shijiegong123/article/details/103082119

2.安装RealSense的Ros包

Install Intel® RealSense™ ROS from Sources
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/
    https://github.com/IntelRealSense/realsense-ros/releases

    $catkin_init_workspace

    $cd ..

(以下可以直接catkin_make,,然后source devel/setup.bash)

    $catkin_make clean

    $catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release

    $catkin_make install

$echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

    1

    $source ~/.bashrc

若编译时出现
realsense2_camera/src/base_realsense_node.cpp:363:14: error: ‘class ddynamic_reconfigure::DDynamicReconfigure’ has no member named ‘publishServicesTopics’ ddynrec->publishServicesTopics();

原因:
IntelRealSense-Ros上缺少DDynamic_reconfigure(被intel删掉了),因此需要安装DDynamic_reconfigure

解决办法:

    sudo apt-get install ros-kinetic-ddynamic_reconfigure (没有效果)

    需要进入
    https://github.com/pal-robotics/ddynamic_reconfigure 下载源码DDynamic_reconfigure,将源码放到catkin_ws/src/下再重新catkin_make

注意:下载kinetic-devel分支!!!

3.使用
安装好RealSense的Ros包后,打开终端使用下面指令查看
$roslaunch realsense2_camera rs_rgbd.launch(或者roslaunch realsense2_camera rs_camera.launch)

$rostopic echo /camera/color/camera_info

4.问题
ResourceNotFound: rgbd_launch

Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
    p.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
    self._start_infrastructure()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
    self._load_config()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
    loader.load(f, config, verbose=verbose)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 746, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
..........................................
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 329, in _resolve_args
    resolved = commands[command](resolved, a, args, context)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 142, in _find
    source_path_to_packages=source_path_to_packages)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 188, in _find_executable
    full_path = _get_executable_path(rp.get_path(args[0]), path)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 203, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: rgbd_launch

解决办法:
sudo apt-get install ros-kinetic-rgbd-launch

具体可参考网址:https://github.com/IntelRealSense/realsense-ros

参考链接:https://blog.csdn.net/shijiegong123/article/details/102736987

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值