6 LASER_RADIUS = 25. # mm
12 k = math.pow(MAX/MIN, 1./STEPS)
14 # t is in us, result is 9 bits
16 # process angle from t
17 a = (t / (1000000./RPS)) * 2. * math.pi
19 # process d from a (between 20cm and 350cm)
20 d = LASER_RADIUS / math.sin(a/2)
22 frame = math.log(d/MIN)/math.log(k)
30 # frame is integer 9 bits, result is distance
31 def frame_to_distance(frame):
32 d = MIN*(math.pow(k, frame))
36 x = time_to_frame(float(sys.argv[1]))