Skip to content

Fix search target selection to use path planning distance - #163

Merged
shima004 merged 1 commit into
mainfrom
fix/157-search-path-distance
Oct 16, 2026
Merged

shima004 merged 1 commit into
mainfrom
fix/157-search-path-distance

Conversation

@shima004

Copy link
Copy Markdown
Member

close #157

This pull request updates the logic for finding the nearest building in both sample_search.py and default_search.py to improve robustness and consistency. The main changes ensure that the agent's position is checked before distance calculations, and that path planning is used for distance measurement.

Search logic improvements:

  • Added a check to ensure the agent's position is available before proceeding; if not, the result is set to None and the calculation exits early. [1] [2]
  • Changed distance calculation to use the agent's current position and _path_planning.get_distance instead of _world_info.get_distance, improving accuracy and consistency. [1] [2]
  • Initialized nearest_distance to float("inf") instead of None to simplify the comparison logic. [1] [2]

@shima004 shima004 self-assigned this Oct 16, 2026
@shima004
shima004 merged commit 58805b8 into main Oct 16, 2026
4 checks passed
@shima004
shima004 deleted the fix/157-search-path-distance branch October 16, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should SampleSearch use the registered PathPlanning module?

1 participant