How to read histograms and compute distances from them in VL53L3CX?
Despite many previous questions about how to read histograms from the VL53L3CX, I am still confused how the histogram data is formatted.
I currently read out the histogram as follows:
- I call `VL53L3A2_RANGING_SENSOR_GetDistance`
- Then right after getting the distance I use the following function to access the histogram data: VL53LX_GetAdditionalData
- Then I print out the histogram to the console
As the data is output, I then have a python script parsing the data output on the /dev/ttyACM0 serial port.
Here is an example I get for 2 histograms that are printed out sequentially when imaging a wall 0.5m away (ignore bottom plot).
My questions are:
- Why does each histogram have 2 bumps even though I am only pointing the sensor at a flat wall?
- Why do the two consecutive histograms look different?
- At each frame, is the distance computed using both consecutive histograms or only one of them?
- How would I parse this histogram data to generate an actual histogram I can compute distances through simple peak finding?

