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

Draft
MobileOak wants to merge 27 commits from Vision-V2 into main
MobileOak commented 2026-03-21 16:49:58 +00:00 (Migrated from github.com)

Just creating this to give feedback to Elliot.

Just creating this to give feedback to Elliot.
Amber-leaf commented 2026-03-21 16:51:04 +00:00 (Migrated from github.com)

making this a draft to enforce not merging

making this a draft to enforce not merging
Amber-leaf (Migrated from github.com) requested changes 2026-03-21 16:54:53 +00:00
Amber-leaf (Migrated from github.com) left a comment

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.

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.
MobileOak (Migrated from github.com) reviewed 2026-03-21 16:56:46 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 16:56:47 +00:00

I'd remove HTML tags.

I'd remove HTML tags.
MobileOak (Migrated from github.com) reviewed 2026-03-21 16:57:10 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 16:57:10 +00:00

This all needs to be deleted - Elliot

This all needs to be deleted - Elliot
Amber-leaf (Migrated from github.com) requested changes 2026-03-21 16:57:27 +00:00
Amber-leaf (Migrated from github.com) left a comment

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

You don't do any filtering of good vs bad tags. We determined that this was necessary to not get bad results.
MobileOak (Migrated from github.com) reviewed 2026-03-21 16:58:13 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 16:58:13 +00:00

Better names:
MULTI_TAG_SIMULATED
MULTI_TAG_ACTUAL

Better names: MULTI_TAG_SIMULATED MULTI_TAG_ACTUAL
MobileOak (Migrated from github.com) reviewed 2026-03-21 16:58:35 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 16:58:35 +00:00

OLD should be something like LEGACY_VISION_CODE

OLD should be something like LEGACY_VISION_CODE
MobileOak (Migrated from github.com) reviewed 2026-03-21 16:59:01 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 16:59:01 +00:00

estimator -> poseEstimator

estimator -> poseEstimator
MobileOak (Migrated from github.com) reviewed 2026-03-21 16:59:50 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 16:59:50 +00:00

Write a helper method:
isSimulation

Write a helper method: isSimulation
Amber-leaf (Migrated from github.com) requested changes 2026-03-21 17:01:36 +00:00
Amber-leaf (Migrated from github.com) left a comment

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

This code is just very unreadable and overcomplicated in general. Sorry if im being to harsh TwT.
@ -1,316 +1,165 @@
package org.ironriders.vision;
Amber-leaf (Migrated from github.com) commented 2026-03-21 17:00:41 +00:00

PhotonCameras are not thread safe, you can not parallelStream over them. Use normal stream() instead.

PhotonCameras are not thread safe, you can not parallelStream over them. Use normal stream() instead.
Amber-leaf (Migrated from github.com) reviewed 2026-03-21 17:01:59 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
Amber-leaf (Migrated from github.com) commented 2026-03-21 17:01:59 +00:00

also i think OLD is just unused

also i think OLD is just unused
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:03:31 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:03:31 +00:00

Actually you can have the enum have this value

Actually you can have the enum have this value
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:03:48 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:03:48 +00:00

Add (isSimulation)

Add (isSimulation)
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:04:42 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:04:42 +00:00

We can omit the true : false here

We can omit the `true : false` here
Amber-leaf (Migrated from github.com) requested changes 2026-03-21 17:04:43 +00:00
Amber-leaf (Migrated from github.com) left a comment

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.

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 commented 2026-03-21 17:05:30 +00:00 (Migrated from github.com)
see https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Developing_Safety-Critical_Code
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:05:40 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:05:40 +00:00

Could also be IllegalStateException

Could also be `IllegalStateException`
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:09:22 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:09:22 +00:00

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

Adding more of the variables and their values will help if this exception is thrown
Amber-leaf (Migrated from github.com) reviewed 2026-03-21 17:11:50 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
Amber-leaf (Migrated from github.com) commented 2026-03-21 17:11:50 +00:00

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

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
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:12:15 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:12:15 +00:00

you can even have isSimulation() be a method on the enum here.

you can even have isSimulation() be a method on the enum here.
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:15:13 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:15:13 +00:00

Add "throwaway values"

Add "throwaway values"
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:21:49 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:21:49 +00:00

better name is getSingleTagEstimations

better name is `getSingleTagEstimations`
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:23:34 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:23:34 +00:00

Better name is getMultiTagEstimations

Better name is `getMultiTagEstimations`
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:40:06 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:40:06 +00:00

rename to target

rename to `target`
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:43:22 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:43:22 +00:00

Can we either (or both):

  1. Fix the "magic number" of 4 by replacing it with a const
  2. Add some explanation as to why this evaluation is here
