当前位置:网站首页>Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (II)
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (II)
2022-07-03 16:02:00 【Pony Baby】
List of articles
introduction
Then I will talk about the content of the previous lesson , We use the single machine in the last lesson slam Map of construction . This time we introduce several robots , And use multirobot_map_merge This package is used for real-time fusion map . The source file is in the gitee In the link .
To write map_merge file
This file is used to start map_merge service , Accept all with robot_namespace At the beginning map file , And fuse through the initial position coordinates , If you do not specify the initial position coordinates , Fusion may depend on features for its , It's not going to work .
<launch>
<arg name="robot_name" default="tb3_0"/>
<arg name="robot_x_pos" default="0.0"/>
<arg name="robot_y_pos" default="0.0"/>
<arg name="robot_z_pos" default=" 0.0"/>
<arg name="robot_yaw" default=" 0.0"/>
<arg name="if_first_robot" default="false"/>
<group ns="$(arg robot_name)/map_merge">
<param name="init_pose_x" value="$(arg robot_x_pos)"/>
<param name="init_pose_y" value="$(arg robot_y_pos)"/>
<param name="init_pose_z" value="$(arg robot_z_pos)"/>
<param name="init_pose_yaw" value="$(arg robot_yaw)" />
</group>
<group if="$(arg if_first_robot)">
<node pkg="multirobot_map_merge" type="map_merge" respawn="false" name="map_merge" output="screen">
<param name="robot_map_topic" value="map"/>
<!-- Accept all with tb3 At the beginning map-->
<param name="robot_namespace" value="tb3"/>
<param name="merged_map_topic" value="map"/>
<param name="world_frame" value="map"/>
<param name="known_init_poses" value="true"/>
<param name="merging_rate" value="0.5"/>
<param name="discovery_rate" value="0.05"/>
<param name="estimation_rate" value="0.5"/>
<param name="estimation_confidence" value="1.0"/>
</node>
</group>
<node pkg="tf" type="static_transform_publisher" name="world_to_$(arg robot_name)_tf_broadcaster" args="0 0 0 0 0 0 /map /$(arg robot_name)/map 100"/>
</launch>
To write two_robots_slam.launch file
Go successively gazebo Put two robots in the environment , And start the map fusion node
<launch>
<!--SLAM Algorithm -->
<arg name="slam_method" default="gmapping"/>
<arg name="simulation" default="true"/>
<group if="$(arg simulation)" >
<!-- Open the simulation world -->
<include file="$(find gazebo_tutorials)/launch/create_world.launch" />
<!-- Place the robot -->
<include file="$(find gazebo_tutorials)/launch/place_robot.launch">
<arg name="robot_x_pos" value="0.0"/>
<arg name="robot_y_pos" value="0.0"/>
<arg name="robot_z_pos" value="0.0"/>
<arg name="robot_yaw" value="0.0"/>
<arg name="robot_name" value="tb3_0"/>
</include>
<!-- Place the robot -->
<include file="$(find gazebo_tutorials)/launch/place_robot.launch">
<arg name="robot_x_pos" value="0.5"/>
<arg name="robot_y_pos" value="0.0"/>
<arg name="robot_z_pos" value="0.0"/>
<arg name="robot_yaw" value="0.0"/>
<arg name="robot_name" value="tb3_1"/>
</include>
</group>
<!-- Turn on SLAM -->
<include file="$(find gazebo_tutorials)/slam_methods/$(arg slam_method).launch">
<arg name="ns" value="tb3_0"/>
</include>
<include file="$(find gazebo_tutorials)/slam_methods/$(arg slam_method).launch">
<arg name="ns" value="tb3_1"/>
</include>
<!-- Start the map fusion node and join 1 Robot map information -->
<include file="$(find gazebo_tutorials)/launch/map_merging.launch">
<arg name="if_first_robot" value="True"/>
<arg name="robot_x_pos" value="0.0"/>
<arg name="robot_y_pos" value="0.0"/>
<arg name="robot_z_pos" value="0.0"/>
<arg name="robot_name" value="tb3_0"/>
</include>
<!-- Join in 2 Robot map information -->
<include file="$(find gazebo_tutorials)/launch/map_merging.launch">
<arg name="if_first_robot" value="False"/>
<arg name="robot_x_pos" value="0.5"/>
<arg name="robot_y_pos" value="0.0"/>
<arg name="robot_z_pos" value="0.0"/>
<arg name="robot_name" value="tb3_1"/>
</include>
<!-- rviz -->
<include file="$(find gazebo_tutorials)/launch/rviz_two_robots.launch" />
</launch>
RVIZ To configure
We click add, choice map, then topic Set to /map, It's the integrated map
Then join in laserscan Scan point cloud and axes Robot coordinates 
What we need to do this time rviz There are more configurations , So we save it as a configuration file , Each start launch Files run automatically .
The way to save is to click on the upper left corner file,save config as, Then write rviz file
<launch>
<!-- rviz -->
<node pkg="rviz" type="rviz" name="rviz" required="true" args="-d $(find gazebo_tutorials)/rviz/two_robots.rviz"/>
</launch>
Then we just need to run directly roslaunch gazebo_tutorials two_robots_slam.launch, You can start it
Finally generated rqt_graph, Clear structure 
Use teleop Control and map_saver Save the map
Basically the same as before , Remember to change ROS_NAMESPACE, Use the following command to tb3_0 To operate ROS_NAMESPACE=tb3_0 rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Use the following command to save the map rosrun map_server map_saver -f xxx/Map
边栏推荐
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验5 外部中断实验(学习笔记)
- WinDbg分析dump文件
- Microservice sentinel flow control degradation
- Nine ways to define methods in scala- Nine ways to define a method in Scala?
- CString中使用百分号
- Embedded development: seven reasons to avoid open source software
- 突破100万,剑指200万!
- Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
- ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
- "Remake Apple product UI with Android" (3) - elegant statistical chart
猜你喜欢

