autodesk-forgeautodesk-data-visualization

Assistance with having multiple sensor types in APS DataViz Extensions Demo


We are building an application upon "APS DataViz Extensions Demo" and we've run into a problem for having different sensor types in one room, as shown in "original_heatmap.PNG". In summary, we have two sensor types: 1. ENV sensors including Temperature, CO2, and Humidity channels information, and 2: PPL sensors including PplCounter channel.information only. The current SensorHeatMap extension returns 0.00 for sensor values that do not have information for a specific chosen channel, as shown in "original_heatmap.PNG", in which, PPL sensor is showing 0.00 on the heatmap in case the Temperature channel is selected. Following, the documentation for "renderSurfaceShading(nodeIds, sensorType, valueCallback, options)" and "SensorValueCallback" we changed the return value to NaN so that "the sensor will have no influence in the resulting heatmap color (it is as though the sensor did not exist).". However, we are receiving 0.00 across all of our sensors in all of the selected channels, as shown in "NaN_heatmap.PNG". As a result, we'd appreciate any help and assistance for dealing with this problem. Also, other tips for incorporating multiple sensor types in one model is much appreciated. Original code for dataviz heatmap Heatmap after returning NaN in SensorHeatmapExtension


Solution

  • Thank you for the heads up. I've updated the SensorHeatmapsExtension so that when no sensor data is available, Number.NaN is returned: https://github.com/autodesk-platform-services/aps-iot-extensions-demo/commit/b3e9018f603fecf57601d8c17d2610d62aef23d9.

    After this update, the heatmaps are behaving as expected, i.e., sensors that don't have relevant data are not contributing to the heatmap in any way.

    EDIT: in case you actually need your sensor data to "fall off faster", you'll need to tweak the heatmapConfig.confidence value. I've made another update to the SensorHeatmapsExtension to indicate the possible settings: https://github.com/autodesk-platform-services/aps-iot-extensions-demo/commit/ed64c238fa5e6330743235b3e08fcecac8bcb42d.