2018-03-13 05:41 AM
Hi.
At the MWC 2018, ST presented a demo with RGB camera and the VL53L1x with multiple measurement points on the live image
.
I got the evaluation boards this week, the datasheet and API manuals online for this device don’t have enough details how to operate this configuration for multiple ROI
,
I tried to work through this using the example code but the results does make any sense, the distance measurement seems to be correct but it’s similar on all of the pixels within the aperture even when I cover just half of the sensor
.
Did someone succeed operating the ROI to sense the distance in specific pixel within the aperture?
I've developed a small test app for the multiple ROI, here i'm covering half of the sensor, as you can see all pixels returns around the same result:
Thanks
,
Itamar
2018-03-23 05:21 AM
Same issue for me using multiple ROIs. Maybe someone could post some small code how to obtain the correct range value for the whole FoV (13*13 array, one ranging value per item).
BR,
Albagir
2018-05-08 04:33 AM
Yes, I can confirm that on my side I have the same problem and don't know how to solve this issue.
2018-05-17 07:05 AM
Anyone who solved the issue and can provide some code?
2018-05-24 02:59 PM
Itamar -
Looking at your data, you didn't 'cover half the sensor'. Despite the rather large IR filter, the hole in the sensor is REALLY small.
I tried this experiment.
I placed my sensor in the bottom of an open box looking up.
This allows me to carefully place my targets. I used a ruler as a target.
I used a box 20cm on a side and 13cm tall. But the dimensions aren't really important.
I marked the centerline and +/- 12.5 degrees.
This allows me to move targets in and out of the Field of View (FoV) repeatably. The ruler simply rests on the sides of the box.
Code follows:
void AutonomousLowPowerRangingTest(void)
{
uint32_t pMeasurementTimingBudgetMicroSeconds;
VL53L1_UserRoi_t Roi;
static VL53L1_RangingMeasurementData_t RangingData;
printf('Autonomous Ranging Test\n');
status = VL53L1_WaitDeviceBooted(Dev);
status += VL53L1_DataInit(Dev);
status += VL53L1_StaticInit(Dev);
status += VL53L1_SetPresetMode(Dev,VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS);
status += VL53L1_SetDistanceMode(Dev, VL53L1_DISTANCEMODE_LONG);
status += VL53L1_SetMeasurementTimingBudgetMicroSeconds(Dev,20000); // 8 ms
status += VL53L1_SetInterMeasurementPeriodMilliSeconds(Dev, 100);
status += VL53L1_GetMeasurementTimingBudgetMicroSeconds(Dev, &pMeasurementTimingBudgetMicroSeconds);
printf('Timing Budget = %d\n', pMeasurementTimingBudgetMicroSeconds);
Roi.TopLeftX = 0;
Roi.TopLeftY = 15;
Roi.BotRightX = 15;
Roi.BotRightY = 0;
#if 1
Roi.TopLeftX = 5;
Roi.TopLeftY = 15;
Roi.BotRightX = 10;
Roi.BotRightY = 0;
#endif
status += VL53L1_SetUserROI( Dev, &Roi);
status += VL53L1_StartMeasurement(Dev);
if(status){
printf('YOU DID SOMETHING WRONG \n');
while(1);
}
do // interrupt mode
{
__WFI(); // Wait For Interrupt - you could also poll
if(IntCount !=0 ){
IntCount=0;
status = VL53L1_GetRangingMeasurementData(Dev, &RangingData);
if(status==0){
printf('%d,%d,%.2f,%.2f,%d\n', RangingData.RangeStatus,RangingData.RangeMilliMeter,
RangingData.SignalRateRtnMegaCps/65536.0,RangingData.AmbientRateRtnMegaCps/65336.0,HAL_GetTick());
}
status = VL53L1_ClearInterruptAndStartMeasurement(Dev);
}
}
while(1);
One issue I had was understanding the co-ordinate system.
Assume the (0,0) location is in the bottom left of the chip. (15,15) is in the upper right.
Then view the EVK so the USB is at the ‘top’ and the characters are right-side-up.
Run the code using the (0,15) (15,0) FoV. Move your rulers in an out until you are convinced you are at the edge of the FoV. Mark the box with these edges.
Then run the code using the (5,15) (10,0) FoV. Again move the rulers in an out until you are convinced the FoV has moved “in�?.
I get a pretty significant change in the ROI. It's about what I would expect.
My only worry is that an ROI change might not change immediately. If a range has started, it might only take effect after the range finishes.