file
vision.hContains prototypes for the VEX Vision Sensor-related functions.
This file should not be modified by users, since it gets replaced whenever a kernel upgrade occurs.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http:/
Namespaces
Functions
- struct __attribute__((__packed__)) gps_position_s
Functions
- int32_t vision_clear_led(uint8_t port)
- Clears the vision sensor LED color, reseting it back to its default behavior, displaying the most prominent object signature color.
-
vision_
signature_ s_ t vision_signature_from_utility(const int32_t id, const int32_t u_min, const int32_t u_max, const int32_t u_mean, const int32_t v_min, const int32_t v_max, const int32_t v_mean, const float range, const int32_t type) - Creates a signature from the vision sensor utility.
- vision_color_code_t vision_create_color_code(uint8_t port, const uint32_t sig_id1, const uint32_t sig_id2, const uint32_t sig_id3, const uint32_t sig_id4, const uint32_t sig_id5)
- Creates a color code that represents a combination of the given signature IDs.
-
vision_
object_ s_ t vision_get_by_size(uint8_t port, const uint32_t size_id) - Gets the nth largest object according to size_id.
-
vision_
object_ s_ t vision_get_by_sig(uint8_t port, const uint32_t size_id, const uint32_t sig_id) - Gets the nth largest object of the given signature according to size_id.
-
vision_
object_ s_ t vision_get_by_code(uint8_t port, const uint32_t size_id, const vision_color_code_t color_code) - Gets the nth largest object of the given color code according to size_id.
- int32_t vision_get_exposure(uint8_t port)
- Gets the exposure parameter of the Vision Sensor.
- int32_t vision_get_object_count(uint8_t port)
- Gets the number of objects currently detected by the Vision Sensor.
- int32_t vision_get_white_balance(uint8_t port)
- Get the white balance parameter of the Vision Sensor.
-
int32_t vision_print_signature(const vision_
signature_ s_ t sig) - Prints the contents of the signature as an initializer list to the terminal.
-
int32_t vision_read_by_size(uint8_t port,
const uint32_t size_id,
const uint32_t object_count,
vision_
object_ s_ t*const object_arr) - Reads up to object_count object descriptors into object_arr.
-
int32_t vision_read_by_sig(uint8_t port,
const uint32_t size_id,
const uint32_t sig_id,
const uint32_t object_count,
vision_
object_ s_ t*const object_arr) - Reads up to object_count object descriptors into object_arr.
-
int32_t vision_read_by_code(uint8_t port,
const uint32_t size_id,
const vision_color_code_t color_code,
const uint32_t object_count,
vision_
object_ s_ t*const object_arr) - Reads up to object_count object descriptors into object_arr.
-
vision_
signature_ s_ t vision_get_signature(uint8_t port, const uint8_t signature_id) - Gets the object detection signature with the given id number.
-
int32_t vision_set_signature(uint8_t port,
const uint8_t signature_id,
vision_
signature_ s_ t*const signature_ptr) - Stores the supplied object detection signature onto the vision sensor.
- int32_t vision_set_auto_white_balance(uint8_t port, const uint8_t enable)
- Enables/disables auto white-balancing on the Vision Sensor.
- int32_t vision_set_exposure(uint8_t port, const uint8_t exposure)
- Sets the exposure parameter of the Vision Sensor.
- int32_t vision_set_led(uint8_t port, const int32_t rgb)
- Sets the vision sensor LED color, overriding the automatic behavior.
- int32_t vision_set_white_balance(uint8_t port, const int32_t rgb)
- Sets the white balance parameter of the Vision Sensor.
- int32_t vision_set_zero_point(uint8_t port, vision_zero_e_t zero_point)
- Sets the (0,0) coordinate for the Field of View.
- int32_t vision_set_wifi_mode(uint8_t port, const uint8_t enable)
- Sets the Wi-Fi mode of the Vision sensor.
Macros
Parameters given by VEX
- #define VISION_OBJECT_ERR_SIG
- The width of the Vision Sensor’s field of view.
- #define VISION_FOV_WIDTH
- The width of the Vision Sensor’s field of view.
- #define VISION_FOV_HEIGHT
- The height of the Vision Sensor’s field of view.
Enums
- enum vision_object_type { E_VISION_OBJECT_NORMAL = 0, E_VISION_OBJECT_COLOR_CODE = 1, E_VISION_OBJECT_LINE = 2 }
- enum vision_zero { E_VISION_ZERO_TOPLEFT = 0, E_VISION_ZERO_CENTER = 1 }