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);
hdg.addSample(Cesium.JulianDate.fromIso8601(‘2012-08-04T13:16:07Z’), Cesium.Transforms.headingPitchRollQuaternion(center, Cesium.HeadingPitchRoll.fromDegrees(166.2, -0.9, 0.2)));
``
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’?
Quaternions make my head hurt!
Thanks,
Hugh