当前位置:网站首页>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
边栏推荐
- Redis installation under windows and Linux systems
- Srs4.0+obs studio+vlc3 (environment construction and basic use demonstration)
- 无心剑中译泰戈尔《漂鸟集(1~10)》
- nifi从入门到实战(保姆级教程)——flow
- 坚持输出需要不断学习
- Vs2017 is driven by IP debugging (dual machine debugging)
- Pychart error updating package list: connect timed out
- Please be prepared to lose your job at any time within 3 years?
- [combinatorics] combinatorial identities (sum of variable terms 3 combinatorial identities | sum of variable terms 4 combinatorial identities | binomial theorem + derivation to prove combinatorial ide
- Redis在Windows以及Linux系统下的安装
猜你喜欢

App移动端测试【5】文件的写入、读取

Mongodb installation and basic operation

Unity功能——Unity离线文档下载及使用

【Proteus仿真】74HC595+74LS154驱动显示16X16点阵

嵌入式开发:避免开源软件的7个理由
![[redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)](/img/68/3721975cf33fcfacc28dc4d3d6a5ca.jpg)
[redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)

Redis在Windows以及Linux系统下的安装

Brush questions -- sword finger offer

工资3000,靠“视频剪辑”月入40000:会赚钱的人,从不靠拼命!

Microservice sentinel flow control degradation
随机推荐
From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing
潘多拉 IOT 开发板学习(HAL 库)—— 实验5 外部中断实验(学习笔记)
[200 opencv routines] 217 Mouse interaction to obtain polygon area (ROI)
Microservices Seata distributed transactions
A Fei's expectation
半监督学习
Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
Find mapping relationship
Effect of ARP package on FTP dump under vxworks-6.6 system
App移动端测试【4】apk的操纵
Detailed pointer advanced 2
秒殺系統3-商品列錶和商品詳情
无心剑中译泰戈尔《漂鸟集(1~10)》
Popular understanding of random forest
Go语言自学系列 | golang switch语句
互斥对象与临界区的区别
利用MySQL中的乐观锁和悲观锁实现分布式锁
Persisting in output requires continuous learning
From the 18th line to the first line, the new story of the network security industry
Go language self-study series | if else if statement in golang