Turtlebot3多机建图教程-遥控建图
Turtlebot3多机建图教程-遥控建图
说明:
- 介绍如何实现多机的遥控建图
相关设备:
- Turbot3-Multi套件,采购地址
操作步骤:
- [Remote PC] 启动roscore
$ roscore
- [TurtleBot] 启动第一台小车
$ ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0" set_lidar_frame_id:="tb3_0/base_scan"
- [TurtleBot] 启动第二台小车
$ ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_1" set_lidar_frame_id:="tb3_1/base_scan"
- [Remote PC] 启动第一台小车模型
$ ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_remote.launch multi_robot_name:=tb3_0
- [Remote PC] 启动第二台小车模型
$ ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_remote.launch multi_robot_name:=tb3_1
- [Remote PC] 启动第一台小车的slam建图
$ ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_base_frame:=tb3_0/base_footprint set_odom_frame:=tb3_0/odom set_map_frame:=tb3_0/map
- [Remote PC] 启动第二台小车的slam建图
$ ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_base_frame:=tb3_1/base_footprint set_odom_frame:=tb3_1/odom set_map_frame:=tb3_1/map
- [Remote PC] 启动地图合并
$ roslaunch turtlebot3_slam turtlebot3_map_merge.launch
- [Remote PC] 启动rviz
$ rviz -d `rospack find turtlebot3_slam`/rviz/multi_turtlebot3_slam.rviz
- [Remote PC]启动第一台机器人键盘控制
$ ROS_NAMESPACE=tb3_0 rosrun turtlebot3_teleop turtlebot3_teleop_key
- [Remote PC]启动第二台机器人键盘控制
$ ROS_NAMESPACE=tb3_1 rosrun turtlebot3_teleop turtlebot3_teleop_key
随后分别遥控机器人在环境里面走动进行建图。
两台机器人的扫描出的地图会重合在一起,可以在点击map选项来某个机器人的地图
示例图:
- 保存地图:
$ rosrun map_server map_saver -f ~/map
演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号