Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Temporary PR to view code (do not merge)#41

Draft
MobileOak wants to merge 27 commits into
mainfrom
Vision-V2
Draft

Temporary PR to view code (do not merge)#41
MobileOak wants to merge 27 commits into
mainfrom
Vision-V2

Conversation

@MobileOak

Copy link
Copy Markdown

Just creating this to give feedback to Elliot.

@MobileOak MobileOak requested review from a team as code owners March 21, 2026 16:49
@Amber-leaf Amber-leaf marked this pull request as draft March 21, 2026 16:50
@Amber-leaf

Copy link
Copy Markdown
Contributor

making this a draft to enforce not merging

@Amber-leaf Amber-leaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do a lot of work in VisionCamera. The point of the Subsystem paradigm is to primarily do work in subsystem files. I would refactor this as such.

Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated

@Amber-leaf Amber-leaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't do any filtering of good vs bad tags. We determined that this was necessary to not get bad results.

Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated

@Amber-leaf Amber-leaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is just very unreadable and overcomplicated in general. Sorry if im being to harsh TwT.

Comment thread src/main/java/org/ironriders/vision/VisionSubsystem.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated

@Amber-leaf Amber-leaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also do a lot of recursion, which is not optimal. Also, you often assume what you are indexing over is not empty or null, which is not necessarily the case.

@Amber-leaf

Copy link
Copy Markdown
Contributor

this.simulation = (mode == CameraMode.MULTI_SIM || mode == CameraMode.SINGLE_SIM) ? true : false;
if (simulation) {
if (cameraSim.isEmpty()) {
throw new IllegalArgumentException("Simulation cameras must be passed a PhotonCameraSim instance");

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also be IllegalStateException

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding more of the variables and their values will help if this exception is thrown

@Amber-leaf Amber-leaf Mar 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should also probably try to go down a failure path that recovers instead of just exiting. e.g. just throw a warning and continue without vision

Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionCamera.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionConstants.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionConstants.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionConstants.java Outdated
public static final Double WEIGHT_SCALE = 5d;
public static final AprilTagFieldLayout TAG_FIELD_LAYOUT = AprilTagFieldLayout
.loadField(AprilTagFields.kDefaultField);
public static final SimCameraProperties SIM_CAM_PROPS = new SimCameraProperties() // todo: get actual values

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're not the person getting the actual values, it would be helpful to have more detailed instructions on the source.

Comment thread src/main/java/org/ironriders/vision/VisionSubsystem.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionSubsystem.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionSubsystem.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionSubsystem.java Outdated
Comment thread src/main/java/org/ironriders/vision/VisionSubsystem.java Outdated
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants