VEX V5 Python API
|
Class representing Vision Sensor device. More...
Inherits vex.Device.
Public Member Functions | |
def | __init__ (self, index, brightness=None, signatures=None) |
Creates a new vision object on the port specified. More... | |
def | take_snapshot (self, id_or_sig_or_code, count=None) |
Takes a data sample from the vision sensor. More... | |
def | set_signature (self, signature) |
def | set_mode (self, mode) |
def | get_mode (self) |
def | set_brightness (self, value) |
def | get_brightness (self) |
def | set_white_balance_mode (self, mode) |
def | get_white_balance_mode (self) |
def | set_white_balance_values (self, color) |
set a 0xRRGGBB color More... | |
def | get_white_balance_values (self) |
def | set_led_mode (self, mode) |
Changes the mode of the LED on the vision sensor. More... | |
def | get_led_mode (self) |
Gets the mode of the LED from the vision sensor. More... | |
def | set_led_brightness (self, percent) |
Changes the brightness of the LED on the vision sensor when LED is set to manual mode. More... | |
def | get_led_brightness (self) |
Gets the brightness of the LED from the vision sensor. More... | |
def | set_led_color (self, red, green, blue) |
Changes the color of the LED on the vision sensor when LED is set to manual mode. More... | |
def | get_led_color (self) |
Gets the color of the LED from the vision sensor. More... | |
def | set_wifi_mode (self, mode) |
def | get_wifi_mode (self) |
def | type (self) |
Get the device type. More... | |
def | installed (self) |
Gets the status of what is installed. More... | |
def | value (self) |
Public Attributes | |
object_count | |
Number of objects found in the data sample. More... | |
largest_object | |
The largest object found in the data sample. More... | |
objects | |
List of the largest objects found in the data sample. More... | |
Class representing Vision Sensor device.
The vision sensor has a resolution of 316x212 pixels
def vex.Vision.__init__ | ( | self, | |
index, | |||
brightness = None , |
|||
signatures = None |
|||
) |
Creates a new vision object on the port specified.
The vision sensor has a resolution of 316x212 pixels
index | The port index for this vision. The index is zero based. |
brightness | The vision sensor brightness seting. Values are 0 to 255 |
signatures | List of signature objects used to setup the detection signatures for this sensor. |
def vex.Vision.take_snapshot | ( | self, | |
id_or_sig_or_code, | |||
count = None |
|||
) |
Takes a data sample from the vision sensor.
id_or_sig_or_code | The ID or VisionCode or VisionSignature of the object to look for. |
count | the amount of objects to look for. The largest of the object will be returned. Optional. |
def vex.Vision.set_signature | ( | self, | |
signature | |||
) |
def vex.Vision.set_mode | ( | self, | |
mode | |||
) |
def vex.Vision.get_mode | ( | self | ) |
def vex.Vision.set_brightness | ( | self, | |
value | |||
) |
def vex.Vision.get_brightness | ( | self | ) |
def vex.Vision.set_white_balance_mode | ( | self, | |
mode | |||
) |
def vex.Vision.get_white_balance_mode | ( | self | ) |
def vex.Vision.set_white_balance_values | ( | self, | |
color | |||
) |
set a 0xRRGGBB color
def vex.Vision.get_white_balance_values | ( | self | ) |
def vex.Vision.set_led_mode | ( | self, | |
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. |
def vex.Vision.get_led_mode | ( | self | ) |
Gets the mode of the LED from the vision sensor.
def vex.Vision.set_led_brightness | ( | self, | |
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 |
def vex.Vision.get_led_brightness | ( | self | ) |
Gets the brightness of the LED from the vision sensor.
def vex.Vision.set_led_color | ( | self, | |
red, | |||
green, | |||
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. |
def vex.Vision.get_led_color | ( | self | ) |
Gets the color of the LED from the vision sensor.
def vex.Vision.set_wifi_mode | ( | self, | |
mode | |||
) |
def vex.Vision.get_wifi_mode | ( | self | ) |
|
inherited |
Get the device type.
|
inherited |
Gets the status of what is installed.
|
inherited |
vex.Vision.object_count |
Number of objects found in the data sample.
vex.Vision.largest_object |
The largest object found in the data sample.
@type vex.VisionObject
vex.Vision.objects |
List of the largest objects found in the data sample.
@type vex.VisionObject[]