Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The basic structure is shown in the picture below:

Image RemovedImage Added

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 move_base Within navigation2 there are different logical areas with different responsibilities:

  • Global Planner
  • Global Costmap
  • Local Planner
  • Local Costmap
  • Recovery BehaviorsBT 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.

...

Tip

The full documentation can be found here: httphttps://wikinavigation.ros.org/move_base

Recovery Behavior

If the mobile platform gets stuck, move_base needs to know what should be done.

This procedure is named Recovery Behavior.

There is a number of steps on how the mobile platform tries to get unstuck, before aborting the goal completely.

  • First, obstacles outside of a user-specified region will be cleared from the robot's map.
  • Next, if possible, the robot will perform an in-place rotation to clear out space.
  • If this too fails, the robot will more aggressively clear its map, removing all obstacles outside of the rectangular region in which it can rotate in place.
  • This will be followed by another in-place rotation.
  • If all this fails, the robot will consider its goal infeasible and notify the user that it has aborted.

A graphical overview is shown in the image below:

Image Removed

The actions taking place in the different steps can be changed by writing your own Recovery Behavior using the pluginlib.

Starting move_base + localization

First we need to start move_base and the AMCL localization on the platform:

Starting Navigation2

Code Block
languagebash
themeRDark
roslaunchros2 launch neo_mp_400 navigation_basic_amcl.launch.py
roslaunch neo_mp_500 navigation_basic_amcl.ros2 launch roslaunch neo_mpomp_500 navigation_basic_amcl.launch
roslaunch neo_mpo_700 navigation_basic_amcl.launch

Since April 2020 we also offer our own neo_localization package which provides an alternate to AMCL:

Code Block
languagebash
themeRDark
roslaunch neo_mp_400 navigation_basic_neo.launch
roslaunch neo_mp.py
ros2 launch neo_mpo_500 navigation_basic_neo.launch.py
roslaunch neo_mpo_500 navigation_basic_neo.ros2 launch roslaunch neo_mpo_700 navigation_basic_neo.launch

Please choose the correct package name depending on your platform.

Tip

This can be done automatically upon startup by adding the command to the ~/ROS_AUTOSTART.sh script.

.py


Note

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

...

Code Block
languagebash
themeRDark
roslaunchros2 launch neo_mp_400 rviz_navigation.launch.py
roslaunchros2 launch neo_mp_500 rviz_navigation.launch.py
roslaunchros2 launch neo_mpo_500 rviz_navigation.launch.py
roslaunchros2 launch neo_mpo_700 rviz_navigation.launch.py

Please choose the correct package name depending on your platform.

...

Tip

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

Global Localization

Another way to initialize the localization is to attempt a global localization step. This can be initiated by calling the /global_localization service as follows:

Code Block
languagebash
themeRDark
rosservice call /global_localization

Define Goal Position(s)

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

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

Using

...

The topic move_base_simple/goal is one of the options to send a goal to move_base.

The format of the message used is geometry_msgs/PoseStamped.

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.

...

Note

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

Using the move_base Action Client

Step by step tutorial can be found here: http://wiki.ros.org/navigation/Tutorials/SendingSimpleGoals

Using the neo_goal_sequence_driver

The neo_goal_sequence_driver implements the functionality to navigate a sequence of goals using the move_base action client.

The tutorial can be found here.