-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Add theta star planner #1293
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
Add theta star planner #1293
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the Theta* path planning algorithm, which enhances A* by enabling path compression through line-of-sight checks. This allows the robot to follow more natural, less constrained paths by connecting to non-adjacent ancestor nodes when a clear path exists, resulting in smoother trajectories with fewer unnecessary turns compared to standard grid-based planners.
Key Changes:
- Implements Theta* algorithm with Bresenham's line algorithm for line-of-sight verification
- Adds visualization showing parent-child node relationships with cyan arrows
- Includes comprehensive test coverage and documentation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| PathPlanning/ThetaStar/theta_star.py | Core implementation of ThetaStarPlanner class with line-of-sight checking and path compression |
| tests/test_theta_star.py | Unit test verifying the planner runs successfully |
| docs/modules/5_path_planning/grid_base_search/grid_base_search_main.rst | Documentation entry for Theta* algorithm with animation reference |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@AtsushiSakai I have removed the extra loop as per the code review. |
|
@AtsushiSakai I have added some more details to the documentation. I can also add even more, but I was unsure how much to add to match with the docs of the neighboring algorithms. |
|
@Musab1Blaser Thank you! |
|
If you want to fix it, PR is welcome. |
|
I'll try to go over the whole website soon for some more similar typos, which tbh could be very easily done with an LLM. and i'll try to make a PR of all the obvious errors I can find. |

Reference issue
Enhance: #1286
What does this implement/fix?
It implements the Theta Star Planner, which performs a simple path compression on the A* planner by allowing the robot to define its heading based on far-away nodes so long as there is a clear path to it. This means the robot can travel in more than the 8 defined directions, which allows it to avoid unnecessary small turns.
Additional information
Demo (Submitted for PR in GIFs repo):

One can also disable Theta* and see how the angles of arrows become limited to only 8 directions, leading to a more choppy path.
The implementation was done by:
CheckList