TB2多机器建图

一共找到三个map merge的包:

multirobot_map_merge

http://wiki.ros.org/multirobot_map_merge/
这个包只提供了map merge的功能,动态地图融合,机器人可以随时加入系统,不必同一时间。
约束:

  • 所有机器人的map发布都要遵循<robot_namespace>/map 的topic名,其中map可以改变,但是所有机器人都要一样。但是每个机器人的robot_namespace都要不同
  • 此包可以以知道初始位姿和不知道初始位姿的方式进行地图融合。

Merging modes

如果知道初始位置,你可以使用第一种得到准确的结果(精准的tf会根据初始位姿计算出来);如果不知道可以使用第二种mode,tf转换会根据启发式算法得到。你可以通过 known_init_poses 这个参数选择两种模式。

merging with known initial positions

这种模式在你知道每一个机器人标准的起始位姿的时候使用,你需要提供每个机器人的初始位姿,并且提供一系列<robot_namespace>/map_merge/init_pose parameters的参数,位姿要基于世界坐标系的。
In this merging these parameters are mandatory. If any of the required parameters is missing robot won’t be considered for merging (you will get warning with name of affected robot).
这种融合中参数是强制性需要的,如果有一个需要的参数确实,机器人就无法实现地图融合

merging without known initial positions

如果你无法提供初始位姿那么这个模式有最少的参数设置要求,你只需要提供每一个机器人的map topic就好了,grids之间的tf是通过特征匹配算法来估计的,所以需要地图之间有足够量的重叠区域来得到一个高概率的匹配。如果没有的花,就可能会和现实情况相差甚远。
Estimating transforms between grids is cpu-intesive so you might want to tune estimation_rate parameter to run re-estimation less often if it causes any troubles.
地图间的tf变换是高cpu消耗的,所以你可以把estimation_rate参数调小,来适应系统的能力。

map_merging

http://wiki.ros.org/map_merging

map_merger

http://wiki.ros.org/map_merger
这个貌似要用到AdHoc的pkg

动手时间

搭建一个多机器人的仿真环境

加入您在indego版本下,可以使用concert,concert只在indego的ubuntu版本下有。
我的系统是kinetic,所以所以我们使用turtlebot3来先模拟一下,莫清楚如何做之后再迁移到turtlebot2上面。
参考资料:

  1. https://www.ncnynl.com/archives/201707/1792.html
  2. https://blog.csdn.net/kdongyi/article/details/84674477#commentBox
    全部命令
roslaunch turtlebot3_gazebo multi_turtlebot3.launch
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
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
ROS_NAMESPACE=tb3_2 roslaunch turtlebot3_slam turtlebot3_gmapping.launch set_base_frame:=tb3_2/base_footprint set_odom_frame:=tb3_2/odom set_map_frame:=tb3_2/map
roslaunch turtlebot3_gazebo multi_map_merge.launch
rosrun rviz rviz -d `rospack find turtlebot3_gazebo`/rviz/multi_turtlebot3_slam.rviz
ROS_NAMESPACE=tb3_0 rosrun turtlebot3_teleop turtlebot3_teleop_key
ROS_NAMESPACE=tb3_1 rosrun turtlebot3_teleop turtlebot3_teleop_key
ROS_NAMESPACE=tb3_2 rosrun turtlebot3_teleop turtlebot3_teleop_key
rosrun map_server map_saver -f ~/map

roslaunch turtlebot3_gazebo multi_turtlebot3.launch

<launch>
#设定turtlebot3的型号以及每一个turtlebot的名字(可能用作前缀)
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="first_tb3"  default="tb3_0"/>
  <arg name="second_tb3" default="tb3_1"/>
  <arg name="third_tb3"  default="tb3_2"/>
#设定每一个机器人的初始位资
  <arg name="first_tb3_x_pos" default="-7.0"/>
  <arg name="first_tb3_y_pos" default="-1.0"/>
  <arg name="first_tb3_z_pos" default=" 0.0"/>
  <arg name="first_tb3_yaw"   default=" 1.57"/>

  <arg name="second_tb3_x_pos" default=" 7.0"/
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值