Hello all. I'm having trouble converting quaternion angles to euler angles. The sensor I'm using can be found here. In the FAQ section of that link they mention, "For absolute orientation, quaternions should always be used, and they can be converted to Euler angles at the last moment via the .toEuler() helper function in quaternion.h", however, they don't provide any examples for doing this.

I'm not sure how to use the .toEuler() helper function. Can someone point me in the right direction for how to use this function?

I've attached my sketch this post. It's basically an example that came with the IMU I'm using.

You don't need to convert the quaternion to Euler angles. You can simply read the Euler angles out of the BNO055. This is already in your code, but you commented out the print statements.

You might spend a few minutes glancing through the code and the documentation, before posting.

jremington:
You don't need to convert the quaternion to Euler angles. You can simply read the Euler angles out of the BNO055. This is already in your code, but you commented out the print statements.

You might spend a few minutes glancing through the code and the documentation, before posting.

It's disappointing when you ask a question on a site that is supposed to facilitate learning and you get an insulting response. You assume that I didn't notice that you can pull raw Euler data from the sensor. I am well aware of this. After all, I commented it out.

It is my understanding that Quaternion data is more accurate than Euler data and, as the quote I posted from the FAQ mentions, I am interested in absolute orientation which, again, as the FAQ mentions, should always be done with Quaternions.

Euler angles come with limitations in which the angles are not always continuous for all situations. By pulling Quaternion data first and then converting them to Euler angles, I should be able to remedy this. That is my goal and also the reason why I asked how to implement the .toEuler helper function.

In the future, don't assume that people are completely oblivious.

Hi, jremington,
you seem to be knowlegeable on this subject, could you give me a hint on how to impement Adafruit library quaternion.h ? I think this library has everything to use quaternions and turn those into angles for a stable navigation.
truely appreciate,
Johannes

What do you want to do with the library? It is just a collection of basic mathematical operations.

In general, "stable navigation" can't be done using an angular representation of absolute orientation, because of gimbal lock or related problems. That is why everyone uses a quaternion for that purpose.