< >
Home » ROS与VSLAM入门教程 » ROS与VSLAM入门教程-rtabmap_ros-远程建图

ROS与VSLAM入门教程-rtabmap_ros-远程建图

ROS与VSLAM入门教程-rtabmap_ros-远程建图

说明:

  • 介绍如何在远程完成建图

Robot端设置:

  • 设置IP地址:
$ ifconfig
eth0      Link encap:Ethernet  HWaddr ##:##:##:##:##:##  
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
...
$ export ROS_IP=192.168.1.3
  • 新建launch文件, vim freenect_throttle.launch,使用rtabmap_ros/data_throttle nodelet,并设置频率为5hz
  • 代码如下:
<launch>
  <include file="$(find freenect_launch)/launch/freenect.launch">
     <arg name="depth_registration" value="True" />
  </include>

  <arg name="rate"  default="5"/>
  <arg name="decimation"  default="1"/> <!-- Reduce the image size, e.g., 2 means "width/2 x height/2". -->
  <arg name="approx_sync" default="true" />

  <!-- Use same nodelet used by Freenect/OpenNI -->
  <group ns="camera">
    <node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle camera_nodelet_manager" output="screen">
      <param name="rate" type="double" value="$(arg rate)"/>
      <param name="decimation" type="int" value="$(arg decimation)"/>
      <param name="approx_sync" type="bool" value="$(arg approx_sync)"/>

      <remap from="rgb/image_in"       to="rgb/image_rect_color"/>
      <remap from="depth/image_in"     to="depth_registered/image_raw"/>
      <remap from="rgb/camera_info_in" to="rgb/camera_info"/>

      <remap from="rgb/image_out"       to="data_throttled_image"/>
      <remap from="depth/image_out"     to="data_throttled_image_depth"/>
      <remap from="rgb/camera_info_out" to="data_throttled_camera_info"/>
    </node>
  </group>      
</launch>
  • 启动launch文件
$ roslaunch freenect_throttle.launch rate:=5

远程电脑:

  • 设置网络
$ ifconfig
eth0      Link encap:Ethernet  HWaddr ##:##:##:##:##:##  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
...
$ export ROS_IP=192.168.1.2
  • 设置master
$ export ROS_MASTER_URI=http://192.168.1.3:11311
  • 启动rtabmap.launch
$ roslaunch rtabmap_ros rtabmap.launch rgb_topic:=/camera/data_throttled_image depth_topic:=/camera/data_throttled_image_depth camera_info_topic:=/camera/data_throttled_camera_info compressed:=true rtabmap_args:="--delete_db_on_start"
  • 在rtabmapviz下进行建图

  • 观察带宽,约使用~500 KiB/s,在Ubuntu,如下:

请输入图片描述

高级设置:

  • 使用额外里程计,设置参数 visual_odometry:=false and odom_topic:="/odom"
  • 对于深度图, 如果设置参数compressed:=true,image_transport处理就会使用compressedDepth话题
  • 对于RGB图,image_transport处理就会使用compressed话题
  • 设置参数rgb_image_transport:=theora,可以改变类型为theora
  • 可以手工启动rviz或设置rviz:=true来启动
  • 不希望使用rtabmapviz,可以通过设置参数rtabmapviz:=false关闭

参考:

  • http://wiki.ros.org/rtabmap_ros/Tutorials/RemoteMapping

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros与vslam入门教程