![]() |
ImFusion SDK 4.3
|
#include <RGBD/Include/ImFusion/RGBD/LaserManager.h>
Manages synchronization and coordination of laser states among multiple RGB-D sensors. More...
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:
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 LaserManager & | get () |
| Returns the singleton instance of the LaserManager. | |
| 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.