FRCTeamPhoenix / Build2024

Other
0 stars 0 forks source link

Variable Access cleanup in RobotContainer.java #7

Open dlaflotte opened 8 months ago

dlaflotte commented 8 months ago

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.

rishabhmurthy commented 7 months ago

pranai-rao has made these changes.