Repository navigation
Add Jump Point Search grid path planner - #1529
Open
Zero-State-Logic wants to merge 1 commit into
Open
Zero-State-Logic wants to merge 1 commit into
Zero-State-Logic wants to merge 1 commit into
Conversation
Add a Jump Point Search (JPS) planner under PathPlanning/JumpPointSearch, an optimization of A* for uniform-cost grids that expands far fewer nodes while returning a path with the same optimal cost. It mirrors the A* example's grid, obstacle model, and public interface (planning(sx, sy, gx, gy) -> rx, ry) so the two are directly comparable. - Implement forced-neighbor detection and recursive jumping, including diagonal jumps that branch into their orthogonal components, on the same eight-connected grid used by the A* example. - Add tests/test_jump_point_search.py asserting the JPS path cost equals A*'s on several grids, plus a head-less smoke test of the example. - Document the algorithm on the grid based search docs page. Closes AtsushiSakai#1299
This branch has not been deployed
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.
Reference issue
Closes #1299
What this does
Adds a Jump Point Search (JPS) planner under
PathPlanning/JumpPointSearch/. JPS is an enhancement of A* for uniform-cost grids: it returns a path of the same optimal cost while expanding far fewer nodes, by pruning symmetric paths and "jumping" over intermediate cells to the start, the goal, and nodes with a forced neighbor.The planner mirrors
PathPlanning/AStar/a_star.py:planning(sx, sy, gx, gy) -> rx, ry,main()example on the identical obstacle map, animated undershow_animation.Why / scope
One new algorithm example, matching the existing A* example's style. No existing code, defaults, or dependencies changed (only
math+matplotlib).Tests
Added
tests/test_jump_point_search.py:test_optimality_on_main_obstacle_course,test_optimality_on_open_grid,test_optimality_with_wall_and_gap: import the repo'sAStarPlanner, run both planners, and assert the JPS path cost equals A*'s (the key correctness check).test_main: head-less smoke test of the example.Local results (Python 3.13+): tests pass; the new file passes
ruff checkwith the repo config andpython -m py_compile. On the A* main() map both planners report an identical path cost of 104.5685 m. A separate 5000 random-grid cross-check against A* found 0 cost mismatches.Docs
Added a "Jump Point Search algorithm" section to
docs/modules/5_path_planning/grid_base_search/grid_base_search_main.rstexplaining neighbor pruning, forced neighbors, and jumping, with references and anautofunctioncode link.TODO before merge
PathPlanning/JumpPointSearch/animation.gifto the PythonRoboticsGifs repo and confirm the image link renders.