-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add support for switching between SMAC planners #5840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SteveMacenski
merged 14 commits into
ros-navigation:main
from
mini-1235:fix/multiple_planners-2
Feb 11, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
86d1fda
Prototype for fixing multiple planners, all unit tests passed
mini-1235 4b2531b
Lint
mini-1235 a603c61
Fix analytic expansion
mini-1235 cd865b5
Remove log
mini-1235 cb508de
Revert
mini-1235 2baded0
Merge remote-tracking branch 'origin/main' into fix/multiple_planners-2
mini-1235 897e08a
Merge remote-tracking branch 'origin/main' into fix/multiple_planners-2
mini-1235 0028dd6
Add distance heuristic and obstacle heuristic class
mini-1235 d28dadc
Drop const and lint
mini-1235 1d735ab
Apply suggestions from code review
mini-1235 e146955
Move init motion moel back to nodes
mini-1235 74652a2
Doxygen
mini-1235 53da6db
Add code coverage
mini-1235 0bbc89a
Initialize as nullptr
mini-1235 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
nav2_smac_planner/include/nav2_smac_planner/distance_heuristic.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| // Copyright (c) 2026, Open Navigation LLC | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. Reserved. | ||
|
|
||
| #ifndef NAV2_SMAC_PLANNER__DISTANCE_HEURISTIC_HPP_ | ||
| #define NAV2_SMAC_PLANNER__DISTANCE_HEURISTIC_HPP_ | ||
|
|
||
| #include "nav2_smac_planner/constants.hpp" | ||
| #include "nav2_smac_planner/types.hpp" | ||
|
|
||
| namespace nav2_smac_planner | ||
| { | ||
| struct HybridMotionTable; | ||
| struct LatticeMotionTable; | ||
| class NodeHybrid; | ||
| class NodeLattice; | ||
|
|
||
| /** | ||
| * @class nav2_smac_planner::DistanceHeuristic | ||
| * @brief Distance Heuristic implementation for graph, Hybrid-A* | ||
| */ | ||
| template<typename NodeT> | ||
| class DistanceHeuristic | ||
| { | ||
| public: | ||
| /** | ||
| * @brief A constructor for nav2_smac_planner::DistanceHeuristic | ||
| */ | ||
| DistanceHeuristic() {} | ||
|
|
||
| /** | ||
| * @brief Compute the SE2 distance heuristic | ||
| * @param lookup_table_dim Size, in costmap pixels, of the | ||
| * each lookup table dimension to populate | ||
| * @param motion_model Motion model to use for state space | ||
| * @param dim_3_size Number of quantization bins for caching | ||
| * @param search_info Info containing minimum radius to use | ||
| */ | ||
| template<typename MotionTableT> | ||
| void precomputeDistanceHeuristic( | ||
| const float & lookup_table_dim, | ||
| const MotionModel & motion_model, | ||
| const unsigned int & dim_3_size, | ||
| const SearchInfo & search_info, | ||
| MotionTableT & motion_table); | ||
|
|
||
| /** | ||
| * @brief Compute the Distance heuristic | ||
| * @param node_coords Coordinates to get heuristic at | ||
| * @param goal_coords Coordinates to compute heuristic to | ||
| * @param obstacle_heuristic Value of the obstacle heuristic to compute | ||
| * additional motion heuristics if required | ||
| * @return heuristic Heuristic value | ||
| */ | ||
| template<typename MotionTableT> | ||
| float getDistanceHeuristic( | ||
| const Coordinates & node_coords, | ||
| const Coordinates & goal_coords, | ||
| const float & obstacle_heuristic, | ||
| MotionTableT & motion_table); | ||
|
|
||
| protected: | ||
| // Dubin / Reeds-Shepp lookup and size for dereferencing | ||
| LookupTable dist_heuristic_lookup_table_; | ||
| float size_lookup_; | ||
| }; | ||
|
|
||
| } // namespace nav2_smac_planner | ||
| #endif // NAV2_SMAC_PLANNER__DISTANCE_HEURISTIC_HPP_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.