๐ฅ Goal Navigation#
The Goal Navigation refers to the ability of the robot to autonomously navigate from a Start pose (typically its current pose) to an arbitrarily chosen Goal pose.
The Goal Navigation is a common use case for autonomous robots, where the robot is required to safely navigate from a point A to a point B.
To accomplish this task, PAL Robots rely on the Navigation2 (Nav2) stack, which is extended with Plugins, Servers and Behavior Trees to provide a robust and flexible navigation system, capable of handling complex navigation tasks.
The purpose of this chapter is to provide an overview of the Goal Navigation functionality, with a focus on the PAL-specific features, and will not dwell into the details of the Nav2 stack, for which we suggest referring to the Nav2 documentation.
The nodes involved in the Goal Navigation are:
bt_navigator implements a plugin-based server that is intended to allow for flexibility in the navigation task and provide a way to easily specify complex robot behaviors, including recovery.
behavior_server implements a task server for handling and executing various atomic behaviors, such as recoveries and docking.
controller_server handles the controller requests for the execution of a certain plan using controller plugin. It will take in path and plugin names for controller, progress checker and goal checker to use and call the appropriate plugins. It also hosts the local_costmap.
planner_server implements the server for handling the planner requests for the stack and hosts a map of plugin implementations. It will take in a goal and a planner plugin name to use and call the appropriate plugin to compute a path to the goal. It also hosts the global global_costmap.
global_costmap 2D grid-based costmap for environmental representations, consisting of several โlayersโ of data about the environment. It covers all the environment surrounding the robot.
local_costmap 2D grid-based costmap for environmental representations, consisting of several โlayersโ of data about the environment. It covers a square of a limited size centered in the robot.
Behavior Trees#
The Goal Navigation uses the bt_navigator module which implements the Nav2 NavigateToPose task interface. This task interface is responsible for loading and executing a certain navigation logic defined in a Behavior Tree.
The navigation logic is regulated by a Behavior Tree which defines how the robot navigates and behaves during its journey from Start pose to Goal pose. A Behavior Tree is a modular and hierarchical structure that allows for flexible and reactive decision-making, it is particularly useful for handling complex robot behaviors and ensuring robust and adaptable navigation strategies. The Behavior Tree structure allows the navigation process to be broken down into smaller, manageable tasks (nodes), which are executed in a specific sequence or in parallel based on conditions and priorities. This modular approach enhances the robotโs ability to handle dynamic environments and unexpected situations, ensuring robust and adaptive navigation.
For more information about Behavior Trees and their usage, check BehaviorTree.CPP.
Configuration#
In addition to the available PAL configurations for any of the nodes above, you can create new configurations
for your robot. To do so, you first need to create a new directory in the .pal
folder of your robot.
mkdir -p ~/.pal/config
And then, within this folder, you can create a new navigation
configuration file.
touch ~/.pal/config/99_my_navigation_config.yaml
Attention
The name of the file should start with a number to ensure that it is loaded last and overrides the default PAL configurations.
Within the newly created 99_my_navigation_config.yaml
file, you can insert your custom node parameters.
For the list of available parameters, their meaning and how they affect the SLAM algorithm, you can refer to the
Nav2 configuration guide.
When creating a new Navigation configuration file, you need to specify the node name it refers to.
/bt_navigator:
ros__parameters:
# Your bt_navigator parameters
/behavior_server:
ros__parameters:
# Your behavior_server parameters
/controller_server:
ros__parameters:
# Your controller_server parameters
/planner_server:
ros__parameters:
# Your planner_server parameters
/global_costmap:
ros__parameters:
# Your global_costmap parameters
/local_costmap:
ros__parameters:
# Your local_costmap parameters
Note
You donโt need to list all the nodes in the configuration file, only the ones you want to customize. The default PAL configurations will be loaded for the nodes not listed in the custom configuration file.
Once created, to start using your custom navigation
configuration, you need to restart the
navigation
module with the command:
pal module restart navigation
Note
This change is is persistent and will be loaded every time you start the navigation
module.
If you want to revert to the default PAL configuration, you can simply delete the custom configuration file
you created in the ~/.pal/config
folder.
See also#
To continue learning about the Goal Navigation, how to create, configure and use Behavior Trees and their plugins for Goal Navigation, check the following sections: