目录:

  • Ailibot2仿真入门教程-环境配置
  • Ailibot2仿真入门教程-gazebo-设计简单的gazebo场景
  • Ailibot2仿真入门教程-gazebo-使用gazebo插件生成场景的截面地图
  • Ailibot2仿真入门教程-gazebo-加载gazebo场景
  • Ailibot2仿真入门教程-加载Ailibot2的URDF模型到gazebo
  • Ailibot2仿真入门教程-加载Ailibot2的SDF模型到gazebo
  • Ailibot2仿真入门教程-利用robot_localization融合里程和IMU数据
  • Ailibot2仿真入门教程-控制-键盘控制
  • Ailibot2仿真入门教程-建图-gmapping建图
  • Ailibot2仿真入门教程-建图-slam_toolbox建图
  • Ailibot2仿真入门教程-建图-cartographer建图

文章说明

  • 本教程主要介绍Ailibot2在gazebo仿真中进行cartographer算法建图的操作流程
  • 安装没安装cartographer,则使用命令安装
rcm ros2_algorithm install_ros2_cartographer_apt

操作步骤

  • 启动gazebo仿真,加载Ailibot2模型
$ ros2 launch ailibot2_bringup robot_sim.launch.py
  • 启动cartographer算法建图节点
$ ros2 launch ailibot2_slam cartographer.launch.py use_rviz:=true
  • 启动键盘控制节点,移动建图
$ ros2 launch ailibot2_teleop keyboard.launch.py

Ailibot2仿真入门教程-建图-cartographer建图_ROS2

  • 保存地图
# 根目录下新建一个map文件夹,如果根目录下有map文件夹,请忽略该步骤
$ mkdir ~/map

# 启动保存地图节点
$ ros2 launch ailibot2_slam save_map.launch.py map:=${HOME}/map/map.yaml
# 或执行
$ ros2 run nav2_map_server map_saver_cli -f ~/map/map --ros-args -p save_map_timeout:=10000.00
  • 查看保存好的地图
$ eog ~/map/map.pgm