Preface
Navigation Stack is a set of two-dimensional navigation function packages provided by ROS. It inputs odometer, information and target position, and outputs safe speed instructions for controlling the reaching of the target state.
ROS Navigation Stack provides a good reference for navigation planning of mobile robots. By implementing the interfaces provided by the function package set
,
you can also easily apply your own applications to mobile robots. This article will help you understand the design ideas of ROS Navigation Stack and explain each function package
.
Click to view the larger image Through this image on the ROS wiki, we can clearly see the overall design idea of the ROS Navigation Stack: the entire function package is centered on move_base, which inputs odometer information, sensor information, positioning information, maps, and target points to move_base, which will output speed instructions after planning. move_base includes three key parts: global_planner, local_planner, and recovery_behaviors.
These three parts are implemented in the form of plug-ins, and the plug-in mechanism can easily switch planners implemented by different algorithms. The recovery behavior will be triggered when an abnormal state occurs during the robot's movement, with the purpose of helping the robot get rid of the abnormal state. In addition, move_base also includes global_costmap (global cost map) and local_costmap (local cost map), and the planner needs to perform navigation planning on the cost map. Let's take a closer look at the contents of the above mentioned parts.
0 2 odometry
In simple terms, the role of the odometer is to estimate the distance and speed of the robot's movement. By reading the source code, we can know that in the ROS Navigation Stack, the odometer information has two functions. One function is to provide it to the local planner. When the local planner selects the optimal path and determines whether the robot should stop, it will use the odometer's speed information. The other function is to use the estimated pose information for positioning.
Odometry information is generally obtained from the wheels of the robot chassis. Of course, depending on the robot, you can also choose to use a visual odometry. You can also use the extended Kalman filter to fuse the wheel odometry and IMU data to obtain a more accurate pose estimate. The message type nav_msgs/Odometry includes the robot's pose and velocity and their respective covariances.
nav_msgs/Odometry.msg
0
3
sensor
Sensor data generally comes from lidar, IMU and depth camera,
which
can be used for positioning and obstacle avoidance. The use of sensors requires setting the coordinate transformation relationship between the sensor reference system and the robot reference system, which is often called TF transformation. This is done to represent the relationship between the environment perceived by the sensor and the robot reference system. If the amcl algorithm is used, the lidar data will be used to match the static map, correct the robot's position and posture, and obtain more accurate positioning.
LiDAR can also sense the location of obstacles in the environment and avoid them by adding them to the cost map. The specific types of sensors used depend on the robot platform used. In theory, the more types of sensors used, the better the positioning and obstacle avoidance effects.
0 4 tf
tf is a functional package that allows users to track multiple reference frames over time. It uses a tree data structure to cache and maintain the coordinate transformation relationship between multiple reference frames based on time. It can help users complete the coordinate transformation of data such as points and vectors between two reference frames at any time.
Robot systems usually have many three-dimensional reference frames that change over time, such as the world reference frame and the robot reference frame. TF tracks these reference frames over time. To implement autonomous navigation of mobile robots based on the ROS Navigation Stack, a complete TF tree must be maintained, namely map->odom->base_link->sensor_link. In fact, what we call positioning is the process of maintaining the relationship between map->base_link. The TF tree records the relationship between the robot reference frame and the map reference frame, which means the robot's position in the map is obtained. The TF tree also records the relationship between the sensor reference frame and the robot reference frame, which means the relationship between the perceived data and the robot is obtained.
Click to view full image
From the above picture, we can intuitively understand what tf transformation is. The tf tree helps us manage the coordinate transformation relationship between the lidar and the robot chassis. When the lidar senses that there is an obstacle at a certain position, the distance between the obstacle and the robot chassis can be obtained through tf transformation.
0 5 map_server
map_server is optional in ROS Navigation Stack, and its main function is to provide maps for robot navigation. There are two ways to provide maps, one is to provide real-time maps through SLAM, and the other is to provide maps that SLAM has created and saved in advance or created by other methods. Commonly used SLAM algorithms include gmapng and hector_slam.
Generally, in relatively regular scenes, high-precision maps can be made and provided to robots, which will have better positioning and planning effects. To provide real-time maps through SLAM, the real-time maps need to be published in the form of . The map provided by map_server is in pgm format. By loading the yaml configuration file, the map is loaded into the system in the form of a topic. In the yaml file, you can configure the resolution, origin, and probability of occupation/freeness of the map. The following is the content of the yaml configuration file:
The default reference frame of the map is map. The probability of occ = (255 – color_avg) / 255.0, where color_avg is the average value of the pixel RGB.
0 6 amcl (Adaptive Monte Carlo Localization)
amcl is the only specified positioning algorithm in the ROS Navigation Stack. Its full name is Adaptive Monte Carlo Positioning. It is a probabilistic positioning system for robots moving in a two-dimensional environment. To put it simply, its principle is to spread particles in the global map, which can be understood as the possible positions of the robot.
Particles are scored according to evaluation criteria, such as the degree of match between lidar data and the map. The higher the score, the greater the possibility that the robot is at this location. The particles that remain after passing by are the particles with high scores.
After multiple scattering of particles, the particles will be concentrated in the places where the robot is most likely to be located, which is called particle convergence. In fact, adaptability can be simply understood as increasing or decreasing the number of particles based on the average score of particles or whether the particles have converged. It can effectively solve the robot kidnapping problem and the problem of fixed number of particles.
The red particle clusters in the above figure are the particles scattered by amcl in the global map. It can be seen that the particle clusters are concentrated around the given starting position at the beginning. At this time, the particle clusters are still relatively scattered. As the robot moves, the particle clusters gradually converge, and the positioning effect is still good.
Click to view full image
The role of amcl in the ROS Navigation Stack is to output the tf transformation of map->odom to compensate for the drift error of the odometer. It requires the existence of odometer pose estimation in the robot's positioning system, that is, the tf transformation of odom->base_link, and the given starting pose and input sensor data.
0 7 costmap_2d (cost map)
The costmap_2d package provides a two-dimensional costmap implementation that takes sensor data from the actual environment and builds a two-dimensional or three-dimensional grid occupancy map, as well as a two-dimensional costmap based on the occupancy grid map and a user-defined expansion radius. The package also supports initializing costmaps based on map_server, costmaps based on rolling windows, and subscribing to and configuring sensor topics.
In the ROS Navigation Stack, the cost map is divided into a global cost map and a local cost map. The global cost map uses a cost map initialized based on map_server, which is the Static Map Layer, and the local cost map is a cost map based on a scrolling window. The cost map also includes the Obstacle Map Layer and the Inflation Layer. Sometimes, user-defined layers can be added according to the needs of the application scenario. User-defined layers can be implemented using plug-ins. The obstacle layer adds obstacles sensed by the sensor to the cost map. When planning, we will regard the robot as a particle and do not consider the actual model of the robot. Therefore, an inflation layer is needed in the cost map to try to ensure that the planned path will not cause the robot to collide with obstacles.
Click to view full image
The above picture is an example from the ROS wiki. You can see that the gray part is the static map, the red part is the obstacle perceived by the sensor, and the blue part is the expansion layer. The red polygon represents the shape of the robot. To avoid collision, the robot shape should not intersect with the red part, and the robot center point should not intersect with the blue part.
0 8 move_base
Previous article:Kecong mobile robot control system builds a submersible and jacking AMR to help the rapid development of the rail transportation equipment industry
Next article:Yuejiang starts listing guidance, is the domestic collaborative robot reaching a new turning point?
- Popular Resources
- Popular amplifiers
- Using IMU to enhance robot positioning: a fundamental technology for accurate navigation
- Researchers develop self-learning robot that can clean washbasins like humans
- Universal Robots launches UR AI Accelerator to inject new AI power into collaborative robots
- The first batch of national standards for embodied intelligence of humanoid robots were released: divided into 4 levels according to limb movement, upper limb operation, etc.
- New chapter in payload: Universal Robots’ new generation UR20 and UR30 have upgraded performance
- Humanoid robots drive the demand for frameless torque motors, and manufacturers are actively deploying
- MiR Launches New Fleet Management Software MiR Fleet Enterprise, Setting New Standards in Scalability and Cybersecurity for Autonomous Mobile Robots
- Nidec Drive Technology produces harmonic reducers for the first time in China, growing together with the Chinese robotics industry
- DC motor driver chip, low voltage, high current, single full-bridge driver - Ruimeng MS31211
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- When power saving is required, how should the LCD screen's SEG pin, COM pin, VLVD1-3, and VLCDH related configurations be configured?
- [New version of Bluesun AB32VG1 RISC-V development board] - 1: From "New" to "0 errors, 0 warnings."
- 1- Design of vending machine based on 51 single chip microcomputer (schematic diagram + PCB + paper + program)
- Advanced C/C++ Compilation Technology
- How to use multiple serial ports on CC2642R? Can 3 serial ports be used?
- Where are PCB professionals heading?
- Ubuntu development environment installation (I) system installation
- Implementation strategies for Industrial IoT networks
- The long-lasting coronavirus
- XXXXX Teardown