当前位置:网站首页>Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (4)
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (4)
2022-07-03 16:05:00 【Pony Baby】
introduction
To the last chapter of this tutorial , We used a single robot before SLAM, Multi robot map fusion SLAM, And the navigation of multiple robots in the map . The last chapter ( There may be new chapters later , This is the end of the first series ), We will use explore_lite Function pack , Make the robot in the process of drawing , Autonomously has established the frontier most suitable for expansion in the map , And automatic edge navigation , Edge construction map , Until the whole map is built .
The source code in gitee On , You can see the first article .
The overall launch file
It mainly integrates the contents of lesson 2 and lesson 3 , On multiple machines slam Added move_base Navigation , recycling explore_lite Publish coordinates
<launch>
<!--SLAM Algorithm -->
<arg name="slam_method" default="gmapping"/>
<arg name="simulation" default="true"/>
<arg name="move_forward_only" default="false"/>
<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="-3"/>
<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="-3"/>
<arg name="robot_y_pos" value="0.0"/>
<arg name="robot_z_pos" value="0.0"/>
<arg name="robot_name" value="tb3_1"/>
</include>
<!-- move_base Navigation -->
<include file="$(find gazebo_tutorials)/launch/move_base.launch">
<arg name="ns" value="tb3_0" />
<arg name="move_forward_only" value="$(arg move_forward_only)"/>
</include>
<include file="$(find gazebo_tutorials)/launch/move_base.launch">
<arg name="ns" value="tb3_1" />
<arg name="move_forward_only" value="$(arg move_forward_only)"/>
</include>
<!-- Explore on your own -->
<include file="$(find gazebo_tutorials)/launch/explore_costmap.launch">
<arg name="ns" value="tb3_0" />
</include>
<include file="$(find gazebo_tutorials)/launch/explore_costmap.launch">
<arg name="ns" value="tb3_1" />
</include>
<!-- rviz -->
<include file="$(find gazebo_tutorials)/launch/rviz_two_robots.launch" />
</launch>
explore_costmap.launch
This function package is to calculate the edge of the grid map , Then calculate the weight of the edge by some means , Decide where to expand . This is not a self-contained Feature Pack , Download it yourself .
sudo apt-get install ros-melodic-explore-lite
Mainly costmap_topic and costmap_updates_topic Two parameters , The map they receive will determine what they navigate based on .
<launch>
<arg name="ns" default="tb3_0"/>
<node pkg="explore_lite" type="explore" respawn="false" name="$(arg ns)_explore" output="screen">
<remap from="move_base_simple/goal" to="$(arg ns)/move_base_simple/goal"/>
<remap from="move_base" to="$(arg ns)/move_base"/>
<param name="robot_base_frame" value="$(arg ns)/base_footprint"/>
<param name="costmap_topic" value="$(arg ns)/map"/>
<param name="costmap_updates_topic" value="$(arg ns)/map_updates"/>
<!-- Specifies whether to publish visual boundaries -->
<param name="visualize" value="true"/>
<!-- Calculate the new boundary and reconsider the frequency of the target (Hz)-->
<param name="planner_frequency" value="0.33"/>
<!-- Time is in seconds . When the robot is progress_timeout When there is no progress , The current goal will be abandoned .-->
<param name="progress_timeout" value="30.0"/>
<!-- For weighted boundary . This multiplication parameter affects the leading edge potential component of the leading edge weight ( The distance to the front ).-->
<param name="potential_scale" value="3.0"/>
<!-- For weighted boundary . This multiplication parameter affects the leading edge direction component of the leading edge weight . This parameter does not currently perform any operation , For forward compatibility only .-->
<param name="orientation_scale" value="0.0"/>
<!-- For weighted boundary . This multiplication parameter affects the boundary weight ( Boundary size ) The boundary gain component of .-->
<param name="gain_scale" value="1.0"/>
<!-- The transformation tolerance used when changing the robot posture .-->
<param name="transform_tolerance" value="0.3"/>
<!-- Consider the boundary as the minimum size of the boundary of the exploration target . In meters .-->
<param name="min_frontier_size" value="0.1"/>
</node>
</launch>
start-up
Last command roslaunch gazebo_tutorials two_robots_autoslam.launch
Start it up .
stay rviz You can add MarkerArray To show the leading edge of the map
Finally, we can see that the two robots move by themselves , And maps are integrated , But very stupid , After all, this function package is prepared for a robot , I may find a way to write the decision-making program of multiple robots later , Coming soon .
边栏推荐
- App mobile terminal test [5] file writing and reading
- 请求头不同国家和语言的表示
- VC下Unicode和ANSI互转,CStringW和std::string互转
- Remote file contains actual operation
- 一些事情的反思
- CString getbuffer and releasebuffer instructions
- 阿飞的期望
- Jmeter线程组功能介绍
- Seckill system 2 redis solves the problem of distributed session
- Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
猜你喜欢
Please be prepared to lose your job at any time within 3 years?
App移动端测试【4】apk的操纵
Microservice API gateway zuul
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
Create gradle project
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
App mobile terminal test [5] file writing and reading
Vs2017 is driven by IP debugging (dual machine debugging)
Distributed task scheduling XXL job
Microservice - Nacos registration center and configuration center
随机推荐
关于网页中的文本选择以及统计选中文本长度
突破100万,剑指200万!
The wonderful use of do{}while()
Mongodb installation and basic operation
The difference between mutually exclusive objects and critical areas
How are integer and floating-point types stored in memory
Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
Unityshader - materialcapture material capture effect (Emerald axe)
Use percent sign in CString
CString getbuffer and releasebuffer instructions
工资3000,靠“视频剪辑”月入40000:会赚钱的人,从不靠拼命!
Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
Go语言自学系列 | golang switch语句
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
Seckill system 2 redis solves the problem of distributed session
How to thicken the brush in the graphical interface
[combinatorics] combinatorial identities (review of eight combinatorial identities | product of combinatorial identities 1 | proof | use scenario | general method for finding combinatorial numbers)
Large CSV split and merge
大csv拆分和合并
[system safety] 43 PowerShell malicious code detection series (5) automatic extraction of ten thousand words from abstract syntax tree