Lidar, optical distance and time of flight sensors