• DepthAI
  • setIrLaserDotProjectorIntensity too slow

Hi, i'm doing an app where i need to take a photo without LaserDotPojector, then turn on it and take another photo.
However, when i do that, it is so slow that i have to put a time sleep, so i thought to put a while for waiting until it changes.

Is there any function to allow me to check if it is already setted? Something like getIrLaserDotProjectorIntensity

@hcarrion unfortunately not. I'd suggest using Script node to toggle that on/off, and take the photo. As Script node is directly on device, so there's no comms overhead (xlink).
Or if timing isn't critical; take photo, turn laser on, wait eg. 1 sec, take another photo.

I didn't get into script so much. Will it be somethin like this?

scriptEnableIr = pipeline.create(dai.node.Script)

scriptEnableIr.setProcessor(dai.ProcessorType.LEON_CSS)

scriptEnableIr.setScript("""

    device.setIrFloodLightIntensity(0.8)

""")

And how could i execute it?

Thanks you so much for your fast response!

    Hi hcarrion
    The device Script node executes upon device boot. If no loop is present inside the script, it will only execute once. For your current code: the device boots up, script is executed, IR light intensity is set to 0.8, the script exits and the rest of the pipeline continues to work.

    Thanks,
    Jaka