You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/docs/integrating_new_task_server_and_navigator_plugin.rst
+25-5Lines changed: 25 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,11 @@ Create three action definitions in ``nav2_operations_msgs/action/``.
108
108
---
109
109
uint16 error_code
110
110
---
111
-
# no feedback
111
+
builtin_interfaces/Duration navigation_time
112
+
uint32 path_poses_count
113
+
114
+
- ``navigation_time`` — elapsed wall-clock time since the goal was accepted.
115
+
- ``path_poses_count`` — number of poses in the path currently on the blackboard. Demonstrates how to read a BT blackboard value and surface it as feedback.
112
116
113
117
For more details refer to the ``nav2_operations_msgs`` package in the tutorial code. You can find more examples of this in ``nav2_msgs`` for ``NavigateToPose``, ``NavigateThroughPoses`` navigator APIs as well as other task servers like ``FollowPath`` and ``ComputePathToPose``.
**goalReceived** — loads the BT file and writes the path to the blackboard so BT nodes can read it immediately on the first tick.
400
+
**goalReceived** — loads the BT file and writes the path to the blackboard so BT nodes can read it immediately on the first tick. It also snapshots the start time so ``onLoop()`` can compute elapsed navigation time.
397
401
398
402
.. code-block:: cpp
399
403
@@ -407,16 +411,32 @@ Virtual method summary:
407
411
auto blackboard = bt_action_server_->getBlackboard();
**onLoop** — called on every tick of the BT executor loop. This is where the navigator publishes action feedback to the client. For this navigator the feedback is empty, but a richer implementation could read progress from the blackboard here.
418
+
**onLoop** — called on every tick of the BT executor loop. This is where the navigator publishes action feedback to the client. It computes elapsed wall-clock time since the goal was accepted and reads the path size from the blackboard to surface it as a progress signal.
**goalCompleted** — called once when the tree finishes. Maps the BT outcome to an error code in the action result and clears the blackboard so a subsequent goal that reuses the same BT file does not find stale data.
0 commit comments