Package frc.robot
Class RaspberryPi
java.lang.Object
frc.robot.RaspberryPi
- Direct Known Subclasses:
RaspberryPiPhoton
,RaspberryPiSim
This class is used to get the data from the Raspberry Pi.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if any AprilTags are in view.Returns a list of all AprilTags from all cameras.getAprilTagsSingleCam
(edu.wpi.first.networktables.DoubleArraySubscriber camSub, String camName) Returns a list of all AprilTags from one camera.getAprilTagWithID
(int id) Gets an April Tag from the list given a certain tag.Returns the closest AprilTag from any camera.Get all april tags reported from the reef camera.Get all april tags reported from the station camera.void
Prints the raw data for the april tags on the rpi.void
update
(edu.wpi.first.math.geometry.Pose2d pose) Updates the raspberry pi's values given the current robot pose.
-
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
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 cameracamName
- camera name- Returns:
- A list of visible AprilTags
-
getAprilTagWithID
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
Get all april tags reported from the station camera.- Returns:
- list of all apriltags
-
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
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
-
-