Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Imagine that you want to travel to a certain place. Wouldn’t you first sketch a route in your mind before setting off?

If human navigation works this way, how can robots achieve navigation functionality?

1. Robot Autonomous Navigation

Let’s first clarify the framework of autonomous navigation, where the key components are autonomous localization and path planning. To support these two core functions, ROS provides a complete framework. Upon receiving the target navigation location, the robot only needs to publish the necessary sensor information, and the packages in the framework can assist the robot in completing the navigation.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Among them, the move_base package implements optimal path planning for robot navigation, while amcl realizes robot localization in a two-dimensional map.

To achieve global optimal path planning and real-time obstacle avoidance path planning, move_base needs to subscribe to the depth sensor information published by the robot (sensor_msgs/LaserScan or sensor_msgs/PointCloud) and odometry information (nav_msgs/Odometry). Additionally, a complete TF coordinate transformation is also an important foundation for path planning.

The final output of the navigation framework is the control commands for the robot’s speed (geometry_msgs/Twist), which requires the robot control node to have the ability to parse the linear velocity and angular velocity in the control commands and to control the robot to perform the corresponding movements.

Note:

There are many packages included in the navigation framework, which can be directly installed using the following command:

$ sudo apt-get install ros-melodic-navigation

2. Robot Localization

The successful execution of navigation functions relies on precise localization of the robot. Autonomous localization means that the robot can determine its position on the map regardless of its state. ROS provides developers with an Adaptive Monte Carlo Localization method (AMCL), which is a probabilistic statistical method that uses a particle filter to track the pose of a robot based on an existing map.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

After setting the initial pose, AMCL randomly scatters some particles around the robot. As the robot moves, each particle will also update its pose in real time according to the robot’s speed. When the environmental state around the particle differs significantly from that of the robot, it will gradually be eliminated; conversely, more particles will be generated around the robot’s location. This process continues until the particles converge in areas where the robot is most likely to be, which is the result of localization.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

