40 bool idisableGestures =
true,
41 std::unique_ptr<Filter> ifilter = std::make_unique<PassthroughFilter>());
PROS API header provides high-level user functionality.
std::unique_ptr< Filter > filter
double getSelectedOutput()
Gets the output directly from the sensor using the selected output.
double controllerGet() override
Get the sensor value for use in a control loop.
OpticalSensor(std::uint8_t iport, OpticalSensorOutput ioutput=OpticalSensorOutput::hue, bool idisableGestures=true, std::unique_ptr< Filter > ifilter=std::make_unique< PassthroughFilter >())
An optical sensor on a V5 port.
double getHue() const
Get the current hue value in the range [0, 360).
double getSaturation() const
Get the current saturation value in the range [0, 1].
int32_t setLedPWM(std::uint8_t ivalue) const
Set the PWM value of the white LED in the range [0, 100].
double getBrightness() const
Get the current brightness value in the range [0, 1].
virtual ~OpticalSensor()=default
int32_t getLedPWM() const
Get the PWM value of the white LED in the range [0, 100].
double get()
Get the current filtered value of the selected output (configured by the constructor).
pros::c::optical_rgb_s_t getRGB() const
Get the processed RGBC data from the sensor.
int32_t getProximity() const
Get the current proximity value in the range [0, 255].
int32_t disableGestures() const
Disable gestures.
int32_t enableGestures() const
Enable gestures.
OpticalSensorOutput output
@ brightness
The amount of light.
@ saturation
The color's intensity relative to its brightness.