Using Laser ON-OFF pattern and retrieving laser state

Hello,

I need to use the fonctionnality to toggle the LASER ON/OFF at each frame so I can have a frame with LASER ON and the next one with LASER OFF.

I set the OB_PROP_LASER_ON_OFF_PATTERN_INT property like this:

device->setIntProperty(OB_PROP_LASER_ON_OFF_PATTERN_INT, 1);
It seems to toggle the laser correctly.

Now I want to retrieve the actual state of the laser at each frame, so I tried:
int emitterState = frame->getMetadataValue((OBFrameMetadataType)OB_FRAME_METADATA_TYPE_LASER_STATUS);

But I got this error:
[10/31 10:43:06.072705][warning][654255][ObException.cpp:5] Unsupported metadata type: Laser Status

My setup is:

  • Jetson Orin NX
  • Gemini 330L, sn: CP6D54D0000S
  • FW: Gemini330_Release_1.3.25
  • Orbbec SDK: v1.10.12
  • Color @ 60Fps
  • Depth @ 60fps

I just saw here that OB_FRAME_METADATA_TYPE_LASER_STATUS can only be extracted from depthFrame and irFrame so It is needed to do this:

std::shared_ptr < ob::DepthFrame > depth_frame = fset->depthFrame();
int emitterState = depth_frame->getMetadataValue(OB_FRAME_METADATA_TYPE_LASER_STATUS);

Regards