To tune the above particle filter algorithm, there are many configurable parameters in the AMCL package. It is generally not recommended for beginners to modify them; just ensure that the subscribed and published topic names match. Interested individuals can refer to the official website (http://wiki.ros.org/amcl) for detailed introductions to each parameter, and for related theoretical algorithms, refer to the book “Probabilistic Robotics”.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

3. Robot Path Planning

Once the robot knows its position, how can it plan a path like a human based on its experience? The move_base package is responsible for this functionality, mainly consisting of a global path planner and a local real-time planner (local path planner).

Global planning is akin to how we plan the optimal path from point to point based on experience (or map data); local planning can be understood as continuously adjusting the robot’s pose and avoiding obstacles on the way to the destination to adhere to the optimal path.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Common algorithms for global path planning include Dijkstra’s algorithm and A* algorithm. Dijkstra’s algorithm is depth-first and often finds the global optimal path, but it takes a long time to search and consumes many resources. The A* algorithm incorporates a heuristic function, which may not always find the global optimal path but allows for faster search times, making it suitable for large spatial planning. Most mobile robots operate in confined indoor spaces, where the differences in search time and resource consumption between the two algorithms are not significant; generally, Dijkstra’s algorithm is sufficient.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile RobotsDetailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Common algorithms for local real-time planning include Dynamic Window Approaches (DWA) and Time Elastic Band (TEB). The core ideas of these two algorithms are as follows; specific algorithm implementations can be searched in related papers online.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile RobotsDetailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

To configure these planner algorithms, the move_base package requires the configuration of many parameters, such as those shown in the image below:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

These include general configuration files (costmap_common), global planning configuration files (global_costmap), local planning configuration files (local_costmap), local planner (planer), path planning algorithms (global base_global_planner and local base_local_planner), control frequency (controller_frequency), planning frequency (planner_frequency), and other parameters. Detailed introductions to these parameters can be found on the official website (http://wiki.ros.org/move_base).

4. Costmap Configuration

When humans navigate to a place, they can use their eyes and experience to judge where there are walls, where there are puddles, where they can walk, and where they cannot. How do robots make these judgments?

The move_base navigation uses two types of costmaps to store obstacle information in the surrounding environment: one for global path planning (global_costmap) and one for local real-time path planning (local_costmap). Both costmaps require some shared or independent configuration files: general configuration files (costmap_common_params), global planning configuration files (global_costmap_params), and local planning configuration files (local_costmap_params).

The code and key parameters of the general configuration file costmap_common_params.yaml are as follows:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Note not to set the topic names incorrectly, and the footprint should also be set according to the actual size of the robot.

The code and key parameters of the global planning configuration file global_costmap_params.yaml are as follows:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Since we already have a map, we set static_map to true. If we want the robot to explore unknown areas and perform mapping, we should set static_map to false.

The code and key parameters of the local planning configuration file local_costmap_params.yaml are as follows:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Among them, the width, height, and resolution parameters are used to set the length (meters), height (meters), and resolution (meters/grid) of the costmap. The rolling_window parameter is used to set whether a rolling window is needed during the robot’s movement to keep the robot centered.

Now that we have clarified all the navigation issues, can we really achieve navigation? And how will the robot’s navigation performance vary under different motion modes? Next, let’s test it with the LIMO robot.

Note: For the configuration of the robot’s motion modes and SLAM, please refer to the following content:

“Common Motion Modes of Mobile Robots”

“How to Deploy Gmapping SLAM Algorithm in Mobile Robots”

5. Differential Mobile Robot Autonomous Navigation

Open the robot’s launch file limo_start.launch and set use_mcnamu to false, as shown in the image below.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

The local planner algorithm selected is TEB. Due to the large number of related parameters, we will not display and explain them one by one here. If you want to understand each parameter, you can refer to the official website for related explanations: http://wiki.ros.org/teb_local_planner

Here are some parameter configurations and introductions:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Note that when the motion mode is differential, the y-direction speed must be set to 0. For better navigation performance, we set the minimum turning radius (min_turning_radius) to 0.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Be careful not to set min_obstacle_dist smaller than the expansion radius in costmap_common_params.yaml, otherwise an error will occur.

Then run the following command to start the navigation function.

$ roslaunch limo_bringup limo_start.launch
$ roslaunch limo_bringup limo_navigation_diff.launch

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

The launched rviz is shown in the image. You can set the robot’s initial pose using the tool indicated by the yellow arrow and set the robot’s target pose using the tool indicated by the red arrow. The robot’s implementation effect is as follows:

6. Omnidirectional Mobile Robot Autonomous Navigation

Change the motion mode of the LIMO robot by opening the robot’s launch file limo_start.launch and setting use_mcnamu to true, as shown in the image below:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

To better demonstrate the effect of omnidirectional movement, the local planner algorithm selected is TEB. Here are some parameter configurations and introductions:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Unlike the differential mode, the omnidirectional mode can move laterally, so the y-direction speed does not need to be set to 0 but can be set to any speed.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

weight_kinematics_nh is used to adjust the trade-off between compliant longitudinal motion and non-compliant lateral motion (scanning). When this parameter is set larger, it tends to favor longitudinal motion; when set smaller, it leans towards lateral motion. The weight_optimaltime parameter is the optimal time weight. If set larger, the robot will accelerate quickly on straight paths and plan paths that cut inside.

Run the following command to start the navigation function.

$ roslaunch limo_bringup limo_start.launch
$ roslaunch limo_bringup limo_navigation_mcnamu.launch

Set the initial pose and target pose of the mobile robot using the methods mentioned above. The robot’s navigation effect is as follows:

7. Ackermann Mobile Robot Autonomous Navigation

Change the motion mode of the LIMO robot by opening the robot’s launch file limo_start.launch and setting use_mcnamu to false, as shown in the image below.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

Since Ackermann motion only applies to the TEB algorithm, we will still use the TEB algorithm here. Here are some parameter configurations and introductions:

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

We will also set the y-direction speed to 0, but the minimum turning radius cannot be set to 0; it needs to be set according to the robot’s actual minimum turning radius. To conveniently measure the robot’s minimum turning radius, we can use a remote control to make the robot move in a circle at maximum angular speed, and then measure the robot’s minimum turning radius with a ruler. Be careful that the set minimum turning radius cannot be less than the minimum turning radius.

Then run the following command to start the navigation function.

$ roslaunch limo_bringup limo_start.launch
$ roslaunch limo_bringup limo_navigation_ackerman.launch

Again, use the methods mentioned above to set the initial pose and target pose of the mobile robot. The robot’s navigation effect is as follows:

8. Summary

The above only demonstrated the navigation effects using a certain local real-time planning algorithm under various motion modes. Each local real-time planning algorithm has its advantages and disadvantages, and the introduction of each algorithm is shown in the image below. You can choose the corresponding algorithm based on your needs.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile RobotsDetailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

How to Achieve Autonomous Navigation for ROS Robots will help you understand the ROS Navigation framework and its core packages, configure and implement the autonomous navigation function of mobile robots in a simulation environment, and achieve simultaneous mapping and autonomous navigation using SLAM, making your robot more intelligent.

Detailed Explanation of Multimodal Autonomous Navigation for Mobile Robots

(Scan the QR code for details)

Detailed Explanation of Multimodal Autonomous Navigation for Mobile RobotsClick “Read the original text” to join the learning.

Leave a Comment