当前位置:网站首页>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
边栏推荐
- 2022年Q2加密市场投融资报告:GameFi成为投资关键词
- Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
- Problems of CString in multithreading
- [proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
- UnityShader——MaterialCapture材质捕捉效果 (翡翠斧头)
- Go语言自学系列 | golang中的if else if语句
- 【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示
- 半监督学习
- [list to map] collectors Tomap syntax sharing (case practice)
- 秒殺系統3-商品列錶和商品詳情
猜你喜欢

请做好3年内随时失业的准备?

The difference between calling by value and simulating calling by reference
![[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解](/img/cd/00954b9c592c253d42e6a3b8298999.jpg)
[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解

Secsha system 1- login function

Nifi from introduction to practice (nanny level tutorial) - flow

Vs2017 is driven by IP debugging (dual machine debugging)

Salary 3000, monthly income 40000 by "video editing": people who can make money never rely on hard work!

半监督学习

Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword

Redis在Windows以及Linux系统下的安装
随机推荐
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
Driver and application communication
Creation and destruction of function stack frames
阿飞的期望
Mongodb installation and basic operation
June to - -------
Get the executable path through the process PID (queryfullprocessimagename)
Detailed explanation of four modes of distributed transaction (Seata)
Introduction series of software reverse cracking (1) - common configurations and function windows of xdbg32/64
String functions that you need to know
“用Android复刻Apple产品UI”(2)——丝滑的AppStore卡片转场动画
Automatic generation of client code from flask server code -- Introduction to flask native stubs Library
[combinatorics] combinatorial identity (sum of variable upper terms 1 combinatorial identity | summary of three combinatorial identity proof methods | proof of sum of variable upper terms 1 combinator
Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
秒杀系统3-商品列表和商品详情
App mobile terminal test [5] file writing and reading
Detailed pointer advanced 1
MB10M-ASEMI整流桥MB10M
利用MySQL中的乐观锁和悲观锁实现分布式锁
Break through 1million, sword finger 2million!