class
#include <pros/vision.hpp>
Vision
Base classes
- class Device
Public static functions
-
static vision_
signature_ s_ t signature_from_utility(const std::int32_t id, const std::int32_t u_min, const std::int32_t u_max, const std::int32_t u_mean, const std::int32_t v_min, const std::int32_t v_max, const std::int32_t v_mean, const float range, const std::int32_t type) - Creates a signature from the vision sensor utility.
- static std::vector<Vision> get_all_devices()
- Gets all vision sensors.
-
static std::int32_t print_signature(const vision_
signature_ s_ t sig) - Prints the contents of the signature as an initializer list to the terminal.
- static Vision get_vision()
- Gets a vision sensor that is plugged in to the brain.
Constructors, destructors, conversion operators
-
Vision(std::uint8_t port,
vision_zero_e_t zero_point = E_
VISION_ ZERO_ TOPLEFT) - Create a Vision Sensor object on the given port.
- Vision(const Device& device)
Public functions
- std::int32_t clear_led(void) const
- Clears the vision sensor LED color, reseting it back to its default behavior, displaying the most prominent object signature color.
-
vision_
color_ code_ t create_color_code(const std::uint32_t sig_id1, const std::uint32_t sig_id2, const std::uint32_t sig_id3 = 0, const std::uint32_t sig_id4 = 0, const std::uint32_t sig_id5 = 0) const - Creates a color code that represents a combination of the given signature IDs.
-
vision_
object_ s_ t get_by_size(const std::uint32_t size_id) const - Gets the nth largest object according to size_id.
-
vision_
object_ s_ t get_by_sig(const std::uint32_t size_id, const std::uint32_t sig_id) const - Gets the nth largest object of the given signature according to size_id.
-
vision_
object_ s_ t get_by_code(const std::uint32_t size_id, const vision_ color_ code_ t color_code) const - Gets the nth largest object of the given color code according to size_id.
- std::int32_t get_exposure(void) const
- Gets the exposure parameter of the Vision Sensor.
- std::int32_t get_object_count(void) const
- Gets the number of objects currently detected by the Vision Sensor.
-
vision_
signature_ s_ t get_signature(const std::uint8_t signature_id) const - Gets the object detection signature with the given id number.
- std::int32_t get_white_balance(void) const
- Get the white balance parameter of the Vision Sensor.
-
std::int32_t read_by_size(const std::uint32_t size_id,
const std::uint32_t object_count,
vision_
object_ s_ t*const object_arr) const - Reads up to object_count object descriptors into object_arr.
-
std::int32_t read_by_sig(const std::uint32_t size_id,
const std::uint32_t sig_id,
const std::uint32_t object_count,
vision_
object_ s_ t*const object_arr) const - Reads up to object_count object descriptors into object_arr.
-
int32_t read_by_code(const std::uint32_t size_id,
const vision_
color_ code_ t color_code, const std::uint32_t object_count, vision_ object_ s_ t*const object_arr) const - Reads up to object_count object descriptors into object_arr.
- std::int32_t set_auto_white_balance(const std::uint8_t enable) const
- Enables/disables auto white-balancing on the Vision Sensor.
- std::int32_t set_exposure(const std::uint8_t exposure) const
- Sets the exposure parameter of the Vision Sensor.
- std::int32_t set_led(const std::int32_t rgb) const
- Sets the vision sensor LED color, overriding the automatic behavior.
-
std::int32_t set_signature(const std::uint8_t signature_id,
vision_
signature_ s_ t*const signature_ptr) const - Stores the supplied object detection signature onto the vision sensor.
- std::int32_t set_white_balance(const std::int32_t rgb) const
- Sets the white balance parameter of the Vision Sensor.
- std::int32_t set_zero_point(vision_zero_e_t zero_point) const
- Sets the (0,0) coordinate for the Field of View.
- std::int32_t set_wifi_mode(const std::uint8_t enable) const
- Sets the Wi-Fi mode of the Vision sensor.