Skip to content

Commit 559b2b1

Browse files
DEV-12444 - Fix non assetized gridmap (#204)
1 parent 389095c commit 559b2b1

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

packages/data-sdk/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.77.0] - 2025-03-13
2+
3+
- Fix occupancy gridmap data fetching
4+
15
## [1.76.1] - 2025-02-25
26

37
- Republish

packages/data-sdk/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/data-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
}
2626
},
27-
"version": "1.76.1",
27+
"version": "1.77.0",
2828
"scripts": {
2929
"preversion": "npm run verify",
3030
"postversion": "make",

packages/data-sdk/src/connector/data/TelemetryUniverseData.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,17 +549,27 @@ export class TelemetryUniverseData
549549
}
550550

551551
const dp = this.getNearestPoint(d)[1] as ILocalization;
552-
if (dp.url) {
552+
if (dp.map) {
553+
// this means the localization object is not assetized
554+
const gridValue = {
555+
width: dp.map.width,
556+
height: dp.map.height,
557+
worldToLocal: dp.map.worldToLocal,
558+
resolution: dp.map.resolution,
559+
origin: dp.map.origin,
560+
url: dp.map.url,
561+
};
562+
mapDataCache[dp.map.url!] = JSON.parse(JSON.stringify(gridValue));
563+
callback(gridValue);
564+
} else if (dp.url) {
553565
if (mapDataCache[dp.url]) {
554566
callback(mapDataCache[dp.url]);
555567
return;
556568
}
557-
558569
dataFetchWorker.postMessage({ url: dp.url });
559570

560571
dataFetchWorker.onmessage = async (ev: MessageEvent) => {
561572
const latestLocalization = ev.data.response.map;
562-
563573
if (latestLocalization) {
564574
const gridValue = {
565575
width: latestLocalization.width,

0 commit comments

Comments
 (0)