Robot Core Documentation
|
The ApriltagsCamera class handles communication with the Raspberry Pi Camera. More...
Classes | |
class | ApriltagsCameraRegion |
The ApriltagsCameraRegion specifies a single detected region. More... | |
class | ApriltagsCameraRegions |
The ApriltagsCameraRegions specifies list of detected regions. More... | |
class | ApriltagsCameraStats |
The ApriltagsCameraStats class collects the current camera performance statistics. More... | |
enum | ApriltagsCameraType |
Public Member Functions | |
void | setCameraInfo (double xOffsetInches, double yOffsetInches, double angleOffsetInDegrees, ApriltagsCameraType type) |
void | disableCameras (boolean disable) |
boolean | isConnected () |
void | connect (String host, int port) |
ApriltagsCameraStats | getStats () |
void | clearStats () |
ApriltagsCameraRegions | getRegions (int cameraNo) |
boolean | isTagVisible () |
void | processRegions (SwerveDrivePoseEstimator poseEstimator) |
void | setLogging (boolean log) |
![]() | |
void | processData (String command) |
Static Public Member Functions | |
static double | convertTime (long time) |
static double | getTime () |
static double | normalizeAngle (double angle) |
The ApriltagsCamera class handles communication with the Raspberry Pi Camera.
This class allows you to connect to the Data server of the Raspberry Pi and receive information about the image frames processed by the camera.
It also implements a time sync protocol to synchronize the clocks and performs keep-alive functions that detect a disconnect.
void robotCore.apriltags.ApriltagsCamera.clearStats | ( | ) |
Clears the camera performance stats
void robotCore.apriltags.ApriltagsCamera.connect | ( | String | host, |
int | port ) |
Connects to the Raspberry Pi Data server
host | - Specifies IP for the host |
port | - Specifies the port (default is 5800) |
|
static |
This converts a specified time from that returned by System.currentTimeMillis() to same time base as returned by getTime()
time | - Specifies the time in milliseconds. |
void robotCore.apriltags.ApriltagsCamera.disableCameras | ( | boolean | disable | ) |
Disables the processing of the camera data
disable | - If this value is set to true, the cameras will not update the robot's pose |
ApriltagsCameraRegions robotCore.apriltags.ApriltagsCamera.getRegions | ( | int | cameraNo | ) |
Note that the data is received from the camera in a separate thread so calling this twice in a row can generate a different result. Once you retrieve and instance of ApriltagsCameraRegions however, you can be assured that it will NOT be modified when a new frame is received.
ApriltagsCameraStats robotCore.apriltags.ApriltagsCamera.getStats | ( | ) |
Returns the current camera performance stats
|
static |
boolean robotCore.apriltags.ApriltagsCamera.isConnected | ( | ) |
boolean robotCore.apriltags.ApriltagsCamera.isTagVisible | ( | ) |
|
static |
This converts the specified angle so that is is between -180 and +180 degrees
angle | - specifies the angle in degrees |
void robotCore.apriltags.ApriltagsCamera.processRegions | ( | SwerveDrivePoseEstimator | poseEstimator | ) |
This function processes the apriltags for the current camera frame and updates the robot's position. This should be called from the main loop.
poseEstimator | - Specifies the poseEstimator that is being used to keep track of the robot's position. |
void robotCore.apriltags.ApriltagsCamera.setCameraInfo | ( | double | xOffsetInches, |
double | yOffsetInches, | ||
double | angleOffsetInDegrees, | ||
ApriltagsCameraType | type ) |
Sets the camera position and type for each of the cameras attached to the PI (max of 2 cameras)
xOffsetInches | - Specifies the x offset of the camera from the center of the robot in inches |
yOffsetInches | - Specifies the y offset of the camera from the center of the robot in inches |
angleOffsetInDegrees | - Specifies the orientation of the camera in |
void robotCore.apriltags.ApriltagsCamera.setLogging | ( | boolean | log | ) |
This enables/disables extensive logging to file
log | - If true, log the camera info to a file. |