Conversation
Remove legacy code paths needed from times when the vision still used classical CV. Also simplify some abstractions.
Contributor
There was a problem hiding this comment.
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.
…nents.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cleWu03
approved these changes
Sep 16, 2025
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.
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