Conversation
better commit messages when I am changing specific things instead of just redoing everything again + again.
…ent `ArithmeticException`
|
making this a draft to enforce not merging |
Amber-leaf
left a comment
There was a problem hiding this 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.
Amber-leaf
left a comment
There was a problem hiding this comment.
You don't do any filtering of good vs bad tags. We determined that this was necessary to not get bad results.
Amber-leaf
left a comment
There was a problem hiding this comment.
This code is just very unreadable and overcomplicated in general. Sorry if im being to harsh TwT.
Amber-leaf
left a comment
There was a problem hiding this 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.
| 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"); |
There was a problem hiding this comment.
Could also be IllegalStateException
There was a problem hiding this comment.
Adding more of the variables and their values will help if this exception is thrown
There was a problem hiding this comment.
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
| 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 |
There was a problem hiding this comment.
If you're not the person getting the actual values, it would be helpful to have more detailed instructions on the source.
Just creating this to give feedback to Elliot.