Package ftclib.archive
Class FtcPixyCam2
java.lang.Object
trclib.archive.TrcPixyCam2
ftclib.archive.FtcPixyCam2
This class implements a platform dependent pixy camera 2 that is connected to an I2C bus.
It provides access to the last detected objects reported by the pixy camera asynchronously.
-
Nested Class Summary
Nested classes/interfaces inherited from class trclib.archive.TrcPixyCam2
TrcPixyCam2.Barcode, TrcPixyCam2.Block, TrcPixyCam2.Feature, TrcPixyCam2.FeatureBarcodes, TrcPixyCam2.FeatureIntersections, TrcPixyCam2.FeatureVectors, TrcPixyCam2.Intersection, TrcPixyCam2.IntersectionLine, TrcPixyCam2.Vector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final FtcI2cDevice
private static final boolean
Fields inherited from class trclib.archive.TrcPixyCam2
instanceName, PIXY2_BLOCKS_ALL_SIG, PIXY2_BLOCKS_SIG_1, PIXY2_BLOCKS_SIG_2, PIXY2_BLOCKS_SIG_3, PIXY2_BLOCKS_SIG_4, PIXY2_BLOCKS_SIG_5, PIXY2_BLOCKS_SIG_6, PIXY2_BLOCKS_SIG_7, PIXY2_BLOCKS_SIG_8, PIXY2_FEATURE_TYPE_ALL, PIXY2_FEATURE_TYPE_MAIN, PIXY2_FEATURES_ALL, PIXY2_FEATURES_BARCODE, PIXY2_FEATURES_INTERSECTION, PIXY2_FEATURES_VECTOR, PIXY2_LINE_FLAG_INTERSECTION_PRESENT, PIXY2_LINE_FLAG_INVALID, PIXY2_MAX_BLOCKS_ALL, PIXY2_SAT_FLAG_SATURATE, tracer
-
Constructor Summary
ConstructorsConstructorDescriptionFtcPixyCam2
(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, int devAddress, boolean addressIs7Bit) Constructor: Create an instance of the object.FtcPixyCam2
(String instanceName) Constructor: Create an instance of the object.FtcPixyCam2
(String instanceName, int devAddress, boolean addressIs7Bit) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
This method checks if the pixy camera is enabled.void
setEnabled
(boolean enabled) This method enables/disables the pixy camera.byte[]
This method issues a synchronous read of the specified number of bytes from the device.void
syncWriteRequest
(byte[] data) This method writes the data buffer to the device synchronously.Methods inherited from class trclib.archive.TrcPixyCam2
getAllFeatures, getBlocks, getFeatures, getFirmwareType, getFirmwareVersion, getFPS, getHardwareVersion, getMainFeatures, getResolutionHeight, getResolutionWidth, getRGB, reverseVector, setCameraBrightness, setDefaultTurn, setLamp, setLED, setMode, setNextTurn, setServos, setVector, toString
-
Field Details
-
DEF_I2C_ADDRESS
private static final int DEF_I2C_ADDRESS- See Also:
-
USE_BUFFERED_READ
private static final boolean USE_BUFFERED_READ- See Also:
-
pixyCam
-
-
Constructor Details
-
FtcPixyCam2
public FtcPixyCam2(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, int devAddress, boolean addressIs7Bit) Constructor: Create an instance of the object.- Parameters:
hardwareMap
- specifies the global hardware map.instanceName
- specifies the instance name.devAddress
- specifies the I2C address of the device.addressIs7Bit
- specifies true if the I2C address is a 7-bit address, false if it is 8-bit.
-
FtcPixyCam2
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.devAddress
- specifies the I2C address of the device.addressIs7Bit
- specifies true if the I2C address is a 7-bit address, false if it is 8-bit.
-
FtcPixyCam2
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.
-
-
Method Details
-
isEnabled
public boolean isEnabled()This method checks if the pixy camera is enabled.- Returns:
- true if pixy camera is enabled, false otherwise.
-
setEnabled
public void setEnabled(boolean enabled) This method enables/disables the pixy camera.- Parameters:
enabled
- specifies true to enable pixy camera, false to disable.
-
syncReadResponse
public byte[] syncReadResponse()This method issues a synchronous read of the specified number of bytes from the device.- Specified by:
syncReadResponse
in classTrcPixyCam2
-
syncWriteRequest
public void syncWriteRequest(byte[] data) This method writes the data buffer to the device synchronously.- Specified by:
syncWriteRequest
in classTrcPixyCam2
- Parameters:
data
- specifies the data buffer.
-