ImFusion SDK 4.3
LaserManager Class Reference

#include <RGBD/Include/ImFusion/RGBD/LaserManager.h>

Manages synchronization and coordination of laser states among multiple RGB-D sensors. More...

Detailed Description

Manages synchronization and coordination of laser states among multiple RGB-D sensors.

This singleton class ensures that only one sensor's laser is active at a time, preventing interference and enabling reliable multi-sensor acquisition. Therfore it is used for sensors that have active laser illumination (e.g. structured light or time-of-flight sensors).

LaserManager provides configurable delays for sensor and laser state changes, manages a queue for lock requests, and tracks lock failures.

Typical usage:

auto& manager = LaserManager::get();
manager.addSensor(sensorA); // usually done in RGBDStream::startImpl()
manager.addSensor(sensorB); // usually done in RGBDStream::startImpl()
manager.setEnabled(true); // usually done once at program start
manager.lockLaserState(sensorA); //usually done in RGBDStream::doWork() through LaserLocker
// Only sensorA's laser is active
manager.unlockLaserState(sensorA); //usually done in RGBDStream::doWork() through LaserLocker running out of scope
static LaserManager & get()
Returns the singleton instance of the LaserManager.
Note
  • The class is thread-safe.
  • All delays are specified in milliseconds.
  • Sensors must support laser control for correct operation.
See also
ImFusion::LaserLocker, ImFusion::RGBDStream

Public Member Functions

 LaserManager (const LaserManager &obj)=delete
 
void setEnabled (bool enable)
 Enables or disables laser synchronization.
 
bool enabled () const
 
void setLaserWaitTime (int waitMs)
 Sets the duration (ms) to wait after enabling a laser before frames are accepted.
 
int laserWaitTime () const
 
void setLaserDelay (int delay)
 Sets the delay (ms) between turning all lasers off and enabling the target laser.
 
int laserDelay () const
 
void setSensorOpenDelay (int delay)
 Sets the delay (ms) after opening a sensor.
 
int sensorOpenDelay () const
 
void setSensorCloseDelay (int delay)
 Sets the delay (ms) after closing a sensor.
 
int sensorCloseDelay () const
 
void setSensorStartDelay (int delay)
 Sets the delay (ms) after starting a sensor.
 
int sensorStartDelay () const
 
void setSensorStopDelay (int delay)
 Sets the delay (ms) after stopping a sensor.
 
int sensorStopDelay () const
 
void addSensor (RGBDStream *sensor)
 Registers a sensor for laser management.
 
void removeSensor (RGBDStream *sensor)
 Removes a sensor from laser management.
 
bool lockLaserState (RGBDStream *sensor, int timeout=5000)
 Locks the laser state for the specified sensor, turning its laser on and all others off.
 
void unlockLaserState (RGBDStream *sensor)
 Unlocks the laser state for the specified sensor, allowing other sensors to acquire the lock.
 
int sensorCount () const
 Returns the number of managed sensors.
 

Static Public Member Functions

static LaserManagerget ()
 Returns the singleton instance of the LaserManager.
 

Member Function Documentation

◆ lockLaserState()

bool lockLaserState ( RGBDStream * sensor,
int timeout = 5000 )

Locks the laser state for the specified sensor, turning its laser on and all others off.

Returns true if the lock was acquired within the timeout.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close