Page tree
Skip to end of metadata
Go to start of metadata

The navigation move_base node

move_base is a node from the navigation package that implements the necessary parts to drive a mobile platform from a starting position to a goal position.

The basic structure is shown in the picture below:

move_base relies on input data from the environment like a map and the current position of the mobile platform within the map as well as sensor readings from the current situation around the platform.

To control the mobile platform, move_base sends commands to the /cmd_vel topic with type geometry_msgs/msg/Twist.

Within navigation2 there are different logical areas with different responsibilities:

  • BT Navigatior Server
  • Planner Server
  • Controller Server
  • Recovery Server

These logical areas are implemented as plugins and can be individually selected by modifying the "neo_mp[...]/configs/navigation/move_base/move_base.launch" file.

By default we are using the NavfnROS global planner and the NeoLocalPlanner local planner (see neo_local_planner).

The full documentation can be found here: https://navigation.ros.org/

Starting Navigation2

ros2 launch neo_mp_400 navigation.launch.py
ros2 launch neo_mp_500 navigation.launch.py
ros2 launch neo_mpo_500 navigation.launch.py
ros2 launch neo_mpo_700 navigation.launch.py

Make sure a map has been created and selected first, see ROS II-Creating a Map.

Visualization with RViz

To visualize the whole move_base process we supply predefined RViz configurations, which can be loaded as follows:

ros2 launch neo_mp_400 rviz_navigation.launch.py
ros2 launch neo_mp_500 rviz_navigation.launch.py
ros2 launch neo_mpo_500 rviz_navigation.launch.py
ros2 launch neo_mpo_700 rviz_navigation.launch.py

Please choose the correct package name depending on your platform.

Visualization is best done on a Client PC, see ROS II-Getting Started for how to setup the connection.

Initializing the Localization

Before we can send goals to move_base we first have to initialize the localization, so the platform can find it's starting position on the map.

There are multiple ways to do this, like for example publishing a pose on the /initialpose topic.

However the easiest way for testing is to use the RViz 2D Pose Estimate feature as shown below:

First we click the "2D Pose Estimate" button to define the pose by clicking and holding the left mouse button (to set the position) and then dragging it to define the orientation.

Make sure the "Fixed Frame" is set to "map", otherwise it will not work.

After doing this we can check how good our estimate is by comparing the laser points with the map. This process can be repeated any number of times.

Note: The initial pose does not have to be perfect, it is sufficient to be within ~50 cm of the true position and within ~20 degrees of the true orientation.

Once the platform moves it will correct the initial localization estimate. It will not do so while standing still however.

More information regarding the localization can be found here: http://wiki.ros.org/amcl

Define Goal Position(s)

Goal Positions are the locations inside the known environment, that the robot should navigate towards.

These goals can be sent to move base in different formats and by different methods.

Using RViz

The easiest way to define a goal for move_base is to use the 2D Nav Goal option in RViz and just click and drag on the goal position and define the orientation.

This method is recommended for testing and monitoring.

Make sure the "Fixed Frame" is set to "map", otherwise it will not work.


  • No labels