RTAB-Map

Overview

RTAB-Map’s ROS package. http://wiki.ros.org/rtabmap_ros

Use in launch file

   <include file="$(find rtabmap_ros)/launch/rgbd_mapping.launch" >
            <arg name="rtabmap_args" value="--delete_db_on_start" />
            <arg name="rviz" value="true" />
            <arg name="rtabmapviz" value="false" />
   </include>

RTAB-Map

https://github.com/introlab/rtabmap/wiki/Installation#ubuntu

$ cd ~
$ git clone https://github.com/introlab/rtabmap.git rtabmap
git checkout 0.18.1
$ cd rtabmap/build
$ cmake  -DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel  ..  
$ make
$ sudo make install

Uninstall:

Remove the RTAB-Map’s source directory.
Remove RTAB-Map’s working directory in “~/Documents/RTAB-Map”.
Remove RTAB-Map’s configuration file in “~/.rtabmap/rtabmap.ini”.

sudo make uninstall

Install rtabmap_ros

$ cd ~/catkin_ws
$ git clone https://github.com/introlab/rtabmap_ros.git src/rtabmap_ros
git checkout 0.18.1
$ catkin_make -j1

Test RTAM Map

Run rtabmap
Refer Kinect mapping
在这里插入图片描述

Typical error

Cannot find actor named

https://github.com/introlab/rtabmap/issues/382

[ERROR] (2019-04-11 10:07:33.351) CloudViewer.cpp:2555::setCloudVisibility() Cannot find actor named "cloudOdom".
[ERROR] (2019-04-11 10:07:33.351) CloudViewer.cpp:2555::setCloudVisibility() Cannot find actor named "featuresOdom".
[ERROR] (2019-04-11 10:07:33.498) CloudViewer.cpp:2555::setCloudVisibility() Cannot find actor named "cloud1".

在这里插入图片描述
Analysis:
For me the error is caused by the boost library.
Recompile after rm /usr/local/include/boost/ -rf. Everything works properly.

boost conflict

[ 60%] Building CXX object rtabmap_ros/CMakeFiles/rtabmap_ros.dir/src/nodelets/rgbdicp_odometry.cpp.o
In file included from /usr/local/include/boost/numeric/ublas/vector.hpp:21:0,
                 from /usr/local/include/boost/numeric/ublas/matrix.hpp:18,
                 from /opt/ros/kinetic/include/laser_geometry/laser_geometry.h:37,
                 from /home/yubao/catkin_ws/src/rtabmap_ros/src/nodelets/rgbdicp_odometry.cpp:41:
/usr/local/include/boost/numeric/ublas/storage.hpp: In member function ‘void boost::numeric::ublas::unbounded_array<T, ALLOC>::serialize(Archive&, unsigned int)’:
/usr/local/include/boost/numeric/ublas/storage.hpp:299:18: error: ‘make_array’ is not a member of ‘boost::serialization’
             ar & serialization::make_array(data_, s);
                  ^
/usr/local/include/boost/numeric/ublas/storage.hpp: In member function ‘void boost::numeric::ublas::bounded_array<T, N, ALLOC>::serialize(Archive&, unsigned int)’:
/usr/local/include/boost/numeric/ublas/storage.hpp:494:18: error: ‘make_array’ is not a member of ‘boost::serialization’
             ar & serialization::make_array(data_, s);
                  ^
In file included from /opt/ros/kinetic/include/laser_geometry/laser_geometry.h:37:0,
                 from /home/yubao/catkin_ws/src/rtabmap_ros/src/nodelets/rgbdicp_odometry.cpp:41:
/usr/local/include/boost/numeric/ublas/matrix.hpp: In member function ‘void boost::numeric::ublas::c_matrix<T, M, N>::serialize(Archive&, unsigned int)’:
/usr/local/include/boost/numeric/ublas/matrix.hpp:5977:18: error: ‘make_array’ is not a member of ‘boost::serialization’
             ar & serialization::make_array(data_, N);
                  ^
