-
Notifications
You must be signed in to change notification settings - Fork 18
Vision refactoring #720
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
Vision refactoring #720
Conversation
Remove legacy code paths needed from times when the vision still used classical CV. Also simplify some abstractions.
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 refactors the YOEO vision components to reduce abstraction layers and simplify the codebase. The changes remove detector wrapper classes and helper functions, integrating their functionality directly into the vision components for better accessibility and understanding.
- Eliminated detector wrapper classes and moved their single-line functionality directly into vision components
- Simplified vision component architecture by replacing the interface with an abstract base class and removing the configure/set_image pattern
- Fixed robot detection by consolidating team color handling into a single component class
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vision_components.py | Major refactoring to simplify component architecture and integrate detector functionality directly |
| detectors.py | Complete removal of detector wrapper classes |
| init.py | Updated exports to reflect new component structure |
| ros_utils.py | Enhanced robot color handling with enum types and improved team mapping logic |
| debug.py | Performance optimization for debug mask drawing |
| candidate.py | Removed unused CandidateFinder abstract class |
| vision.py | Updated to use new simplified component architecture |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bitbots_vision/bitbots_vision/vision_modules/yoeo/vision_components.py
Outdated
Show resolved
Hide resolved
…nents.py Co-authored-by: Copilot <[email protected]>
Summary
Use less abstraction layers and helper functions to make the vision more accessible and better understandable.
Also fix bugs related to the team color detection.
Proposed changes
We (Lea and Flo) deleted all detectors and used the one line that each of them had directly in the vision component file. We also simplified the Vision Component classes in that file through integrating code from the helper functions in the run() method as well as streamlining the constructor in an Abstract class. We also got rid of the configure and set image function, as the configure function wasn't called more often than the constructor and therefore only added complexity.
We also fixed some type errors and handle the robot detection in only one class, which fixes another potential bug and reduces code. In addition to that, a small performance optimization of the debug mask draw was performed.
Mostly done by @ayin21 using my PC
Related issues
Checklist
colcon build