julwil / ccs4dt

The Cloud Correlation Service for Data Tracking (CCS4DT)
https://julwil.github.io/ccs4dt/index.html
0 stars 0 forks source link

Object mapping in API output incorrect #37

Closed mtornow closed 2 years ago

mtornow commented 2 years ago

Current behavior:

API request sent with object identifiers all in simple 5 digit int format (e.g. 39712) API output contains object mapping that only maps object identifier and sensor identifier without any separating characters

Expected behavior: Option 1 (preferred): Include sensor as separate object, e.g. Current implementation: **"object_identifier_mappings": { "952ab5a4-b0ed-4e7b-8447-a8380cf01f42": [{ "392226b251d89-8e6c-4280-845c-c70a8bcdf475", "37957ba334d0e-4593-45ff-b82e-3b96249db901", "392020995260d-1af0-43f0-bf78-44a6e47f7e65" } ],

Target implementation: ... "object_identifier_mappings": { "952ab5a4-b0ed-4e7b-8447-a8380cf01f42": { "6b251d89-8e6c-4280-845c-c70a8bcdf475": [ "39222" ], "ba334d0e-4593-45ff-b82e-3b96249db901": [ "37957" ], "6b251d89-8e6c-4280-845c-c70a8bcdf475": [ "39222" ], "0995260d-1af0-43f0-bf78-44a6e47f7e65": [ "39202" ], },...

Option 2: Object mapping contains original supplied object_identifiers separated by specific character sequence (e.g. "39222///6b251d89-8e6c-4280-845c-c70a8bcdf475" instead of "392226b251d89-8e6c-4280-845c-c70a8bcdf475)

Example:

Input: [ { "object_identifier": "39222", "x": 135, "y": 283, "z": -4, "sensor_type": "RFID", "sensor_identifier": "ba334d0e-4593-45ff-b82e-3b96249db901", "timestamp": 1559376000183 }, { "object_identifier": "37957", "x": 273, "y": 231, "z": -6, "sensor_type": "RFID", "sensor_identifier": "ba334d0e-4593-45ff-b82e-3b96249db901", "timestamp": 1559376001493 }, { "object_identifier": "39202", "x": 335, "y": 101, "z": -14, "sensor_type": "RFID", "sensor_identifier": "ba334d0e-4593-45ff-b82e-3b96249db901", "timestamp": 1559376003493 }, { "object_identifier": "39202", "x": 383, "y": 136, "z": 6, "sensor_type": "RFID", "sensor_identifier": "ba334d0e-4593-45ff-b82e-3b96249db901", "timestamp": 1559376005984 }, { "object_identifier": "39202", "x": 377, "y": 131, "z": -3, "sensor_type": "RFID", "sensor_identifier": "ba334d0e-4593-45ff-b82e-3b96249db901", "timestamp": 1559376006490 }, { "object_identifier": "37957", "x": 238, "y": 222, "z": -18, "sensor_type": "RFID", "sensor_identifier": "ba334d0e-4593-45ff-b82e-3b96249db901", "timestamp": 1559376007998 }, { "object_identifier": "39222", "x": 116.7440062284, "y": 276.8758878242, "z": 4.5816163437, "sensor_type": "WiFi 2.4GHz", "sensor_identifier": "6b251d89-8e6c-4280-845c-c70a8bcdf475", "timestamp": 1559376001186 }, { "object_identifier": "39202", "x": 358, "y": 120, "z": 2, "sensor_type": "camera", "sensor_identifier": "0995260d-1af0-43f0-bf78-44a6e47f7e65", "timestamp": 1559376001186 }]

Output (manually fixed issue related to bug #31 here):

{ "input_batch_id": 159, "location_id": 122, "object_identifier_mappings": { "952ab5a4-b0ed-4e7b-8447-a8380cf01f42": [ "392226b251d89-8e6c-4280-845c-c70a8bcdf475", "37957ba334d0e-4593-45ff-b82e-3b96249db901", "392020995260d-1af0-43f0-bf78-44a6e47f7e65" ], "828605b3-cf12-4707-84dc-5118e33c4165": [ "39202ba334d0e-4593-45ff-b82e-3b96249db901" ], "fe41ec18-cc58-4d8c-8da4-42a050639cd8": [ "39222ba334d0e-4593-45ff-b82e-3b96249db901" ] }, "positions": [ { "object_identifier": "828605b3-cf12-4707-84dc-5118e33c4165", "confidence": 1, "timestamp": 1559376006000, "x": 388.1459152032023, "y": 133.19277982934898, "z": 32.78816100649938 }, { "object_identifier": "952ab5a4-b0ed-4e7b-8447-a8380cf01f42", "confidence": 1, "timestamp": 1559376008000, "x": 243.95018218698942, "y": 220.7169466717965, "z": 9.840950865380046 }, { "object_identifier": "fe41ec18-cc58-4d8c-8da4-42a050639cd8", "confidence": 1, "timestamp": 1559376000000, "x": 140.36806575211685, "y": 280.5896521185067, "z": 24.452662945839744 } ] }

mtornow commented 2 years ago

Corrected issue description

mtornow commented 2 years ago

Predicted vs true position (calculation)

julwil commented 2 years ago

@mtornow Should be done by adding a separating token between object_id and sensor_id. Done in #39