Cesium Position returning NaN when calculating orientation in Cesium.VelocityOrientationProperty

I am using a Cesium.VelocityOrientationProperty for my entities that have a couple thousand Lat/Lon points to appropriately handle orientation. When generating a new path and importing it this morning, I received the error below.

An error occurred while rendering. Rendering has stopped.
undefined
DeveloperError: normalized result is not a number
DeveloperError@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:1327:19
Cartesian3.normalize@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:3153:19
VelocityVectorProperty.prototype._getValue@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:105112:20
VelocityOrientationProperty.prototype.getValue@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:134533:24
Property.getValueOrUndefined@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:65391:36
Entity.prototype._getModelMatrix@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:87451:27
ModelVisualizer.prototype.update@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:118168:31
DataSourceDisplay.prototype.update@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:125661:22
Viewer.prototype._onTick@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:184233:25
Event.prototype.raiseEvent@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:4952:17
Clock.prototype.tick@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:39424:9
CesiumWidget.prototype.render@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:178405:31
render@http://localhost:8080/impact/assets/3rd-party/cesium-1.3-unminified/Cesium.js:177802:25

This seems to trace to entity.position having NaN values for X,Y,Z when the position is retrieved. The first couple hundred points in the path work fine. I was able to safeguard against this when I’m manually calling entity.position.getValue(viewer.clock.currentTime), but the error seems to happen within Cesium.

Has anyone else experienced this? I did not find a workaround searching the forum.

Hello,

I’m guessing this is happening because the velocity is 0 at some point. To you have a short code example that will reproduce the crash?

Best,

Hannah

I do not have one on hand, but I can try to reproduce the problem in sandcastle today. We are consuming and sending “real-time” data to cesium (5 second delay on data to build up enough data-points for interpolation). It appears to be happening at the same time value in our application.

Attaching a picture with the Interpolation path visible. If we have datapoints in the future and the Cesium clock has not been altered, what ways can the velocity be 0?

I should note that this path was about 1 second before the DeveloperError above occurs.