set-roi

wayland/vl53l1x-time-of-flight/set-roi

Set a region of interest (ROI). The ROI position is centered, only the ROI size can be changed. The full sensor (16x16 SPADs) provides a nominal 27 ° field of view (FoV). The FoV can be reduced to a minimum of 15 ° by setting the ROI to 4x4 SPADs. For further information please see: https://www.st.com/resource/en/application_note/dm00516219-using-the-programmable-region-of-interest-roi-with-the-vl53l1x-stmicroelectronics.pdf
set-roi
@/set-roi
Set a region of interest (ROI). The ROI position is centered, only the ROI size can be changed. The full sensor (16x16 SPADs) provides a nominal 27 ° field of view (FoV). The FoV can be reduced to a minimum of 15 ° by setting the ROI to 4x4 SPADs. For further information please see: https://www.st.com/resource/en/application_note/dm00516219-using-the-programmable-region-of-interest-roi-with-the-vl53l1x-stmicroelectronics.pdf
DEV@/vl53l1x-device
A VL53L1X device.
Xnumber
ROI width in single photon avalanche detectors (SPADs). Full width of sensor is 16 SPADS. Minimum width of ROI is 4 SPADs.
Ynumber
ROI height in single photon avalanche detectors (SPADs). Full height of sensor is 16 SPADS. Minimum height of ROI is 4 SPADs.
UPDpulse
Update. Trigger set ROI.
set-roi
DEV
X
Y
UPD
DONE
DONEpulse
Pulse when ROI set.
To use the node in your project you should have the wayland/vl53l1x-time-of-flight library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {

    void evaluate(Context ctx) {
        // The node responds only if there is an input pulse
        if (!isInputDirty<input_UPD>(ctx))
            return;
        // Get a pointer to the `VL53L1X` class instance
        auto sensor = getValue<input_DEV>(ctx);
        sensor->setROI(getValue<input_X>(ctx), getValue<input_Y>(ctx));
        emitValue<output_DONE>(ctx,1);
    }
}