diff --git a/behavior_trees/trees/follow_point.rst b/behavior_trees/trees/follow_point.rst index ea94292c8..beacf0c21 100644 --- a/behavior_trees/trees/follow_point.rst +++ b/behavior_trees/trees/follow_point.rst @@ -28,13 +28,13 @@ This behavior tree will execute infinitely in time until the navigation request - + - + diff --git a/behavior_trees/trees/nav_through_poses_recovery.rst b/behavior_trees/trees/nav_through_poses_recovery.rst index aff6f3826..f3bcb62ec 100644 --- a/behavior_trees/trees/nav_through_poses_recovery.rst +++ b/behavior_trees/trees/nav_through_poses_recovery.rst @@ -47,7 +47,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + @@ -56,7 +56,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + @@ -75,9 +75,9 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + - + diff --git a/behavior_trees/trees/nav_to_pose_and_pause_near_goal_obstacle.rst b/behavior_trees/trees/nav_to_pose_and_pause_near_goal_obstacle.rst index fcff2382f..4a563f84b 100644 --- a/behavior_trees/trees/nav_to_pose_and_pause_near_goal_obstacle.rst +++ b/behavior_trees/trees/nav_to_pose_and_pause_near_goal_obstacle.rst @@ -46,7 +46,7 @@ In conclusion, this particular BT would serve, both as an example and ready-to-u - + @@ -60,7 +60,7 @@ In conclusion, this particular BT would serve, both as an example and ready-to-u - + diff --git a/behavior_trees/trees/nav_to_pose_recovery.rst b/behavior_trees/trees/nav_to_pose_recovery.rst index d1f825d36..48b7d8aa3 100644 --- a/behavior_trees/trees/nav_to_pose_recovery.rst +++ b/behavior_trees/trees/nav_to_pose_recovery.rst @@ -42,7 +42,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + @@ -50,7 +50,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + @@ -69,9 +69,9 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + - + diff --git a/behavior_trees/trees/nav_to_pose_with_consistent_replanning_and_if_path_becomes_invalid.rst b/behavior_trees/trees/nav_to_pose_with_consistent_replanning_and_if_path_becomes_invalid.rst index fd9e7be62..943734716 100644 --- a/behavior_trees/trees/nav_to_pose_with_consistent_replanning_and_if_path_becomes_invalid.rst +++ b/behavior_trees/trees/nav_to_pose_with_consistent_replanning_and_if_path_becomes_invalid.rst @@ -45,13 +45,13 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con - + - + diff --git a/configuration/packages/bt-plugins/actions/AssistedTeleop.rst b/configuration/packages/bt-plugins/actions/AssistedTeleop.rst index 8f9effa22..dd7ed9a3a 100644 --- a/configuration/packages/bt-plugins/actions/AssistedTeleop.rst +++ b/configuration/packages/bt-plugins/actions/AssistedTeleop.rst @@ -44,7 +44,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -55,22 +55,34 @@ Input Ports ====== ======= Description - Action server timeout (ms). + Action server timeout (ms). :error_code_id: ============== ======= Type Default -------------- ------- - uint16 N/A + uint16 N/A ============== ======= Description - Assisted teleop error code. See ``AssistedTeleop`` action message for the enumerated set of error codes. + Assisted teleop error code. See ``AssistedTeleop`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + uint16 N/A + ============== ======= + + Description + Assisted teleop error message. See ``AssistedTeleop`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/BackUp.rst b/configuration/packages/bt-plugins/actions/BackUp.rst index c3b66c4da..0ba7b61cd 100644 --- a/configuration/packages/bt-plugins/actions/BackUp.rst +++ b/configuration/packages/bt-plugins/actions/BackUp.rst @@ -21,7 +21,7 @@ Input Ports ====== ======= Description - Total distance to backup (m). + Total distance to backup (m). :backup_speed: @@ -32,7 +32,7 @@ Input Ports ====== ======= Description - Backup speed (m/s). + Backup speed (m/s). :time_allowance: @@ -54,7 +54,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -65,7 +65,7 @@ Input Ports ====== ======= Description - Action server timeout (ms). + Action server timeout (ms). Output Ports ------------ @@ -75,15 +75,27 @@ Output Ports ============== ======= Type Default -------------- ------- - uint16 N/A + uint16 N/A ============== ======= Description - Backup error code. See ``BackUp`` action message for the enumerated set of error codes. + Backup error code. See ``BackUp`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Backup error message. See ``BackUp`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/ComputeCoveragePath.rst b/configuration/packages/bt-plugins/actions/ComputeCoveragePath.rst index 525dd82f2..51eb0daf2 100644 --- a/configuration/packages/bt-plugins/actions/ComputeCoveragePath.rst +++ b/configuration/packages/bt-plugins/actions/ComputeCoveragePath.rst @@ -20,7 +20,7 @@ Input Ports ===================================== ======= Description - Whether or not to generate a headland of the field or polygon to compute coverage of + Whether or not to generate a headland of the field or polygon to compute coverage of :generate_route: @@ -31,7 +31,7 @@ Input Ports ============================================= ======= Description - Whether or not to generate a route, e.g. an ordered set of swaths + Whether or not to generate a route, e.g. an ordered set of swaths :generate_path: @@ -42,7 +42,7 @@ Input Ports ============== ======= Description - Whether or not to generate a path, e.g. adding path connectors to the ordered route + Whether or not to generate a path, e.g. adding path connectors to the ordered route :file_field: @@ -53,7 +53,7 @@ Input Ports ============== ======= Description - The filepath to the field's GML file to use, if not specifying the field via ``polygons`` + The filepath to the field's GML file to use, if not specifying the field via ``polygons`` :file_field_id: @@ -65,7 +65,7 @@ Input Ports ============== ======= Description - The ID of the field in the GML File to use, if multiple exist in the same file. This is the ordered number of the fields in the file. + The ID of the field in the GML File to use, if multiple exist in the same file. This is the ordered number of the fields in the file. :polygons: @@ -101,7 +101,7 @@ Output Ports ========================== ======= Description - Path created by action server in the form of a navigation path. Takes in a blackboard variable, e.g. "{path}". + Path created by action server in the form of a navigation path. Takes in a blackboard variable, e.g. "{path}". :coverage_path: @@ -123,13 +123,24 @@ Output Ports ============== ======= Description - Compute coverage error code. See ``ComputeCoveragePath`` action message for the enumerated set of error codes. + Compute coverage error code. See ``ComputeCoveragePath`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Compute coverage error message. See ``ComputeCoveragePath`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + -Note: the blackboard IDs for the path, error code, and more may be adjusted,but need to match the corresponding parameters in the ``CoverageNavigator`` plugin to set on the blackboard for use from the action server. +Note: the blackboard IDs for the path, error code, and more may be adjusted, but need to match the corresponding parameters in the ``CoverageNavigator`` plugin to set on the blackboard for use from the action server. diff --git a/configuration/packages/bt-plugins/actions/ComputePathThroughPoses.rst b/configuration/packages/bt-plugins/actions/ComputePathThroughPoses.rst index 3133b2ca8..8d6bb754f 100644 --- a/configuration/packages/bt-plugins/actions/ComputePathThroughPoses.rst +++ b/configuration/packages/bt-plugins/actions/ComputePathThroughPoses.rst @@ -91,9 +91,20 @@ Output Ports Description Compute path through poses error code. See ``ComputePathThroughPoses`` action message for the enumerated set of error codes. +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Compute path through poses error message. See ``ComputePathThroughPoses`` action message for the enumerated set of error codes. + Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/ComputePathToPose.rst b/configuration/packages/bt-plugins/actions/ComputePathToPose.rst index b8e99672e..4c4c27087 100644 --- a/configuration/packages/bt-plugins/actions/ComputePathToPose.rst +++ b/configuration/packages/bt-plugins/actions/ComputePathToPose.rst @@ -19,7 +19,7 @@ Input Ports ===================================== ======= Description - Start pose. Optional. Only used if not left empty. Takes in a blackboard variable, e.g. "{start}". + Start pose. Optional. Only used if not left empty. Takes in a blackboard variable, e.g. "{start}". :goal: @@ -30,7 +30,7 @@ Input Ports ===================================== ======= Description - Goal pose. Takes in a blackboard variable, e.g. "{goal}". + Goal pose. Takes in a blackboard variable, e.g. "{goal}". :planner_id: @@ -41,7 +41,7 @@ Input Ports ============== ======= Description - Mapped name to the planner plugin type to use, e.g. GridBased. + Mapped name to the planner plugin type to use, e.g. GridBased. :server_name: @@ -52,7 +52,7 @@ Input Ports ============== ======= Description - Action server name. + Action server name. :server_timeout: @@ -64,7 +64,7 @@ Input Ports ============== ======= Description - Action server timeout (ms). + Action server timeout (ms). Output Ports ------------ @@ -78,7 +78,7 @@ Output Ports ========================== ======= Description - Path created by action server. Takes in a blackboard variable, e.g. "{path}". + Path created by action server. Takes in a blackboard variable, e.g. "{path}". :error_code_id: @@ -89,11 +89,23 @@ Output Ports ============== ======= Description - Compute path to pose error code. See ``ComputePathToPose`` action message for the enumerated set of error codes. + Compute path to pose error code. See ``ComputePathToPose`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Compute path to pose error message. See ``ComputePathToPose`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/DockRobot.rst b/configuration/packages/bt-plugins/actions/DockRobot.rst index ce3b8d9f1..e14101df0 100644 --- a/configuration/packages/bt-plugins/actions/DockRobot.rst +++ b/configuration/packages/bt-plugins/actions/DockRobot.rst @@ -19,7 +19,7 @@ Input Ports ==== ======= Description - Whether to use the dock's ID or dock pose fields. + Whether to use the dock's ID or dock pose fields. :dock_id: @@ -30,7 +30,7 @@ Input Ports ====== ======= Description - Dock ID or name to use. + Dock ID or name to use. :dock_pose: @@ -41,7 +41,7 @@ Input Ports ========================= ======= Description - The dock pose, if not using dock id. + The dock pose, if not using dock id. :dock_type: @@ -52,7 +52,7 @@ Input Ports ====== ======= Description - The dock plugin type, if using dock pose. + The dock plugin type, if using dock pose. :max_staging_time: @@ -63,7 +63,7 @@ Input Ports ===== ======= Description - Maximum time to navigate to the staging pose. + Maximum time to navigate to the staging pose. :navigate_to_staging_pose: @@ -74,7 +74,7 @@ Input Ports ==== ======= Description - Whether to autonomously navigate to staging pose. + Whether to autonomously navigate to staging pose. Output Ports ------------ @@ -88,7 +88,7 @@ Output Ports ==== ======= Description - If the action was successful. + If the action was successful. :error_code_id: @@ -99,7 +99,18 @@ Output Ports ============== ======= Description - Dock robot error code. See ``DockRobot`` action message for the enumerated set of error codes. + Dock robot error code. See ``DockRobot`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string 0 + ============== ======= + + Description + Dock robot error message. See ``DockRobot`` action message for the enumerated set of error codes. :num_retries: @@ -110,11 +121,11 @@ Output Ports ====== ======= Description - The number of retries executed. + The number of retries executed. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/DriveOnHeading.rst b/configuration/packages/bt-plugins/actions/DriveOnHeading.rst index 5a394d4fc..31bf4e9d7 100644 --- a/configuration/packages/bt-plugins/actions/DriveOnHeading.rst +++ b/configuration/packages/bt-plugins/actions/DriveOnHeading.rst @@ -20,7 +20,7 @@ Input Ports ====== ======= Description - Distance to travel (m). + Distance to travel (m). :speed: @@ -31,7 +31,7 @@ Input Ports ====== ======= Description - Speed at which to travel (m/s). + Speed at which to travel (m/s). :time_allowance: @@ -53,7 +53,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -64,7 +64,7 @@ Input Ports ====== ======= Description - Action server timeout (ms). + Action server timeout (ms). Output Ports ------------ @@ -78,11 +78,23 @@ Output Ports ============== ======= Description - Drive on heading error code. See ``DriveOnHeading`` action message for the enumerated set of error codes. + Drive on heading error code. See ``DriveOnHeading`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Drive on heading error message. See ``DriveOnHeading`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/FollowPath.rst b/configuration/packages/bt-plugins/actions/FollowPath.rst index e86a69155..1babe054c 100644 --- a/configuration/packages/bt-plugins/actions/FollowPath.rst +++ b/configuration/packages/bt-plugins/actions/FollowPath.rst @@ -18,7 +18,7 @@ Input Ports ====== ======= Description - Takes in a blackboard variable containing the path to follow, eg. "{path}". + Takes in a blackboard variable containing the path to follow, eg. "{path}". :controller_id: @@ -29,7 +29,7 @@ Input Ports ====== ======= Description - Mapped name of the controller plugin type to use, e.g. FollowPath. + Mapped name of the controller plugin type to use, e.g. FollowPath. :goal_checker_id: @@ -40,7 +40,7 @@ Input Ports ====== ======= Description - Mapped name of the goal checker plugin type to use, e.g. SimpleGoalChecker. + Mapped name of the goal checker plugin type to use, e.g. SimpleGoalChecker. :server_name: @@ -51,7 +51,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -63,7 +63,7 @@ Input Ports ============== ======= Description - Action server timeout (ms). + Action server timeout (ms). Output Ports @@ -78,11 +78,23 @@ Output Ports ============== ======= Description - Follow path error code. See ``FollowPath`` action for the enumerated set of error code definitions. + Follow path error code. See ``FollowPath`` action for the enumerated set of error code definitions. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Follow path error message. See ``FollowPath`` action for the enumerated set of error code definitions. + Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/NavigateThroughPoses.rst b/configuration/packages/bt-plugins/actions/NavigateThroughPoses.rst index 88f574e0d..b32cd5ec4 100644 --- a/configuration/packages/bt-plugins/actions/NavigateThroughPoses.rst +++ b/configuration/packages/bt-plugins/actions/NavigateThroughPoses.rst @@ -30,7 +30,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -41,7 +41,7 @@ Input Ports ====== ======= Description - Action server timeout (ms). + Action server timeout (ms). :behavior_tree: @@ -52,7 +52,7 @@ Input Ports ====== ======= Description - Behavior tree absolute path. If none is specified, NavigateThroughPoses action server uses a default behavior tree. + Behavior tree absolute path. If none is specified, NavigateThroughPoses action server uses a default behavior tree. Output Ports ------------ @@ -66,12 +66,24 @@ Output Ports ============== ======= Description - The lowest error code in the list of the `error_code_names` parameter. + The lowest error code in the list of the `error_code_names` parameter. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + The error message associated with the lowest error code in the list of the `error_code_name_prefixes` parameter. Example ------- .. code-block:: xml - diff --git a/configuration/packages/bt-plugins/actions/NavigateToPose.rst b/configuration/packages/bt-plugins/actions/NavigateToPose.rst index 995095289..2eb7fea17 100644 --- a/configuration/packages/bt-plugins/actions/NavigateToPose.rst +++ b/configuration/packages/bt-plugins/actions/NavigateToPose.rst @@ -19,7 +19,7 @@ Input Ports =========== ======= Description - Takes in a blackboard variable containing the goal, eg. "{goal}". + Takes in a blackboard variable containing the goal, eg. "{goal}". :server_name: @@ -30,7 +30,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -41,7 +41,7 @@ Input Ports ====== ======= Description - Action server timeout (ms). + Action server timeout (ms). :behavior_tree: @@ -52,7 +52,7 @@ Input Ports ====== ======= Description - Behavior tree absolute path. If none is specified, NavigateToPose action server uses a default behavior tree. + Behavior tree absolute path. If none is specified, NavigateToPose action server uses a default behavior tree. Output Ports ------------ @@ -66,12 +66,24 @@ Output Ports ============== ======= Description - The lowest error code in the list of the `error_code_names` parameter. + The lowest error code in the list of the `error_code_names` parameter. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + The error messages associated with the lowest error code in the list of the `error_code_name_prefixes` parameter. Example ------- .. code-block:: xml - diff --git a/configuration/packages/bt-plugins/actions/Smooth.rst b/configuration/packages/bt-plugins/actions/Smooth.rst index f648ab42c..92f5d7b16 100644 --- a/configuration/packages/bt-plugins/actions/Smooth.rst +++ b/configuration/packages/bt-plugins/actions/Smooth.rst @@ -17,7 +17,7 @@ Input Ports ====== ======= Description - The blackboard variable or hard-coded input path to smooth + The blackboard variable or hard-coded input path to smooth :max_smoothing_duration: @@ -39,7 +39,7 @@ Input Ports ====== ======= Description - Whether to check the output smoothed path for collisions. + Whether to check the output smoothed path for collisions. :smoother_id: @@ -50,7 +50,7 @@ Input Ports ====== ======= Description - The smoother plugin ID to use for smoothing in the smoother server + The smoother plugin ID to use for smoothing in the smoother server Output Ports ------------ @@ -97,11 +97,22 @@ Output Ports ============== ======= Description - Follow smoother error code. See ``SmoothPath`` action for the enumerated set of error code definitions. + Follow smoother error code. See ``SmoothPath`` action for the enumerated set of error code definitions. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Follow smoother error message. See ``SmoothPath`` action for the enumerated set of error code definitions. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/Spin.rst b/configuration/packages/bt-plugins/actions/Spin.rst index 1ffbce964..951ae6eed 100644 --- a/configuration/packages/bt-plugins/actions/Spin.rst +++ b/configuration/packages/bt-plugins/actions/Spin.rst @@ -21,7 +21,7 @@ Input Ports ====== ======= Description - Spin distance (radians). + Spin distance (radians). :time_allowance: @@ -43,7 +43,7 @@ Input Ports ====== ======= Description - Action server name. + Action server name. :server_timeout: @@ -54,7 +54,7 @@ Input Ports ====== ======= Description - Action server timeout (ms). + Action server timeout (ms). :is_recovery: @@ -65,7 +65,7 @@ Input Ports ==== ======= Description - True if the action is being used as a recovery. + True if the action is being used as a recovery. Output Ports ------------ @@ -79,12 +79,24 @@ Output Ports ============== ======= Description - Spin error code. See ``Spin`` action message for the enumerated set of error codes. + Spin error code. See ``Spin`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string N/A + ============== ======= + + Description + Spin error message. See ``Spin`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + diff --git a/configuration/packages/bt-plugins/actions/UndockRobot.rst b/configuration/packages/bt-plugins/actions/UndockRobot.rst index f4dbc6f29..c9089cb7c 100644 --- a/configuration/packages/bt-plugins/actions/UndockRobot.rst +++ b/configuration/packages/bt-plugins/actions/UndockRobot.rst @@ -19,7 +19,7 @@ Input Ports ====== ======= Description - The dock plugin type, if not previous instance used for docking. + The dock plugin type, if not previous instance used for docking. :max_undocking_time: @@ -30,7 +30,7 @@ Input Ports ===== ======= Description - Maximum time to get back to the staging pose. + Maximum time to get back to the staging pose. Output Ports ------------ @@ -44,7 +44,7 @@ Output Ports ==== ======= Description - If the action was successful. + If the action was successful. :error_code_id: @@ -55,11 +55,22 @@ Output Ports ============== ======= Description - Dock robot error code. See ``UndockRobot`` action message for the enumerated set of error codes. + Dock robot error code. See ``UndockRobot`` action message for the enumerated set of error codes. + +:error_msg: + + ============== ======= + Type Default + -------------- ------- + string 0 + ============== ======= + + Description + Dock robot error message. See ``UndockRobot`` action message for the enumerated set of error codes. Example ------- .. code-block:: xml - + diff --git a/migration/Jazzy.rst b/migration/Jazzy.rst index 72797814b..355d5c73d 100644 --- a/migration/Jazzy.rst +++ b/migration/Jazzy.rst @@ -80,4 +80,16 @@ Before: After: -.. image:: images/fix_flickering_visualization_after.png \ No newline at end of file +.. image:: images/fix_flickering_visualization_after.png + +BehaviorTree error_msg +********************** + +`PR #4459 https://github.com/ros-navigation/navigation2/pull/4459>`_ adds error_msg to all action result messages +`PR #4460 `_ captures and propogates error_msg result strings through the bt_navigator. + +A new parameter for the BT Navigator "error_code_name_prefixes" was introduced. It replaces the "error_code_id_names" parameter to support both an error code and an associated error message. Behavior tree elements that support an "error_code_id" and "error_msg" attribute, must have values that use the corresponding prefix with the suffix "_error_code" and "_error_msg" respectively. + +.. code-block:: xml + + diff --git a/tutorials/docs/adding_a_nav2_task_server.rst b/tutorials/docs/adding_a_nav2_task_server.rst index d91e15995..0cc284a41 100644 --- a/tutorials/docs/adding_a_nav2_task_server.rst +++ b/tutorials/docs/adding_a_nav2_task_server.rst @@ -110,9 +110,9 @@ We make use of the launch files to compose different servers into a single proce Error codes *********** -Your nav2 task server may also wish to return a 'error_code' in its action response (though not required). If there are semantically meaningful and actionable types of failures for your system, this is a systemic way to communicate those failures which may be automatically aggregated into the responses of the navigation system to your application. +Your nav2 task server may also wish to return a 'error_code' and 'error_msg' in its action response (though not required). If there are semantically meaningful and actionable types of failures for your system, this is a systemic way to communicate those failures which may be automatically aggregated into the responses of the navigation system to your application. -It is important to note that error codes from 0-9999 are reserved for internal nav2 servers with each server offset by 100 while external servers start at 10000 and end at 65535. +It is important to note that error codes from 0-9999 are reserved for internal nav2 servers with each server offset by 100 while external servers start at 10000 and end at 65535. The table below shows the current servers along with the expected error code structure. @@ -153,8 +153,7 @@ The table below shows the current servers along with the expected error code str .. _Waypoint Follower Server: https://github.com/ros-planning/navigation2/blob/main/nav2_waypoint_follower/src/waypoint_follower.cpp .. _Behavior Server: https://github.com/ros-planning/navigation2/blob/main/nav2_behaviors/src/behavior_server.cpp -Error codes are attached to the response of the action message. An example can be seen below for the route server. Note that by convention we set the error code field within the message definition to ``error_code``. - +Error codes and messages are attached to the response of the action message. An example can be seen below for the route server. Note it is neccesary to set the error code field within the message result definition to ``error_code`` and the error message field to ``error_msg``. .. code-block:: bash @@ -177,22 +176,22 @@ Error codes are attached to the response of the action message. An example can b nav_msgs/Route route builtin_interfaces/Duration route_time uint16 error_code + string error_msg --- -As stated in the message, the priority order of the errors should match the message order, 0 is reserved for NONE and the first error code in the sequence is reserved for UNKNOWN. +As stated in the message, the priority order of the errors codes should match the message order, 0 is reserved for NONE and the first error code in the sequence is reserved for UNKNOWN. Since the the route server is a external server, the errors codes start at 10000 and go up to 10099. -In order to propagate your server's error code to the rest of the system it must be added to the nav2_params.yaml file. -The `error_code_id_names` inside of the BT Navigator define what error codes to look for on the blackboard by the server. The lowest error code of the sequence is then returned - whereas the code enums increase the higher up in the software stack - giving higher priority to lower-level failures. - +To ensure your server's error codes, and associated error messages, are properly communicated throughout the system, you need to configure them in your nav2_params.yaml file. +The BT Navigator parameter `error_code_name_prefixes` defines a list of prefixes used to search the behavior tree blackboard, for the existence and content of error codes and error messages keys, that may have been generated. If the blackboard contains multiple error code keys then the lowest error code value of the sequence, and associated error message, is then returned in the result of the navigator action message. Error code enums increase the higher up they occur in the software stack. In other words higher priority is given to reporting lower-level failures. .. code-block:: yaml - error_code_id_names: - - compute_path_error_code_id - - follow_path_error_code_id - - route_error_code_id + error_code_name_prefixes: + - compute_path + - follow_path + - route Conclusion ********** diff --git a/tutorials/docs/adding_smoother.rst b/tutorials/docs/adding_smoother.rst index 35afdaeaf..cb8045bbf 100644 --- a/tutorials/docs/adding_smoother.rst +++ b/tutorials/docs/adding_smoother.rst @@ -72,15 +72,15 @@ A given behavior tree will have a line: .. code-block:: xml - + -This line calls the planner server and return a path to the ``path`` blackboard variable in the behavior tree. We are going to replace that line with the following to compute the path, smooth the path, and finally replace the ``path`` blackboard variable with the new smoothed path that the system will now interact with: +This line calls the planner server and return a path to the ``path`` blackboard variable in the behavior tree. We are going to replace that line with the following to compute the path, smooth the path, and finally replace the ``path`` blackboard variable with the new smoothed path that the system will now interact with: .. code-block:: xml - - + + If you wish to have recoveries for the smoother error codes, such as triggering the system recoveries branch of a behavior tree: @@ -88,7 +88,7 @@ If you wish to have recoveries for the smoother error codes, such as triggering .. code-block:: xml - +