本文叙述了在gazebo仿真环境和rviz可视化工具的背景下,使用cartographer算法和turtlebot3-burger机器人在自己构建的室内场景中建图过程。目前存在的问题是在建图过程中只能在机器人移动过程中实时显示点云信息,但无法建立地图,Rviz中显示No map received。待解决后再将解决方法和最终实验结果更新至此文。
1. 建立工作空间
(1)建立cartographer功能包
# 安装依赖项
sudo apt-get install -y google-mock libboost-all-dev libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx ros-indigo-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev
# 安装ceres solver 1.11.0(路径随意)
git clone https://github.com/hitcm/ceres-solver-1.11.0.git
cd ceres-solver-1.11.0
mkdir build
cd build
cmake ..
make –j
sudo make install
# 安装cartographer(路径随意)
git clone https://github.com/hitcm/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install
# 安装cartographer_ros
cd catkin_ws_cartographer/src
git clone https://github.com/hitcm/cartographer_ros.git
cd ..
catkin_make
source ~/catkin_ws_cartographer/devel/setup.bash
rospack profile
(2)建立turtlebot3-burger机器人模型
cd ~/catkin_ws_cartographer/src
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ~/catkin_ws_cartographer
rosdep install --from-paths src -i -y
catkin_make
echo "source ~/catkin_ws_cartographer/devel/setup.bash " >> ~/.bashrc
source ~/.bashrc
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
source ~/