Skip to content

Variable Access cleanup in RobotContainer.java #7

Description

@dlaflotte

In RobotContainer.java:44 there are several public final declarations that need to be changed. We should never be accessing variables directly inside the RobotContainer class. They should all have a getter to grab the inner member variable.

  public final OakCamera m_OakCamera = new OakCamera();
  public final LimeLight m_frontLimeLight = new LimeLight("limelight-front");

  public final LimeLight m_rearLimeLight = new LimeLight("limelight-rear");

  public final PhotonClass photonCamera = new PhotonClass(VisionConstants.kCameraName, VisionConstants.kRobotToCam);
  private final DriveSubsystem m_robotDrive = new DriveSubsystem(photonCamera);
  private final Shooter m_shooter = new Shooter(10, 11);
  private final Intake m_intake = new Intake(12);
  private final Arm m_arm = new Arm(13, 14);

  //Vision Subsystems
  public final PhotonPose vision = m_robotDrive.getPhotonPose();

OakCamera, LimeLight, PhotonClass, and PhotonPose should all be private.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions