ROS2与turtlebot4仿真入门教程-使用rtabmap进行建图和导航
说明
- 介绍如何通过rtabmap进行建图和导航
- 测试环境: humble + turtlebot4 simulator
步骤
- 启动ignition仿真
ros2 launch turtlebot4_ignition_bringup turtlebot4_ignition.launch.py slam:=false nav2:=true rviz:=true
- 效果图:
- 启动建图
ros2 launch rtabmap_demos turtlebot4_slam.launch.py use_sim_time:=true qos:=2
#OR
ros2 launch rtabmap_launch rtabmap.launch.py rtabmap_viz:=true subscribe_scan:=true rgbd_sync:=true depth_topic:=/oakd/rgb/preview/depth odom_sensor_sync:=true camera_info_topic:=/oakd/rgb/preview/camera_info rgb_topic:=/oakd/rgb/preview/image_raw visual_odometry:=false approx_sync:=true approx_rgbd_sync:=false odom_guess_frame_id:=odom icp_odometry:=true odom_topic:="icp_odom" map_topic:="/map" qos:=2 use_sim_time:=true odom_log_level:=warn rtabmap_args:="--delete_db_on_start --Reg/Strategy 1 --Reg/Force3DoF true --Mem/NotLinkedNodesKept false" use_action_for_goal:=true
- 点击gazebo右下角的三角,开始运行仿真
- 再点击右上角··的图标让turtlebot4离开充电桩
- viz效果图:
- rviz效果图
移动机器人
- 方法1:使用rviz上的Nav2 Goal来指定目标点进行导航
- 方法2:启动键盘控制
ros2 run teleop_twist_keyboard teleop_twist_keyboard
- 方法3: 安装m-explore-ros2实现自主探索建图
ros2 launch explore_lite explore.launch.py
参考:
演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号