Package frc.robot

Class RaspberryPi

java.lang.Object
frc.robot.RaspberryPi
Direct Known Subclasses:
RaspberryPiPhoton, RaspberryPiSim

public class RaspberryPi extends Object
This class is used to get the data from the Raspberry Pi.
  • Constructor Details

    • RaspberryPi

      public RaspberryPi()
      Default constructor for the RaspberryPi class.
  • Method Details

    • printRawData

      public void printRawData()
      Prints the raw data for the april tags on the rpi.
    • getAprilTags

      public ArrayList<AprilTag> getAprilTags()
      Returns a list of all AprilTags from all cameras.
      Returns:
      A list of visible AprilTags
    • getAprilTagsSingleCam

      public ArrayList<AprilTag> getAprilTagsSingleCam(edu.wpi.first.networktables.DoubleArraySubscriber camSub, String camName)
      Returns a list of all AprilTags from one camera.
      Parameters:
      camSub - subscriber for the camera
      camName - camera name
      Returns:
      A list of visible AprilTags
    • getAprilTagWithID

      public AprilTag getAprilTagWithID(int id)
      Gets an April Tag from the list given a certain tag.
      Parameters:
      id - id of the april tag
      Returns:
      the april tag matching the id
    • getStationAprilTags

      public ArrayList<AprilTag> getStationAprilTags()
      Get all april tags reported from the station camera.
      Returns:
      list of all apriltags
    • getReefAprilTags

      public ArrayList<AprilTag> getReefAprilTags()
      Get all april tags reported from the reef camera.
      Returns:
      list of all april tags
    • canSeeTags

      public boolean canSeeTags()
      Checks if any AprilTags are in view.
      Returns:
      A boolean representing if any tags are in view
    • getClosestTag

      public AprilTag getClosestTag()
      Returns the closest AprilTag from any camera.
      Returns:
      The closest AprilTag object. If none are in view, returns null.
    • update

      public void update(edu.wpi.first.math.geometry.Pose2d pose)
      Updates the raspberry pi's values given the current robot pose. Not used for teleop functionality.
      Parameters:
      pose -