Hi,
I made a python script to read the serial data in and print the values just like the javascript code in the high accuracy visualizer lab. Now im stuck with the last part to calculate the actual distance. I have run the script next to the lab in chrome and nearly all values are identical. I just dont understand how to convert the last step to range in m.
i got nearly everything ini the process1 function working.
I am stuck at this part of the code:
// x_coord, y_coord, z_coord var x_coord = math.add(x[6], math.multiply(x[7], 256)); var y_coord = math.add(x[8], math.multiply(x[9], 256)); var z_coord = math.add(x[10], math.multiply(x[11], 256)); var xyz = [x_coord, y_coord, z_coord]; for (var xyzidx=0; xyzidx<xyz.length; xyzidx++) { math.forEach(xyz[xyzidx], function(value, idx, ary) { if (value > 32767) { value = value - 65536; } ary[idx] = math.add(rangeIdx, math.multiply(value, 65536))/xyzQFormat; }); }
i have the x_coord value the same value at the declaration, the first line. but after the first iteration it changes from 24 value to 1.5m (rounded). What calculation happens here exactly?
cheers