Skip to content

Commit b6a48ef

Browse files
adding bond documentation for lifecycle manager (openelections#47)
* adding bond information * add in context * more context
1 parent 2b06036 commit b6a48ef

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

concepts/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Action servers are used in this stack to communicate with the highest level BT n
3737
They are also used for the BT navigator to communicate with the subsequent smaller action servers to compute plans, control efforts, and recoveries.
3838
Each will have their own unique ``.action`` type in ``nav2_msgs`` for interacting with the servers.
3939

40-
Lifecycle Nodes
41-
===============
40+
Lifecycle Nodes and Bond
41+
========================
4242

4343
Lifecycle (or Managed, more correctly) nodes are unique to ROS 2.
4444
More information can be `found here <https://design.ros2.org/articles/node_lifecycle.html>`_.
@@ -60,6 +60,11 @@ The networking interfaces are deactivated and stop processing, deallocate memory
6060
The lifecycle node framework is used extensively through out this project and all servers utilize it.
6161
It is best convention for all ROS systems to use lifecycle nodes if it is possible.
6262

63+
Within Navigation2, we use a wrapper of LifecycleNodes, ``nav2_util LifecycleNode``.
64+
This wrapper wraps much of the complexities of LifecycleNodes for typical applications.
65+
It also includes a ``bond`` connection for the lifecycle manager to ensure that after a server transitions up, it also remains active.
66+
If a server crashes, it lets the lifecycle manager know and transition down the system to prevent a critical failure. See :ref:`eloquent_migration` for details.
67+
6368
Behavior Trees
6469
**************
6570

configuration/packages/configuring-lifecycle.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Source code on Github_.
1010
The Lifecycle Manager module implements the method for handling the lifecycle transition states for the stack in a deterministic way.
1111
It will take in a set of ordered nodes to transition one-by-one into the configurating and activate states to run the stack.
1212
It will then bring down the stack into the finalized state in the opposite order.
13+
It will also create bond connections with the servrs to ensure they are still up and transition down all nodes if any are non-responsive or crashed.
1314

1415
Parameters
1516
**********
@@ -36,6 +37,17 @@ Parameters
3637
Description
3738
Whether to transition nodes to active state on startup.
3839

40+
:bond_timeout_ms:
41+
42+
==== =======
43+
Type Default
44+
---- -------
45+
int 4000
46+
==== =======
47+
48+
Description
49+
Timeout to transition down all lifecycle nodes of this manager if a server is non-responsive, in ms. Set to ``0`` to deactivate. Recommended to be always larger than 300ms for all-local node discovery. Note: if a server cleanly exits the manager will immediately be notified.
50+
3951
Example
4052
*******
4153
.. code-block:: yaml
@@ -44,3 +56,4 @@ Example
4456
ros__parameters:
4557
autostart: true
4658
node_names: ['controller_server', 'planner_server', 'recoveries_server', 'bt_navigator', 'waypoint_follower']
59+
bond_timeout_ms: 4000

index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ It has tools to:
4949
- build complicated robot behaviors using behavior trees (Nav2 Behavior Trees and BT Navigator)
5050
- Compute recovery behaviors in case of failure (Nav2 Recoveries)
5151
- Follow sequential waypoints (Nav2 Waypoint Follower)
52-
- Manage the lifecycle of the servers (Nav2 Lifecycle Manager)
52+
- Manage the lifecycle and watchdog for the servers (Nav2 Lifecycle Manager)
5353
- Plugins to enable your own custom algorithms and behaviors (Nav2 Core)
5454

5555
.. image:: images/architectural_diagram.png

migration/Eloquent.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ They are the ``navigation_lifecycle_manager`` and ``localization_lifecycle_manag
1616
This gives each process their own manager to allow users to switch between SLAM and localization without effecting Navigation.
1717
It also reduces the redundant code in ``nav2_bringup``.
1818

19+
The lifecycle manager also now contains ``Bond`` connections to each lifecycle server.
20+
This means that if a server crashes or exits, the lifecycle manager will be constantly checking and transition down its lifecycle nodes for safety.
21+
This acts as a watchdog during run-time to complement the lifecycle manager's transitioning up and down from active states. See `this PR for details <https://github.com/ros-planning/navigation2/pull/1894>`_.
22+
1923
A fix to the BT navigator was added to remove a rare issue where it may crash due to asynchronous issues.
2024
As a result, a behavior tree is created for each navigation request rather than resetting an existing tree.
2125
The creation of this tree will add a small amount of latency.

0 commit comments

Comments
 (0)