team8 / FRC-2021-Public

1 stars 0 forks source link

Vision Architecture Changes #17

Open aoberai opened 4 years ago

aoberai commented 4 years ago

Currently, the Limelight class is how the robot accesses sensor values from the hardware Limelight and set outputs. That doesn't follow our architecture though as technically the Limelight camera should be put inside HardwareAdapter.VisionHardware and should be read within HardwareReader and written to in HardwareWriter.

Vision in many rights acts as a separate subsystem of the robot. Here's how the new vision architecture should work:

The network table from which the limelight sensor values can be accessed should be put inside HardwareAdapter.VisionHardware. There should be robot state vision variables for each of the values needed from the limelight which would be written to inside of HardwareReader. The Vision subsystem should calculate the outputs for the Limelight based on the visionWantedStates in Commands and the robot state. Finally, HardwareWriter should apply those outputs to the actual Limelight.

lucamanolache commented 4 years ago

I believe that the Limelight class should remain and act similarly to how we have motors in util/control. The limelight class would only be created once in HardwareAdapter and it would be written/read in the other Hardware classes.

aoberai commented 4 years ago

That makes sense. I agree

aoberai commented 3 years ago

Refactor / rease with new codebase changes & test if still works