Reading the IMU over PTPy: scale factor

#1

Hello,

We’re able to read IMU values from the Sequoia with the following snippet, but don’t know the units of the values that are returned. Anyone know the units? Thanks in advance:

import ptpy
if __name__ == '__main__':
    cam=ptpy.PTPy()
    ypr = cam.get_angle_values()
   print("ypr: {}, {}, {}".format(ypr.Yaw, ypr.Pitch, ypr.Roll))

The numbers returned look like this, with the camera on its side, looking horizontally:
ypr: 79285168, 4209374032, 4127922368

#2

Thought I’d check in again: anyone? The datatype is self._UInt32, but I can’t seem to figure out how to scale the return values.

#3

Hello,

Sorry for this late reply.

The get_angle_values() should return the yaw, pitch, roll angles in micro degrees in the [-180e6, +180e6] range. The datatype should be Int32 and not UInt32. (This is not my particular domain of expertise but it seems to be a bug in the ptpy module).

In your case, it seems you have an uint32 underflow issue for the pitch and roll values so you have to take this into account before scaling to decimal degrees:

ypr: 79285168, 4209374032, 4127922368
ypr: 79285168/1e6, -(2**32-(4209374032))/1e6, -(2**32-(4127922368))/1e6
ypr: 79.285168°, -85.593264°, -167.044928°

Regards,

Nicolas

#4

Ah!, microdegrees!! Thanks a ton, Nicolas.

Rick