Heading/Pitch/Roll to Quaternions... ... and back

Here’s yet another from me!

This relates to an aircraft - I use local heading, pitch and roll and convert it into a quaternion using the transform ‘headingPitchRollQuaternion’. The attitude of the aircraft is spot-on.

center = Cesium.Cartesian3.fromDegrees(-0.2080299, 51.1473961, 210.00);

``

A a later point I then use the transform ‘Cesium.HeadingPitchRoll.fromQuaternion’ to extract the headingPitchRoll from the quaternion and finally the toString() method to put heading, pitch and roll into a string.

The values in the string appear to be earth-oriented (e.g., affected by the lat/lon) rather than the local heading, pitch and roll. When the nose of the aircraft is [locally] vertical, the pitch is 0.89 radians or 51.1° : the same as the latitude.

I’m obviously missing a transform but can’t find one that is the direct inverse of ‘Cesium.Transforms.headingPitchRollQuaternion’?

Thanks,

Hugh

Here's yet another from me!

This relates to an aircraft - I use local heading, pitch and roll and
convert it into a quaternion using the transform
'headingPitchRollQuaternion'. The attitude of the aircraft is spot-on.

center = Cesium.Cartesian3.fromDegrees(-0.2080299, 51.1473961, 210.00);

A a later point I then use the transform 'Cesium.HeadingPitchRoll.
fromQuaternion
from the quaternion and finally the toString()
method to put heading, pitch and roll into a string.

The values in the string appear to be earth-oriented (e.g., affected by
the lat/lon) rather than the local heading, pitch and roll. When the nose
of the aircraft is [locally] vertical, the pitch is 0.89 radians or 51.1° :
the same as the latitude.

I'm obviously missing a transform but can't find one that is the direct

Thanks,

Hugh

--
You received this message because you are subscribed to a topic in the