thaytan / OpenHMD

Free and Open Source API and drivers for immersive technology.
Boost Software License 1.0
137 stars 12 forks source link

DK2 sensor distortion calibration - indices incorrect #41

Closed mattipee closed 2 years ago

mattipee commented 2 years ago

Raising issue purely as a result of code inspection (also I don't even have a DK2)

https://github.com/thaytan/OpenHMD/blob/db16fb8254fdfbc5fcc372845232eb9d3be0b360/src/drv_oculus_rift/rift-sensor.c#L468

This comment states:

/*
 * k = [ k1, k2, p1, p2, k3, k4 ] for DK2 distortion
 */

Code reads:

            k[0] = k1; k[1] = k2;
            k[1] = p1; k[2] = p2;
            k[4] = k3;

Questioning correctness of k[1] = p1; and k[2] = p2; ... should be [2] and [3]?

thaytan commented 2 years ago

Well spotted!