MB10M-ASEMI整流桥MB10M

从 flask 服务端代码自动生成客户端代码 -- flask-native-stubs 库介绍
![[list to map] collectors Tomap syntax sharing (case practice)](/img/ac/e02deb1cb237806d357a88fb812852.jpg)
[list to map] collectors Tomap syntax sharing (case practice)

CString getbuffer and releasebuffer instructions

Function introduction of JMeter thread group

Mb10m-asemi rectifier bridge mb10m

Rk3399 platform development series explanation (WiFi) 5.54. What is WiFi wireless LAN
![[redis foundation] understand redis master-slave architecture, sentinel mode and cluster together (Demo detailed explanation)](/img/1f/3dd95522b8d5f03dd763a6779e3db5.jpg)
[redis foundation] understand redis master-slave architecture, sentinel mode and cluster together (Demo detailed explanation)

MongoDB 的安装和基本操作

Reading notes of "micro service design" (Part 2)
随机推荐
Embedded development: seven reasons to avoid open source software
MB10M-ASEMI整流桥MB10M
请做好3年内随时失业的准备?
Low level version of drawing interface (explain each step in detail)
[combinatorial mathematics] binomial theorem and combinatorial identity (binomial theorem | three combinatorial identities | recursive formula 1 | recursive formula 2 | recursive formula 3 Pascal / Ya
Go语言自学系列 | golang中的if else if语句
Microservices - load balancing ribbon
App移动端测试【4】apk的操纵
Microservice - declarative interface call openfeign
How can technology managers quickly improve leadership?
Salary 3000, monthly income 40000 by "video editing": people who can make money never rely on hard work!
Driver and application communication
Subclass hides the function with the same name of the parent class
Mb10m-asemi rectifier bridge mb10m
Detailed explanation of string function and string function with unlimited length
How idea starts run dashboard
VS2017通过IP调试驱动(双机调试)
"Remake Apple product UI with Android" (3) - elegant statistical chart
Rk3399 platform development series explanation (WiFi) 5.54. What is WiFi wireless LAN
Unity function - unity offline document download and use