rtabmap_ros/CMakeFiles/rtabmap_ros.dir/build.make:150: recipe for target 'rtabmap_ros/CMakeFiles/rtabmap_ros.dir/src/nodelets/rgbdicp_odometry.cpp.o' failed
make[2]: *** [rtabmap_ros/CMakeFiles/rtabmap_ros.dir/src/nodelets/rgbdicp_odometry.cpp.o] Error 1
CMakeFiles/Makefile2:4218: recipe for target 'rtabmap_ros/CMakeFiles/rtabmap_ros.dir/all' failed
make[1]: *** [rtabmap_ros/CMakeFiles/rtabmap_ros.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Analysis:

It said the boost header file in " /usr/local/include/boost/" is not compatible with rtabmap_ros.

I checked:

yubao@yubao-Z370M-S01:~$ ls /usr/include/boost/
accumulators                  mem_fn.hpp
algorithm                     memory_order.hpp
align                         move
aligned_storage.hpp           mpi
align.hpp                     mpi.hpp

This looks like I have installed two versions of boost library.
Therefore, I delete one version in /usr/local/include which is mannually installed before.

### RTAB-Map 使用指南 #### 安装 RTAB-Map RTAB-Map 是一种基于图优化的地图构建工具,广泛应用于机器人领域中的 SLAM(同步定位与建图)。以下是其安装方法: 对于 Ubuntu 和 ROS 用户,可以通过以下命令完成 RTAB-Map 的安装: ```bash sudo apt-get update sudo apt-get install ros-$ROS_DISTRO-rtabmap-ros ``` 其中 `$ROS_DISTRO` 需要替换为当前使用的 ROS 版本名称,例如 `noetic` 或 `melodic`[^1]。 #### 启动 RTAB-Map 示例程序 安装完成后,可以运行以下命令来启动 RTAB-Map 的独立应用程序或 ROS 节点: ```bash # 启动独立的应用程序 rtabmap ``` 如果已安装 ROS,则可通过以下方式启动 RTAB-Map 的 ROS 节点: ```bash rosrun rtabmap_ros rtabmap ``` 这将初始化一个基本的 RTAB-Map 实例并等待传感器数据输入[^1]。 #### 基础配置 为了使 RTAB-Map 正常工作,通常需要将其与其他硬件设备集成,例如摄像头、激光雷达或其他传感器。以下是一个简单的 launch 文件模板用于配置 RTAB-Map: ```xml <launch> <!-- 设置参数 --> <param name="frame_id" type="string" value="base_link"/> <!-- 启动 RTAB-Map 节点 --> <node pkg="rtabmap_ros" type="rtabmap" name="rtabmap"> <remap from="scan" to="/scan"/> <remap from="rgb/image" to="/camera/color/image_raw"/> <remap from="depth/image" to="/camera/aligned_depth_to_color/image_raw"/> <!-- 参数设置 --> <param name="subscribe_scan" type="bool" value="true"/> <param name="subscribe_rgbd" type="bool" value="true"/> </node> </launch> ``` 此文件定义了一个基础的 RTAB-Map 配置,支持 RGB-D 数据流以及激光扫描仪的数据订阅[^1]。 #### 解决常见问题 在使用过程中可能会遇到一些常见的错误提示。例如,“无法找到相机驱动”或者“内存不足”。这些问题通常是由于缺少依赖项或资源分配不当引起的。解决办法如下: - **确认所有必要的 ROS 包均已正确安装**。 - **调整 RTAB-Map 中的最大存储容量参数**以适应可用 RAM 大小: ```yaml max_memory: 4096MB ``` #### 结合导航功能 当 RTAB-Map 作为地图构建模块时,可配合 ROS 导航栈实现完整的自主移动能力。具体调优建议参见官方文档[^2]。 ---
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值