Can we either (or both): 1. Fix the "magic number" of 4 by replacing it with a const 2. Add some explanation as to why this evaluation is here
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:43:48 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:43:48 +00:00

do we know what units this distance is in? We should rename the variable.

do we know what units this distance is in? We should rename the variable.
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:45:25 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:45:25 +00:00

30 is another magic number here.

30 is another magic number here.
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:50:21 +00:00
@ -0,0 +30,4 @@
*
* The main logic for calculating standard deviations is in this class.
*/
public class VisionCamera {
MobileOak (Migrated from github.com) commented 2026-03-21 17:50:21 +00:00

This entire class needs its methods evaluated for changing to private

This entire class needs its methods evaluated for changing to `private`
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:53:19 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:53:19 +00:00

Does this method even need to exist or can you just access stdDevs in the methods that need it? Are other classes accessing it?

Does this method even need to exist or can you just access `stdDevs` in the methods that need it? Are other classes accessing it?
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:56:41 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:56:41 +00:00

this seems unnecessary here.

`this` seems unnecessary here.
MobileOak (Migrated from github.com) reviewed 2026-03-21 17:59:31 +00:00
@ -1,110 +1,105 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 17:59:31 +00:00

it's ok to not have these comments on each one, but it should be on the first one.

it's ok to not have these comments on each one, but it should be on the first one.
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:04:23 +00:00
@ -1,110 +1,105 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:04:23 +00:00

The code here needs to be restructured to be more readable and understandable.

The code here needs to be restructured to be more readable and understandable.
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:04:57 +00:00
@ -1,110 +1,105 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:04:58 +00:00

Consider constants or an enum instead of these raw strings.

Consider constants or an enum instead of these raw strings.
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:06:18 +00:00
@ -1,110 +1,105 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:06:18 +00:00

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

If you're not the person getting the actual values, it would be helpful to have more detailed instructions on the source.
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:10:09 +00:00
@ -1,316 +1,165 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:10:09 +00:00

"We use this class instead of"

"We use this class instead of"
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:11:36 +00:00
@ -1,316 +1,165 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:11:37 +00:00

Better name here. VisionLogEntry ?

Better name here. `VisionLogEntry` ?
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:12:31 +00:00
@ -1,316 +1,165 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:12:31 +00:00

Quesetions:

  1. Why isn't this in Constants
  2. Why does it duplicate the enum in the VisionCamera?
Quesetions: 1. Why isn't this in Constants 2. Why does it duplicate the enum in the VisionCamera?
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:17:00 +00:00
@ -1,316 +1,165 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:17:00 +00:00

Another issue with the names here is that it doesn't explain if "Single / Multi" is referencing the number of cameras or the number of tags.

Another issue with the names here is that it doesn't explain if "Single / Multi" is referencing the number of cameras or the number of tags.
MobileOak (Migrated from github.com) reviewed 2026-03-21 18:18:30 +00:00
@ -1,316 +1,165 @@
package org.ironriders.vision;
MobileOak (Migrated from github.com) commented 2026-03-21 18:18:30 +00:00

poseEstimateConsumer

`poseEstimateConsumer`
Iprobablydontknowwhatimdoing (Migrated from github.com) reviewed 2026-03-31 18:55:44 +00:00
@ -0,0 +1,183 @@
package org.ironriders.vision;
Iprobablydontknowwhatimdoing (Migrated from github.com) commented 2026-03-31 18:41:51 +00:00

Changed name to getPoseSingleTag, if that works

Changed name to getPoseSingleTag, if that works
Iprobablydontknowwhatimdoing (Migrated from github.com) commented 2026-03-31 18:43:30 +00:00

The 'throwaway values' comment refers to adding values (such as distance, ambiguity, etc...) for which we should throwaway tag estimates, should, after testing, it prove necessary. Previous code was already tuned for this, maybe look there for values if they prove to be needed.

The 'throwaway values' comment refers to adding values (such as distance, ambiguity, etc...) for which we should throwaway tag estimates, should, after testing, it prove necessary. Previous code was already tuned for this, maybe look there for values if they prove to be needed.
@ -1,316 +1,165 @@
package org.ironriders.vision;
Iprobablydontknowwhatimdoing (Migrated from github.com) commented 2026-03-31 18:55:43 +00:00

Thanks!

Thanks!
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin Vision-V2:Vision-V2
git switch Vision-V2

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff Vision-V2
git switch Vision-V2
git rebase main
git switch main
git merge --ff-only Vision-V2
git switch Vision-V2
git rebase main
git switch main
git merge --no-ff Vision-V2
git switch main
git merge --squash Vision-V2
git switch main
git merge --ff-only Vision-V2
git switch main
git merge Vision-V2
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ironriders/rebuilt!41
No description provided.