VEX V5 C++ API
|
Use this class when programming the vision sensor. More...
Inherits vex::device.
Classes | |
class | code |
Use this class when programming the vision sensor. More... | |
class | object |
The object class represents an object that the vision sensor detects. More... | |
class | signature |
Use this class when programming the vision sensor. More... | |
Public Types | |
enum | detectionMode { detectionMode::objectDetect = kVisionModeNormal, detectionMode::mixedDetect = kVisionModeMixed, detectionMode::lineDetect = kVisionModeLineDetect, detectionMode::test = kVisionTypeTest } |
enum | whiteBalanceMode { whiteBalanceMode::automatic = kVisionWBNormal, whiteBalanceMode::start = kVisionWBStart, whiteBalanceMode::manual = kVisionWBManual } |
enum | ledMode { ledMode::automatic = kVisionLedModeAuto, ledMode::manual = kVisionLedModeManual } |
enum | wifiMode { wifiMode::off = kVisionWifiModeOff, wifiMode::on = kVisionWifiModeOn } |
Public Member Functions | |
vision (int32_t index) | |
Creates a new vision object on the port specified. More... | |
~vision () | |
template<typename... Args> | |
vision (int32_t index, uint8_t bright, Args... sigs) | |
Creates a new vision object on the port specified. Sets the brightness setting and all of the vision objects settings. More... | |
bool | installed () |
int32_t | value () |
int32_t | takeSnapshot (uint32_t id) |
Takes a data sample from the vision sensor. More... | |
int32_t | takeSnapshot (code &cc) |
Takes a data sample from the vision sensor. More... | |
int32_t | takeSnapshot (signature &sig) |
Takes a data sample from the vision sensor. More... | |
int32_t | takeSnapshot (uint32_t id, uint32_t count) |
Takes a data sample from the vision sensor, and only stores the largest samples of the specified amount. More... | |
int32_t | takeSnapshot (code &cc, uint32_t count) |
Takes a data sample from the vision sensor, and only stores the largest samples of the specified amount. More... | |
int32_t | takeSnapshot (signature &sig, uint32_t count) |
Takes a data sample from the vision sensor, and only stores the largest samples of the specified amount. More... | |
bool | setSignature (V5_DeviceVisionSignature *pSignature) |
bool | getSignature (uint32_t id, V5_DeviceVisionSignature *pSignature) |
bool | setSignature (signature &sig) |
bool | getSignature (uint32_t id, signature &sig) |
bool | setMode (detectionMode mode) |
detectionMode | getMode (void) |
bool | setBrightness (uint8_t value) |
uint8_t | getBrightness (void) |
bool | setWhiteBalanceMode (whiteBalanceMode mode) |
whiteBalanceMode | getWhiteBalanceMode (void) |
bool | setWhiteBalanceValues (uint8_t red, uint8_t green, uint8_t blue) |
bool | getWhiteBalanceValues (uint8_t *red, uint8_t *green, uint8_t *blue) |
bool | setLedMode (ledMode mode) |
Changes the mode of the LED on the vision sensor. More... | |
ledMode | getLedMode (void) |
Gets the mode of the LED from the vision sensor. More... | |
bool | setLedBrightness (uint8_t percent) |
Changes the brightness of the LED on the vision sensor when LED is set to manual mode. More... | |
uint8_t | getLedBrightness (void) |
Gets the brightness of the LED from the vision sensor. More... | |
bool | setLedColor (uint8_t red, uint8_t green, uint8_t blue) |
Changes the color of the LED on the vision sensor when LED is set to manual mode. More... | |
bool | getLedColor (uint8_t *red, uint8_t *green, uint8_t *blue) |
Gets the color of the LED from the vision sensor. More... | |
bool | setWifiMode (wifiMode mode) |
wifiMode | getWifiMode (void) |
![]() | |
device () | |
device (int32_t index) | |
~device () | |
V5_DeviceType | type () |
void | init (int32_t index) |
Public Attributes | |
int32_t | objectCount |
The ammount of objects found in the data sample. More... | |
object | largestObject |
The largest object found in the data sample. More... | |
safearray< object, VISION_MAX_OBJECTS > | objects |
An array containing the largest object(s) found in the data sample. More... | |
Additional Inherited Members | |
![]() | |
int32_t | _index |
Use this class when programming the vision sensor.
The vision sensor has a resolution of 316x212 pixels
|
strong |
|
strong |
|
strong |
|
strong |
vex::vision::vision | ( | int32_t | index | ) |
Creates a new vision object on the port specified.
index | The port index for this vision. The index is zero-based. |
vex::vision::~vision | ( | ) |
|
inline |
Creates a new vision object on the port specified. Sets the brightness setting and all of the vision objects settings.
index | The port index for this vision. The index is zero-based. |
bright | The vision sensor brightness setting. Values are 0 to 255 |
sigs | List of signature objects used to setup the detection signatures for this sensor. |
|
virtual |
Reimplemented from vex::device.
|
virtual |
Reimplemented from vex::device.
int32_t vex::vision::takeSnapshot | ( | uint32_t | id | ) |
Takes a data sample from the vision sensor.
id | The ID of the object to look for. |
int32_t vex::vision::takeSnapshot | ( | code & | cc | ) |
Takes a data sample from the vision sensor.
cc | The code signature of the object to look for. |
int32_t vex::vision::takeSnapshot | ( | signature & | sig | ) |
Takes a data sample from the vision sensor.
sig | The signature of the object to look for. |
int32_t vex::vision::takeSnapshot | ( | uint32_t | id, |
uint32_t | count | ||
) |
Takes a data sample from the vision sensor, and only stores the largest samples of the specified amount.
id | The ID of the object to look for. |
count | the amount of objects to look for. The largest of the object will be returned. |
int32_t vex::vision::takeSnapshot | ( | code & | cc, |
uint32_t | count | ||
) |
Takes a data sample from the vision sensor, and only stores the largest samples of the specified amount.
cc | The code signature of the object to look for. |
count | the amount of objects to look for. The largest of the object will be returned. |
int32_t vex::vision::takeSnapshot | ( | signature & | sig, |
uint32_t | count | ||
) |
Takes a data sample from the vision sensor, and only stores the largest samples of the specified amount.
sig | The signature of the object to look for. |
count | the amount of objects to look for. The largest of the object will be returned. |
bool vex::vision::setSignature | ( | V5_DeviceVisionSignature * | pSignature | ) |
bool vex::vision::getSignature | ( | uint32_t | id, |
V5_DeviceVisionSignature * | pSignature | ||
) |
bool vex::vision::setSignature | ( | signature & | sig | ) |
bool vex::vision::getSignature | ( | uint32_t | id, |
signature & | sig | ||
) |
bool vex::vision::setMode | ( | detectionMode | mode | ) |
detectionMode vex::vision::getMode | ( | void | ) |
bool vex::vision::setBrightness | ( | uint8_t | value | ) |
uint8_t vex::vision::getBrightness | ( | void | ) |
bool vex::vision::setWhiteBalanceMode | ( | whiteBalanceMode | mode | ) |
whiteBalanceMode vex::vision::getWhiteBalanceMode | ( | void | ) |
bool vex::vision::setWhiteBalanceValues | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue | ||
) |
bool vex::vision::getWhiteBalanceValues | ( | uint8_t * | red, |
uint8_t * | green, | ||
uint8_t * | blue | ||
) |
bool vex::vision::setLedMode | ( | ledMode | mode | ) |
Changes the mode of the LED on the vision sensor.
mode | The LED mode. Automatic mode will cause the LED color to be controlled by the vision sensor firmware. Manual mode allows the LED color to be controlled by the user program. |
ledMode vex::vision::getLedMode | ( | void | ) |
Gets the mode of the LED from the vision sensor.
bool vex::vision::setLedBrightness | ( | uint8_t | percent | ) |
Changes the brightness of the LED on the vision sensor when LED is set to manual mode.
percent | A percentage of total brightness of the vision sensor LED when in manual mode. Values are 0 to 100. 0 = LED off |
uint8_t vex::vision::getLedBrightness | ( | void | ) |
Gets the brightness of the LED from the vision sensor.
bool vex::vision::setLedColor | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue | ||
) |
Changes the color of the LED on the vision sensor when LED is set to manual mode.
red | A value from 0 to 255 the represents the intensity of the red color of the LED. |
green | A value from 0 to 255 the represents the intensity of the green color of the LED. |
blue | A value from 0 to 255 the represents the intensity of the blue color of the LED. |
bool vex::vision::getLedColor | ( | uint8_t * | red, |
uint8_t * | green, | ||
uint8_t * | blue | ||
) |
Gets the color of the LED from the vision sensor.
red | A reference to a value to store the intensity of the red color of the LED. |
green | A reference to a value to store the intensity of the green color of the LED. |
blue | A reference to a value to store the intensity of the blue color of the LED. |
bool vex::vision::setWifiMode | ( | wifiMode | mode | ) |
wifiMode vex::vision::getWifiMode | ( | void | ) |
int32_t vex::vision::objectCount |
The ammount of objects found in the data sample.
object vex::vision::largestObject |
The largest object found in the data sample.
safearray< object, VISION_MAX_OBJECTS > vex::vision::objects |
An array containing the largest object(s) found in the data sample.