system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does LiDAR work, and how is it able to be so accurate?

I get that LiDAR works like Sonar and Radar, in that it sends out a pulse and measures the time which it takes to return to a sensor. I don't understand how we are able to measure precisely, when the time it takes light to travel the distance seems to be too small to measure. For example, if a person is five feet (1.524m) away from a LiDAR system, it would take about five nanoseconds for the light to travel one way, and about five on the way back. This is ten nanoseconds. Do we have the ability to measure this time with enough precision, and use the speed of light to determine distance? Or is there something else going on?
gpt
Yes, there is something else going on. The LiDAR typically uses a technique called “optical heterodyne detection”, which allows for more precise time of flight measurements than a given clock speed would otherwise allow. Even with picosecond accuracy (one trillionth of a second!)

Imagine you’re at a wave pool. The wave maker starts making a whole bunch of waves. When one of them hits the end of the pool it bounces off the edge and a smaller wave goes back towards the wave maker. When the top of that little guy gets to the wave maker, the wave maker can see it! Since the wave maker has been making all its waves exactly the same size and length, it can compare where it is at in the cycle to the top of that returning wave. Halfway through making another wave? A quarter?

Light moves so fast that in LiDAR applications, whatever distances we’re usually interested in, the light gets back before we’re done making another wave. And since we can figure out how much offset the returning wave is from the one we’re making, that gives us more precise time-of-flight than our clock can even measure.