Vision - feds201/2024stewie GitHub Wiki

Vision Subsystem

The VisionSubsystem is a part of the FED201 FRC Robot project. It is responsible for managing the robot's vision capabilities, which are crucial for tasks such as game piece detection and distance estimation.

Overview

The VisionSubsystem class extends the SubsystemBase class provided by the WPILib library. It contains two main components: FrontCamera and BackCamera.

FrontCamera

The FrontCamera is used for game piece detection. It has several properties such as moduleName, pipelineName, ledMode, tx, ty, ta, and tv. These properties represent various settings and data related to the front camera module.

BackCamera

The BackCamera is used for AprilTag and distance estimation. It has similar properties to the FrontCamera.

Methods

The VisionSubsystem class has several methods:

  • periodic(): This method is called periodically by the WPILib scheduler. It updates the properties of the front and back cameras.

  • frontCameraProperties(): This method updates the properties of the front camera and publishes them to the SmartDashboard.

  • backCameraProperties(): This method updates the properties of the back camera and publishes them to the SmartDashboard.

Usage

To use the VisionSubsystem, create an instance of the class and call its methods as needed. The periodic() method should be called in the robot's main loop to ensure the camera properties are updated regularly.

Contributing

If you have any suggestions or improvements, feel free to contribute to the project. Please follow the contribution guidelines outlined in the repository's README.