ESP32 with LiDar Sensor for distance calculation

Hello everyone,

I am new here, I was searching on my project and came to a thread on this Forum, but couldn’t find the solution to my issue. So, I thought to ask for it.

I am working on the ESP32 board and my project is to design an indoor localization robot. I need to use the Lidar sensor, which will act as the robot’s eyes. I have designed the robot and moved the motors successfully.

Now I am trying to interface the Lidar sensor with the ESP32. I have doubled checked the wiring, its all perfect. But I am trying to get the distance of an object from the robot and no sucess. Could someone please guide me in the right direction. How to calculate the obect distance using lidar and esp32?

For reference:
This version of ESP32: https://www.theengineeringprojects.com/2020/12/esp32-pinout-datasheet-features-applications.html
This lidar sensor: https://www.amazon.com/Single-Point-Ranging-Arduino-Pixhawk-Benewake/dp/B07B631YRF
Following this tutorial: https://www.waveshare.com/wiki/TF-Luna_LiDAR_Range_Sensor (ESP32 section)

Any help would be appreciated
Thanks.

Can you post the exact PlatformIO project you’re using, what your wiring diagram is and what the current serial output is?