#include <MultiSenseTypes.hh>
Public Member Functions | |
Config () | |
float | getDutyCycle (uint32_t i) const |
bool | getFlash () const |
bool | setDutyCycle (float percent) |
bool | setDutyCycle (uint32_t i, float percent) |
void | setFlash (bool onOff) |
Private Attributes | |
std::vector< float > | m_dutyCycle |
bool | m_flashEnabled |
Class used to store a specific lighting configuration. Member of this class are set and queried via set and get methods. This class is used as an input to a channel object to query and set lighting parameters.
Example code to query a lighting configuration:
{.cpp} // // Instantiate a channel connecting to a sensor at the factory default // IP address crl::multisense::Channel* channel; channel = crl::multisense::Channel::Create("10.66.171.21"); channel->setMtu(7200); // // Create a lightingConfig instance to store our queried lighting configuration crl::multisense::lighting::Config lightingConfig; // // Query the lighting configuration from the Channel instance crl::multisense::Status status = channel->getLightingConfig(lightingConfig); // // Check to see if the lighting configuration query was successful if(crl::multisense::Status_Ok != status) { throw std::runtime_error("Unable to query lighting configuration"); } // // Use the lighting configuration... // // Destroy the channel instance crl::multisense::Channel::Destroy(channel);
Example code to set a lighting configuration:
{.cpp} // // Instantiate a channel connecting to a sensor at the factory default // IP address crl::multisense::Channel* channel; channel = crl::multisense::Channel::Create("10.66.171.21"); channel->setMtu(7200); // // Create a lightingConfig instance to store our queried lighting configuration crl::multisense::lighting::Config lightingConfig; crl::multisense::Status status; // // Query the lighting configuration from the Channel instance status = channel->getLightingConfig(lightingConfig); // // Check to see if the lighting configuration query was successful if(crl::multisense::Status_Ok != status) { throw std::runtime_error("Unable to query lighting configuration"); } // // Change the duty cycle for all light to the max setting and enable // light flashing lightingConfig.setDutyCycle(crl::multisense::lighting::MAX_DUTY_CYCLE); lightingConfig.setFlash(true); // // Set the new lighting configuration status = channel->setLightingConfig(lightingConfig); // // Check to see if the new lighting configuration was successfully // received if(crl::multisense::Status_Ok != status) { throw std::runtime_error("Unable to set lighting configuration"); } // // Destroy the channel instance crl::multisense::Channel::Destroy(channel);
Definition at line 1535 of file MultiSenseTypes.hh.
crl::multisense::lighting::Config::Config | ( | ) | [inline] |
Default constructor. Flashing is disabled and all lights are off
Definition at line 1614 of file MultiSenseTypes.hh.
float crl::multisense::lighting::Config::getDutyCycle | ( | uint32_t | i | ) | const [inline] |
Get the current duty cycle in terms of percent for a specific light
i | The index of the light to query |
Definition at line 1604 of file MultiSenseTypes.hh.
bool crl::multisense::lighting::Config::getFlash | ( | ) | const [inline] |
Get the current lighting flash setting.
Definition at line 1554 of file MultiSenseTypes.hh.
bool crl::multisense::lighting::Config::setDutyCycle | ( | float | percent | ) | [inline] |
Set a sensors duty cycle in terms of percent for all the on-board lights
percent | The percent "on" to set all the on-board LED's [0.0, 100.0] |
Definition at line 1564 of file MultiSenseTypes.hh.
bool crl::multisense::lighting::Config::setDutyCycle | ( | uint32_t | i, |
float | percent | ||
) | [inline] |
Set a sensors duty cycle in terms of percent for a specific light based off its index
i | The index of the light to configure |
percent | The percent "on" to set all the on-board LED's [0.0, 100.0] |
Definition at line 1585 of file MultiSenseTypes.hh.
void crl::multisense::lighting::Config::setFlash | ( | bool | onOff | ) | [inline] |
Turn on/off light flashing. During flashing lights are only on when the image sensor is exposing. This significantly reduces the sensor power consumption
onOff | A boolean flag to enable or disable flashing |
Definition at line 1546 of file MultiSenseTypes.hh.
std::vector<float> crl::multisense::lighting::Config::m_dutyCycle [private] |
Definition at line 1619 of file MultiSenseTypes.hh.
bool crl::multisense::lighting::Config::m_flashEnabled [private] |
Definition at line 1614 of file MultiSenseTypes.hh.