xioTechnologies/Fusion

Ways to debug Fusion inputs/outputs?

Closed this issue · 2 comments

Sorry to open an Issue for this (maybe consider opening up Discussions on this repo?). I'm passing some IMU data through Fusion and seeing some weird behavior in the output. Specifically if I twist my glasses such that the "roll" is 90 degrees, the yaw/pitch data becomes wild. I know the default answer is "gimbal locking," but there are a couple other possibilities in my mind and I'm new to this kind of thing so I don't know where to start.

  1. an issue with the glasses sensors?
  2. a bug in Fusion or my usage? e.g. a misapplication of gravity/accel readings when the direction of gravity has changed?
  3. just run-of-the-mill gimbal locking issues

How would I go about evaluating each of the above? I would also love to use quaternion values for what I'm doing, but when putting them in a rotation matrix and applying them the initial results were gibberish, so that again brings me back to "am I using the data and Fusion right?" or "is it an issue with my sensors?"

One thing I noticed is that when passing the IMU data through Fusion->quat->euler, transformation I have to grab the euler.angle.roll value for pitch, and euler.angle.pitch value for roll, which seems odd and makes me question my application of the library. Any help for any of the above would be appreciated!

Fusion assigns roll as a rotation around the x-axis, and pitch as a rotation around the y-axis. Other libraries may switch these. If you Google image search pitch roll yaw then the results suggest a 50/50 split with perhaps a slight favour for the convention used by Fusion.

The best way of validating your measurement of a 3D orientation is to view it in 3D, in real-time. That way you can move the physical object and confirm the on-screen image moves as expected.

I suggest you use the x-IMU3 GUI and modify your hardware to send either Quaternion, Rotation matrix, or Euler Angles messages as shown below. These examples are taken from the user manual.

image
image
image

You only need to stream one of these messages continuously by either USB, serial, TCP, or UDP and you can view your measurements in real-time using the x-IMU3 GUI as shown below. No handshaking or other message types required. You can also load your own custom 3D model.

image

Thanks!