Repository navigation
Fix MAX_NON_OBSTACLE_COST in theta star planner (backport #5865) - #5870
Merged
Merged
Conversation
Signed-off-by: mini-1235 <[email protected]> (cherry picked from commit 018dca9)
Contributor
Author
SteveMacenski
approved these changes
Jan 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
JayHerpin
pushed a commit
to Metal-Shark-Sharktech/navigation2
that referenced
this pull request
Aug 24, 2026
The traversal term is a cost density but was charged once per step at both cost sites. A diagonal step covers sqrt(2) cells and an axial one 1.0, so 45-degree travel was charged 1/sqrt(2) of what it should be. setNeighbors() now scales its charge by the length of the step. losCheck() charges once per Bresenham cell, which sums to the staircase length rather than the length of the line, so it counts its charges and normalises the total to the chord. Both then charge the traversal term over the same distance as the euclidean term, and the result is independent of the direction of travel in regions of uniform cost. It remains a sampled average rather than an exact line integral: a cell the line clips but the Bresenham trace steps past is not charged. The README cost function is updated to match, which also clears the dangling LETHAL_COST references left when that constant was renamed to MAX_NON_OBSTACLE_COST in ros-navigation#5870, and a find-and-replace corruption in the same sentence ("the 'neigh' init_rclcpp is to be expanded"). Signed-off-by: Jay Herpin <[email protected]>
JayHerpin
pushed a commit
to Metal-Shark-Sharktech/navigation2
that referenced
this pull request
Aug 24, 2026
getCost() remapped every cost through 26 + 0.9*raw, so a cell of raw cost 0 was charged as 26. Now that the traversal term is charged per unit distance, that floor is a constant cost per metre, which is exactly what w_euc_cost already is: a duplicate path-length weight that silently turns w_euc_cost: 1.0 into an effective 1.0213, with no parameter exposing it. That also keeps the heuristic loose. w_heuristic_cost is derived from the declared w_euc_cost and knows nothing about the floor, so h underestimates the true cost by 0.021290 per metre, which over a 2 km leg is 42.6 m of admissible but wasted slack. Removing the floor makes the heuristic exact in free space for any w_euc_cost <= 1. It also makes the two isSafe() overloads agree. Since ros-navigation#5870 the plain overload admits a raw cost of 252, while the line-of-sight overload tests the rescaled 252.8 and rejects it, so a cell of cost 252 is expandable as a neighbour but blocks a line-of-sight shortcut across it. Reading the raw cost makes both admit the same set. The cost is standoff from obstacles, since free space no longer carries any traversal charge at all; raise w_traversal_cost to restore it. Signed-off-by: Jay Herpin <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Description of how this change was tested
Future work that may be required in bullet points
For Maintainers:
backport-*.This is an automatic backport of pull request #5865 done by [Mergify](https://mergify.com).