"Quaternion is required" error when running a time-dynamic ellipsoid from czml

I’ve been having this error pop up when trying to create a time-dynamic ellipsoid in czml. I’ll include the czml source. The file works as expected between the two position points, but when it reaches the end of the data this quaternion error appears. Both position and orientation are available for the same length’s of time, so I’m not sure why it seems like Cesium is trying to continue reading positions when they should have stopped existing.

I’ve been doing the same thing with agi_rectangularsenors and there hasn’t been any problems with them.

The javascript error that appears in the console is:

uncaught exception: DeveloperError: quaternion is required
DeveloperError@http://localhost:8080/Source/Core/DeveloperError.js:43:19
Matrix3.fromQuaternion@http://localhost:8080/Source/Core/Matrix3.js:188:1
DynamicGeometryUpdater.prototype.update@http://localhost:8080/Source/DataSources/EllipsoidGeometryUpdater.js:568:26
DynamicGeometryBatch.prototype.update@http://localhost:8080/Source/DataSources/GeometryVisualizer.js:45:13
GeometryVisualizer.prototype.update@http://localhost:8080/Source/DataSources/GeometryVisualizer.js:206:21
DataSourceDisplay.prototype.update@http://localhost:8080/Source/DataSources/DataSourceDisplay.js:193:26
Viewer/<@http://localhost:8080/Source/Widgets/Viewer/Viewer.js:253:29
Event.prototype.raiseEvent@http://localhost:8080/Source/Core/Event.js:146:17
Clock.prototype.tick@http://localhost:8080/Source/Core/Clock.js:203:9
CesiumWidget.prototype.render@http://localhost:8080/Source/Widgets/CesiumWidget/CesiumWidget.js:586:27
render@http://localhost:8080/Source/Widgets/CesiumWidget/CesiumWidget.js:69:21

``

Thanks,
Chris

ellipsoid.czml (1.07 KB)

Thanks for the report Chris. This is or isn’t a bug depending on how you look at it.

1, Your test object does not specify availability, which indicates that the object is “always available”.

  1. Your ellipsoid has a constant value of show=true, which means the ellipsoid should always be visible.

  2. You only actually have a position and orientation for a limited timespan, once we go out of that timespace; the object becomes undefined, causing the error.

There are three ways to fix this on your end (any one of these will do the trick).

  1. Set an availability interval for your object so that all of your properties have data for that interval.

  2. Set your ellipsoid show to have an interval that matches the data.

  3. Set the extrapolation options on your position and quaternion properties so that they hold their first or last value when queried outside the bounds. (See the extrapolationType options in SampledProperty: http://cesiumjs.org/Cesium/Build/Documentation/SampledProperty.html ) The CZML properties share the same name and enum values.

The reason I say this may be a bug is because we will most likely change it so that if data is undefined when we need it (such as this case), we will simply hide the object rather than throw an exception (or use a default value if one is available). This is actually how most of the other CZML objects work right now (billboard, label, model, sensors, etc…) it’s only the shapes/volumes that need to be updated to match. Once we make this change, the current CZML would just cause the ellipsoid to disappear (which is probably what everyone expects anyway). I may get these changes into 1.5, but I can’t make any promises.

Thanks,

Matt

Setting an availability worked perfectly, thanks for the advice. I see what you mean with the bug/not-bug views since I never did explicitly specify the availability. I started my work using billboards and sensors, so the change in expectation did throw me off a bit. Thanks again for the help and I will keep an eye on the change-logs for when this gets updated.

Chris

Chris, I just opened this PR with the changes I mentioned: https://github.com/AnalyticalGraphicsInc/cesium/pull/2330

Using the CZML file you originally posted, the ellipsoid now simply disappears when outside of the data bounds, instead of crashing.