2.7 KiB
aliases
| aliases | |||
|---|---|---|---|
|
- How is the NAV2 library structured?
- What are the core concepts?
- How can we utilize it to improve our own code?
ROS2 and NAV2
Because navigation is usually a long running task, ROS2 - NAV2 Library uses ROS2 actions (servers and clients) to implement and execute navigation tasks. Actions servers implement the actual execution in a separate thread and thus can be running in a blocking manner (a shared Future object is used to communicate Feedback and results). The feedback can be shared both synchronously through callbacks and asynchronously through requesting information from the shared future object. In any case we spinning the client node is required.
Lifecycle Nodes (aka. Mangaged Nodes)
NAV2 relies heavily on ROS2 - Lifecycle Nodes, because it helps to structure the program in reasonable ways for commercial uses and debugging. All servers in NAV2 use the lifecycle nodes and it is the best convention for all ROS systems to use lifecycle nodes if possible.
Behavior Trees
Behaviour Trees are used as the main concept to implement complex tasks and the application logic. In order to do that behaviors are broken down into primitives (very basic behavior).
From NAV2 documentation:
For this project, we use BehaviorTree CPP V3 as the behavior tree library. We create node plugins which can be constructed into a tree, inside the
BT Navigator. The node plugins are loaded into the BT and when the XML file of the tree is parsed, the registered names are associated. At this point, we can march through the behavior tree to navigate.
Source Code Walk Through
The version of nav2 I used to write our own nav3 library was: 7009ffba on october 16th 2023.
NAV2 Common
This package contains only launchfiles that implement classes to facilitate writing other launch files. Functions like rewriting part of a file, replacing strings, check if node parameters are available, etc.
Navigation Servers
Planners
Controllers
There is a single GoalChecker Plugin that implements the GoalChecker interface. It is called SimpleGoalChecker
