kinect v2使用RTAB-MAP建图和导航 节点介绍

  • 安装RTAB-MAP
$ sudo apt-get install ros-indigo-rtabmap-ros

(1)for kinect v2

  • 指令
建立连接:
roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true
静态tf:
rosrun tf static_transform_publisher 0 0 0 -1.5707963267948966 0 -1.5707963267948966 camera_link kinect2_link 100
启动文件:
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start" rgb_topic:=/kinect2/qhd/image_color_rect depth_topic:=/kinect2/qhd/image_depth_rect camera_info_topic:=/kinect2/qhd/camera_info 

or

roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true
roslaunch rtabmap_ros rgbd_mapping_kinect2.launch resolution:=qhd

可利databaseViewer工具查看数据库

rtabmap-databaseViewer ~/.ros/rtabmap.db

用rviz建图
roslaunch rtabmap_ros rtabmap.launch后面加上 rviz:= true

(2)for realsense d435i

  • 启动相机
roslaunch realsense2_camera rs_camera.launch align_depth:=true unite_imu_method:="linear_interpolation"
  • 启动rtabmap
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="–delete_db_on_start" depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info

or

roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="–delete_db_on_start" depth_topic:=/camera/depth/image_rect_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info approx_sync:=false

or

rosrun imu_filter_madgwick imu_filter_node _use_mag:=false _publish_tf:=false _world_frame:="enu" /imu/data_raw:=/camera/imu /imu/data:=/rtabmap/imu
roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start --Optimizer/GravitySigma 0.3" depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info approx_sync:=false wait_imu_to_init:=true imu_topic:=/rtabmap/imu

3D点云地图的保存

rosrun pcl_ros pointcloud_to_pcd input:=/rtabmap/cloud_map

启动定位模式

上面建图模式,生成数据库之后,launch后添加 localization:=true

roslaunch rtabmap_ros demo_turtlebot_mapping.launch localization:=true

节点分析

  • 运行
rqt_graph
  • 得到手持深度相机rtabmap节点图kinect v2使用RTAB-MAP建图和导航 节点介绍_第1张图片
  • rtabmap
    • 是RTAB-Map核心库的封装
    • 检测到循环闭合,增量构建和优化地图
    • 在线输出最新地图
  • rtabmapviz
    • RTAB-Map的可视化接口,是 RTAB-Map GUI图形库的封装,类似rviz但有针对RTAB-Map的可选项
  • Visual Odometry 视觉里程
  • rgbd_odometry
    • 该节点包含RGBD里程方法
    • 使用RGBD图像从中提取的视觉特征(STFT, SURF, ORB 等)及其深度图像的深度信息来计算里程
    • 使用图像之间的特征对应,RANSAC方法计算连续图像之间的变换。

你可能感兴趣的:(视觉slam,#,rtab-map)