Files
Main/99 Work/0 OneSec/OneSecNotes/30 Engineering Skills/Robotics/ROS2/ROS2 - NAV2 Library.md
2024-12-02 15:11:30 +01:00

2.7 KiB

aliases
aliases
NAV2
Navigation
ROS2
  • 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

Navigation illumination Video

Vimeo Video

<script src="https://player.vimeo.com/api/player.js"></script>

Controller (Local Planner) !Pasted image 20231019145329.png