LibMultiSense
LibMultiSense Documentation
crl::multisense::lighting::Config Class Reference

Class used to store a specific lighting configuration. More...

#include <MultiSenseTypes.hh>

Public Member Functions

void setFlash (bool onOff)
 Turn on/off light flashing. More...
 
bool getFlash () const
 Get the current lighting flash setting. More...
 
bool setDutyCycle (float percent)
 Set a sensors duty cycle in terms of percent for all the on-board lights. More...
 
bool setDutyCycle (uint32_t i, float percent)
 Set a sensors duty cycle in terms of percent for a specific light based off its index. More...
 
float getDutyCycle (uint32_t i) const
 Get the current duty cycle in terms of percent for a specific light. More...
 
 Config ()
 Default constructor. More...
 

Private Attributes

bool m_flashEnabled
 
std::vector< float > m_dutyCycle
 

Detailed Description

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:

//
// Instantiate a channel connecting to a sensor at the factory default
// IP address
channel = crl::multisense::Channel::Create("10.66.171.21");
channel->setMtu(7200);
//
// Create a lightingConfig instance to store our queried lighting configuration
//
// 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
throw std::runtime_error("Unable to query lighting configuration");
}
//
// Use the lighting configuration...
//
// Destroy the channel instance

Example code to set a lighting configuration:

//
// Instantiate a channel connecting to a sensor at the factory default
// IP address
channel = crl::multisense::Channel::Create("10.66.171.21");
channel->setMtu(7200);
//
// Create a lightingConfig instance to store our queried lighting configuration
//
// Query the lighting configuration from the Channel instance
status = channel->getLightingConfig(lightingConfig);
//
// Check to see if the lighting configuration query was successful
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.setFlash(true);
//
// Set the new lighting configuration
status = channel->setLightingConfig(lightingConfig);
//
// Check to see if the new lighting configuration was successfully
// received
throw std::runtime_error("Unable to set lighting configuration");
}
//
// Destroy the channel instance

Definition at line 1988 of file MultiSenseTypes.hh.

Constructor & Destructor Documentation

◆ Config()

crl::multisense::lighting::Config::Config ( )
inline

Default constructor.

Flashing is disabled and all lights are off

Definition at line 2067 of file MultiSenseTypes.hh.

Member Function Documentation

◆ getDutyCycle()

float crl::multisense::lighting::Config::getDutyCycle ( uint32_t  i) const
inline

Get the current duty cycle in terms of percent for a specific light.

Parameters
iThe index of the light to query
Returns
The current duty cycle setting for the light corresponding to index i

Definition at line 2057 of file MultiSenseTypes.hh.

◆ getFlash()

bool crl::multisense::lighting::Config::getFlash ( ) const
inline

Get the current lighting flash setting.

Returns
A boolean flag corresponding to if flashing is enabled or disabled

Definition at line 2007 of file MultiSenseTypes.hh.

◆ setDutyCycle() [1/2]

bool crl::multisense::lighting::Config::setDutyCycle ( float  percent)
inline

Set a sensors duty cycle in terms of percent for all the on-board lights.

Parameters
percentThe percent "on" to set all the on-board LED's [0.0, 100.0]
Returns
If the given percent setting is valid

Definition at line 2017 of file MultiSenseTypes.hh.

◆ setDutyCycle() [2/2]

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.

Parameters
iThe index of the light to configure
percentThe percent "on" to set all the on-board LED's [0.0, 100.0]
Returns
If the given percent setting is valid

Definition at line 2038 of file MultiSenseTypes.hh.

◆ setFlash()

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

Parameters
onOffA boolean flag to enable or disable flashing

Definition at line 1999 of file MultiSenseTypes.hh.

Member Data Documentation

◆ m_dutyCycle

std::vector<float> crl::multisense::lighting::Config::m_dutyCycle
private

Definition at line 2072 of file MultiSenseTypes.hh.

◆ m_flashEnabled

bool crl::multisense::lighting::Config::m_flashEnabled
private

Definition at line 2067 of file MultiSenseTypes.hh.


The documentation for this class was generated from the following file:
crl::multisense::Channel
Class which manages all communications with a MultiSense device.
Definition: MultiSenseChannel.hh:69
crl::multisense::Status_Ok
static CRL_CONSTEXPR Status Status_Ok
Definition: MultiSenseTypes.hh:98
crl::multisense::lighting::Config::setDutyCycle
bool setDutyCycle(float percent)
Set a sensors duty cycle in terms of percent for all the on-board lights.
Definition: MultiSenseTypes.hh:2017
crl::multisense::lighting::Config::setFlash
void setFlash(bool onOff)
Turn on/off light flashing.
Definition: MultiSenseTypes.hh:1999
crl::multisense::lighting::MAX_DUTY_CYCLE
static CRL_CONSTEXPR float MAX_DUTY_CYCLE
The maximum duty cycle for adjusting light intensity.
Definition: MultiSenseTypes.hh:1901
crl::multisense::Channel::setLightingConfig
virtual Status setLightingConfig(const lighting::Config &c)=0
Set the on-board lighting configuration.
crl::multisense::lighting::Config
Class used to store a specific lighting configuration.
Definition: MultiSenseTypes.hh:1988
crl::multisense::Channel::Destroy
static void Destroy(Channel *instanceP)
Destroy a channel instance that was created using the static member function Channel::Create().
crl::multisense::Status
int32_t Status
General status typdef used as a return value for get/set crl::multisense::Channel methods.
Definition: MultiSenseTypes.hh:93
crl::multisense::Channel::setMtu
virtual Status setMtu(int32_t mtu)=0
Set the current sensor's MTU.
crl::multisense::Channel::getLightingConfig
virtual Status getLightingConfig(lighting::Config &c)=0
Query the on-board lighting configuration.
crl::multisense::Channel::Create
static Channel * Create(const std::string &sensorAddress)
Create a Channel instance, used to manage all communications with a sensor.