From e379c44486e4678035186fecca2c656df60a96f4 Mon Sep 17 00:00:00 2001 From: Kemal Bektas Date: Thu, 29 Feb 2024 10:54:18 +0100 Subject: [PATCH 1/3] Add Jazzy migration guide for cancel checker Signed-off-by: Kemal Bektas --- migration/Iron.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/migration/Iron.rst b/migration/Iron.rst index 9354fa0187..3a4032485e 100644 --- a/migration/Iron.rst +++ b/migration/Iron.rst @@ -254,3 +254,18 @@ In the GIF, it can be seen that there are two controller_ids namely, `FollowPath In this case, the `FollowPath` is the default controller_id. The difference between the two controller_ids is that HighSpeedFollowPath has a higher max velocity compared to the FollowPath. This difference can be well noted in the GIF. .. attention:: If a server is unavailable, then the combo box or the drop down list of the particular component will be empty. + +Cancel Checker Interface For GlobalPlanner +******************************************* +`PR #4148 `_ introduces a new interface for the ``GlobalPlanner`` to allow for the cancellation of the current planning task. +Before the planners would continue to plan even if the goal was cancelled, now they can check it and stop planning if the goal is cancelled. +New interface for ``GlobalPlanner::createPlan``: +.. code-block:: cpp + + virtual nav_msgs::msg::Path createPlan( + const geometry_msgs::msg::PoseStamped & start, + const geometry_msgs::msg::PoseStamped & goal, + std::function cancel_checker) + +This is implemented for all the planners in the stack, you can check them for the example use of ``cancel_checker`` function. +Smac and Theta* planners have a new parameter ``terminal_checking_interval`` which is the frequency of the cancel or timeout checking in terms of number of iterations. From fe5e03c2cb8cd1f04574d3ef2111a46fbd7c66dc Mon Sep 17 00:00:00 2001 From: Kemal Bektas Date: Thu, 29 Feb 2024 10:59:35 +0100 Subject: [PATCH 2/3] Update planner configurations for terminal_checking_interval Signed-off-by: Kemal Bektas --- configuration/packages/configuring-thetastar.rst | 11 +++++++++++ configuration/packages/smac/configuring-smac-2d.rst | 11 +++++++++++ .../packages/smac/configuring-smac-hybrid.rst | 11 +++++++++++ .../packages/smac/configuring-smac-lattice.rst | 11 +++++++++++ 4 files changed, 44 insertions(+) diff --git a/configuration/packages/configuring-thetastar.rst b/configuration/packages/configuring-thetastar.rst index 59c6a5498f..b1c2219fd4 100644 --- a/configuration/packages/configuring-thetastar.rst +++ b/configuration/packages/configuring-thetastar.rst @@ -81,6 +81,17 @@ The parameters of the planner are: Description Whether to allow planning in unknown space. +:````.terminal_checking_interval: + + ==== ======= + Type Default + ---- ------- + int 5000 + ==== ======= + + Description + Number of iterations between checking if the goal has been cancelled or planner timed out + .. Note:: Do go through the README file available on this repo's link to develop a better understanding of how you could tune this planner. This planner requires you to tune the `cost_scaling_factor` parameter of your costmap too, to get good results. diff --git a/configuration/packages/smac/configuring-smac-2d.rst b/configuration/packages/smac/configuring-smac-2d.rst index c98d12f6d3..f14a28c85e 100644 --- a/configuration/packages/smac/configuring-smac-2d.rst +++ b/configuration/packages/smac/configuring-smac-2d.rst @@ -81,6 +81,17 @@ Parameters Description Maximum number of iterations after the search is within ``tolerance`` before returning approximate path with best heuristic if exact path is not found. +:````.terminal_checking_interval: + + ==== ======= + Type Default + ---- ------- + int 5000 + ==== ======= + + Description + Number of iterations between checking if the goal has been cancelled or planner timed out + :````.max_planning_time: ====== ======= diff --git a/configuration/packages/smac/configuring-smac-hybrid.rst b/configuration/packages/smac/configuring-smac-hybrid.rst index 74fbad0df1..14ff036da5 100644 --- a/configuration/packages/smac/configuring-smac-hybrid.rst +++ b/configuration/packages/smac/configuring-smac-hybrid.rst @@ -81,6 +81,17 @@ Parameters Description Maximum number of iterations once a visited node is within the goal tolerances to continue to try to find an exact match before returning the best path solution within tolerances. Negative values convert to infinite. +:````.terminal_checking_interval: + + ==== ======= + Type Default + ---- ------- + int 5000 + ==== ======= + + Description + Number of iterations between checking if the goal has been cancelled or planner timed out + :````.max_planning_time: ====== ======= diff --git a/configuration/packages/smac/configuring-smac-lattice.rst b/configuration/packages/smac/configuring-smac-lattice.rst index 6333747b4f..b195a9cb35 100644 --- a/configuration/packages/smac/configuring-smac-lattice.rst +++ b/configuration/packages/smac/configuring-smac-lattice.rst @@ -63,6 +63,17 @@ Parameters Description Maximum number of iterations once a visited node is within the goal tolerances to continue to try to find an exact match before returning the best path solution within tolerances. +:````.terminal_checking_interval: + + ==== ======= + Type Default + ---- ------- + int 5000 + ==== ======= + + Description + Number of iterations between checking if the goal has been cancelled or planner timed out + :````.max_planning_time: ====== ======= From 78f94ed91f8b80672830432c8f5d165d7125a16a Mon Sep 17 00:00:00 2001 From: Steve Macenski Date: Thu, 29 Feb 2024 09:22:06 -0800 Subject: [PATCH 3/3] Update Iron.rst --- migration/Iron.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/migration/Iron.rst b/migration/Iron.rst index 3a4032485e..287c2f1142 100644 --- a/migration/Iron.rst +++ b/migration/Iron.rst @@ -260,12 +260,13 @@ Cancel Checker Interface For GlobalPlanner `PR #4148 `_ introduces a new interface for the ``GlobalPlanner`` to allow for the cancellation of the current planning task. Before the planners would continue to plan even if the goal was cancelled, now they can check it and stop planning if the goal is cancelled. New interface for ``GlobalPlanner::createPlan``: + .. code-block:: cpp virtual nav_msgs::msg::Path createPlan( - const geometry_msgs::msg::PoseStamped & start, - const geometry_msgs::msg::PoseStamped & goal, - std::function cancel_checker) + const geometry_msgs::msg::PoseStamped & start, + const geometry_msgs::msg::PoseStamped & goal, + std::function cancel_checker) -This is implemented for all the planners in the stack, you can check them for the example use of ``cancel_checker`` function. +This is implemented for all the planners in the stack, you can check them for the example use of ``cancel_checker`` function (simply check ``cancel_checker()``). Smac and Theta* planners have a new parameter ``terminal_checking_interval`` which is the frequency of the cancel or timeout checking in terms of number of iterations.