Fix unit mismatch in Dijkstra calc_index#1360
Open
remete618 wants to merge 1 commit intoAtsushiSakai:masterfrom
Open
Fix unit mismatch in Dijkstra calc_index#1360remete618 wants to merge 1 commit intoAtsushiSakai:masterfrom
remete618 wants to merge 1 commit intoAtsushiSakai:masterfrom
Conversation
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.
Summary
self.min_x/self.min_yfrom grid-index valuesnode.x/node.yincalc_indexWhat changed
PathPlanning/Dijkstra/dijkstra.py,calc_indexmethod:node.xandnode.yare already grid indices (computed viacalc_xy_indexwhich divides by resolution). Subtractingself.min_x/self.min_y(in meters) is a unit mismatch. The algorithm produced correct results because the offset was constant across all nodes, preserving dictionary key uniqueness, but the formula was conceptually wrong.Test plan