ROS learning: Gazebo simulation of turtlebot3 robot

1. Turtlebot3 installation

I am using ubuntu18.04, so the melodic version is installed. Just execute the following command to install it.

2. Gazebo component installation

sudo apt-get install ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control

3. turtlebo3 installation

sudo apt-get install ros-melodic-turtlebot3*

4. start

Set the environment variable model before use to determine the type to be started.
Execute export in the terminal to set environment variables

export TURTLEBOT3_MODEL=burger

Start the simulation environment

roslaunch turtlebot3_gazebo turtlebot3_world.launch

insert image description here
Start another terminal and start the navigation navigation node. After starting, you will see that rviz is started. From rviz, you can see the map and point cloud information, corresponding to the gazebo simulation environment.

roslaunch turtlebot3_navigation turtlebot3_navigation.launch 

insert image description here

initialization

It can be seen from rviz that the point cloud and the position on the map are not completely overlapping. At this time, the following needs to be manually initialized. The 2D pose estimation of the navigation function package allows the user to initially use the positioning system in the navigation function package. Set the pose of the robot in the actual environment. Specify the initial pose of the robot by clicking the [2D pose Estimate] button on rviz and clicking on the map.
insert image description here
The robot starts an automatic localization process and sets an initial pose. At this point, you can see that the information of the point cloud and the map basically match. Then the initialization is complete.
insert image description here

2D navigation target

The 2D navigation target allows setting a desired pose as the robot's navigation target. The navigation function package will wait for the theme of name/move_base/goal to initialize the target information, and then the navigation module will generate a navigation route, and the robot will walk to the target point along the navigation route. .
To send the target point, you need to click [2D Navi Goal] on rviz and then click a position on the map to set it.
insert image description here

analyze

Execute rosnode list, you can see which nodes are started

rosnode list
/amcl
/gazebo
/gazebo_gui
/map_server
/move_base
/robot_state_publisher
/rosout
/rviz
  • gazebo is a simulation of the real environment
  • rviz is a visual debugging tool for ros
  • The map_server node is used to load the map
  • robot_state_publisher publishes the state information of the robot
  • amcl dedicated and supported differential robotics platform
  • move_base navigation package

Executing rqt_tf_tree can view the coordinate relationship, and you can see which node completes the conversion between each coordinate.

rosrun rqt_tf_tree rqt_tf_tree

insert image description here

Execute rqt_graph to see the relationship between each node and topic

rqt_graph

insert image description here

If you study the navigation function package in depth, enter /opt/ros/melodic/share/turtlebot3_navigation to see how the specific startup script is configured and how the coastmap is configured. The global and local cost
maps are placed under the param folder. There are also partial planning configurations. How to configure it will be studied in detail later
insert image description here

Guess you like

Origin blog.csdn.net/yangcunbiao/article/details/128603978