Skip to content

Conversation

@Musab1Blaser
Copy link
Contributor

@Musab1Blaser Musab1Blaser commented Oct 19, 2025

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):
animation
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

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example?
  • All CIs are green? (You can check it after submitting)

@AtsushiSakai AtsushiSakai requested a review from Copilot October 19, 2025 09:02
@AtsushiSakai
Copy link
Owner

@codex review

Copy link
Contributor

Copilot AI left a 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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@Musab1Blaser
Copy link
Contributor Author

@AtsushiSakai I have removed the extra loop as per the code review.

@Musab1Blaser
Copy link
Contributor Author

@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.

@AtsushiSakai
Copy link
Owner

@Musab1Blaser Thank you!

@AtsushiSakai AtsushiSakai merged commit 99af1f3 into AtsushiSakai:master Oct 22, 2025
8 checks passed
@Musab1Blaser
Copy link
Contributor Author

yay!
One small note. Just noticed that I slightly messed up with the consistency of using Theta* vs Theta star. I was trying to use it as Theta Star in the actual paragraphs but in one place I mixed it up :(
Doesn't effect understanding, just noting.
image

@AtsushiSakai
Copy link
Owner

If you want to fix it, PR is welcome.

@Musab1Blaser
Copy link
Contributor Author

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.

@Musab1Blaser Musab1Blaser deleted the enh/theta-star-planner branch October 24, 2025 06:03
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.

2 participants