Skip to content

Conversation

@Flova
Copy link
Member

@Flova Flova commented Sep 13, 2025

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

  • Run colcon build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@github-project-automation github-project-automation bot moved this to 🆕 New in Software Sep 13, 2025
@Flova Flova added bug Something isn't working vision labels Sep 13, 2025
@Flova Flova requested review from ayin21 and jaagut September 13, 2025 21:39
@Flova Flova moved this from 🆕 New to 👀 In review in Software Sep 13, 2025
@Flova Flova requested a review from Copilot September 13, 2025 21:45
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 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.

@cleWu03 cleWu03 merged commit 1a85bf9 into main Sep 16, 2025
2 checks passed
@cleWu03 cleWu03 deleted the vision_refactoring_tm branch September 16, 2025 12:59
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Software Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working vision

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants