-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
added pso algorithm #1279
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
base: master
Are you sure you want to change the base?
added pso algorithm #1279
Conversation
please do let me know if you require any further changes also for the gif part i mocked the url |
@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 adds a Particle Swarm Optimization (PSO) algorithm for 2D path planning to the PythonRobotics project. PSO is a metaheuristic optimization algorithm inspired by bird flocking behavior that finds collision-free paths by treating path planning as an optimization problem where particles explore the search space.
- Complete PSO implementation with real-time visualization and collision avoidance
- Comprehensive documentation with mathematical foundations and algorithm explanations
- Unit test with headless mode support for CI/CD compatibility
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
PathPlanning/ParticleSwarmOptimization/particle_swarm_optimization.py | New PSO path planning implementation with visualization and collision detection |
docs/modules/5_path_planning/particleSwarmOptimization/particleSwarmOptimization.rst | Complete documentation with mathematical equations and algorithm overview |
tests/test_particle_swarm_optimization.py | Unit test for PSO algorithm with headless mode support |
README.md | Added PSO section to Path Planning category with description and references |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
PathPlanning/ParticleSwarmOptimization/particle_swarm_optimization.py
Outdated
Show resolved
Hide resolved
obstacles=OBSTACLES | ||
) | ||
|
||
if show_animation: # pragma: no cover |
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.
[nitpick] The pragma comment should be on its own line above the if statement for better readability and consistency with coverage tools.
if show_animation: # pragma: no cover | |
# pragma: no cover | |
if show_animation: |
Copilot uses AI. Check for mistakes.
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.
fixed in next commit
docs/modules/5_path_planning/particleSwarmOptimization/particleSwarmOptimization.rst
Show resolved
Hide resolved
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 👍.
PathPlanning/ParticleSwarmOptimization/particle_swarm_optimization.py
Outdated
Show resolved
Hide resolved
@AtsushiSakai could you please merge this pr as all builds checks have been passed also i have resolved all the issue created by codex and copilot. |
I will start review by myself, please wait. |
Particle Swarm Optimization (PSO) Path Planning - Contribution
🎯 Overview
This contribution adds a Particle Swarm Optimization (PSO) algorithm for 2D path planning to the PythonRobotics project, following all contribution guidelines and standards.
🎬 Video Demonstration
pso.webm
Live demonstration of PSO particles converging to find optimal collision-free path from start zone (green) to target (red star) while avoiding obstacles (gray circles).
🚀 Changes Made
1. Algorithm Implementation
File:
PathPlanning/ParticleSwarmOptimization/particle_swarm_optimization.py
2. Comprehensive Documentation
File:
docs/modules/5_path_planning/particleSwarmOptimization/particleSwarmOptimization.rst
3. Unit Testing
File:
tests/test_particle_swarm_optimization.py
matplotlib.use('Agg')
)4. Documentation Update
File:
README.md
(Main project README)🔧 Technical Specifications
f(x) = distance_to_goal + obstacle_penalties
📁 Files Modified/Added
🧮 Algorithm Details
PSO Velocity Update Equation
Key Features
Algorithm Steps
📊 Performance Characteristics
🎓 Educational Value
📚 References
🎃 Hacktoberfest 2025
This contribution is part of Hacktoberfest 2025 and follows all PythonRobotics contribution guidelines:
🔗 Usage Example
🚦 Testing
Author: Anish (@anishk85)
Date: October 2025