@aibee/crc-bmap 0.8.44 → 0.8.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bmap.cjs.min.js +408 -401
- package/lib/bmap.esm.js +7644 -1526
- package/lib/bmap.esm.min.js +408 -401
- package/lib/bmap.min.js +408 -401
- package/lib/src/bmap.js +60 -54
- package/lib/src/context/OrbitControls.js +4 -1
- package/lib/src/context/context.js +54 -37
- package/lib/src/context/control.js +85 -83
- package/lib/src/context/scene.js +1 -0
- package/lib/src/elements/base-svg.js +5 -4
- package/lib/src/elements/floor.js +8 -0
- package/lib/src/elements/glb-model.js +14 -18
- package/lib/src/elements/graphic.js +18 -8
- package/lib/src/elements/ground-texture.js +41 -44
- package/lib/src/elements/heatmap.js +2 -1
- package/lib/src/elements/lane.js +5 -1
- package/lib/src/elements/merge-graphic.js +3 -28
- package/lib/src/elements/model.js +5 -9
- package/lib/src/elements/overlay.js +9 -7
- package/lib/src/elements/poi.js +55 -49
- package/lib/src/elements/poi2.js +52 -53
- package/lib/src/elements/shadow.js +3 -1
- package/lib/src/elements/svg-line.js +2 -0
- package/lib/src/elements/svg-polygon.js +1 -0
- package/lib/src/elements/text-texture.js +32 -36
- package/lib/src/elements/wall.js +3 -41
- package/lib/src/external/meshLine.js +17 -0
- package/lib/src/factory/img-texture.js +1 -0
- package/lib/src/factory/material.js +21 -51
- package/lib/src/factory/model.js +31 -33
- package/lib/src/factory/text-texture.js +17 -0
- package/lib/src/factory/unique-key.js +8 -0
- package/lib/src/layer/graphic-layer.js +1 -0
- package/lib/src/layer/parking-layer.d.ts +6 -0
- package/lib/src/layer/parking-layer.js +8 -0
- package/lib/src/layer/poi-layer.js +4 -1
- package/lib/src/layer/poi-layer2.js +2 -0
- package/lib/src/loader/AibeeLoader/index.js +230 -276
- package/lib/src/loader/AibeeLoader/layer.js +8 -6
- package/lib/src/loader/CrLoader/api/floor.js +45 -73
- package/lib/src/loader/CrLoader/index.js +88 -106
- package/lib/src/operations/hover/hover-helper.js +12 -2
- package/lib/src/operations/selection/selection.js +11 -1
- package/lib/src/plugins/car-inertial-position/car-inertial-position.d.ts +42 -10
- package/lib/src/plugins/car-inertial-position/car-inertial-position.js +285 -67
- package/lib/src/plugins/car-inertial-position/compass.d.ts +4 -5
- package/lib/src/plugins/car-inertial-position/compass.js +43 -38
- package/lib/src/plugins/car-inertial-position/kalman-filter.d.ts +14 -0
- package/lib/src/plugins/car-inertial-position/kalman-filter.js +30 -0
- package/lib/src/plugins/car-inertial-position/utils.d.ts +1 -1
- package/lib/src/plugins/car-inertial-position/utils.js +8 -5
- package/lib/src/plugins/cr-nav-path/cr-nav-path.js +47 -55
- package/lib/src/plugins/cr-nav-path/cr-path.worker.js +4 -2
- package/lib/src/plugins/equipment/equipment.js +20 -22
- package/lib/src/plugins/mul-floor-navigation/mul-floor-navigation.js +63 -61
- package/lib/src/plugins/mul-floor-navigation/path.js +34 -30
- package/lib/src/plugins/mul-floor-navigation/start-model.js +2 -1
- package/lib/src/plugins/mul-floor-select/mul-floor-select.js +2 -1
- package/lib/src/plugins/mul-floors/mul-floors.js +1 -0
- package/lib/src/plugins/nav-path/nav-path.js +51 -59
- package/lib/src/plugins/nav-path/path.worker.js +4 -2
- package/lib/src/plugins/navigation/navigation.d.ts +5 -0
- package/lib/src/plugins/navigation/navigation.js +240 -217
- package/lib/src/plugins/navigation/path.js +34 -30
- package/lib/src/plugins/navigation/position-navigation.d.ts +4 -0
- package/lib/src/plugins/navigation/position-navigation.js +96 -79
- package/lib/src/plugins/navigation/start-rotate-helper-poi.js +18 -6
- package/lib/src/plugins/pdr-position/imu-position.js +13 -9
- package/lib/src/plugins/pdr-position/particle.js +4 -2
- package/lib/src/plugins/pdr-position/pdr.js +5 -4
- package/lib/src/plugins/pdr-position/position.js +5 -2
- package/lib/src/plugins/pdr-position/sensor.js +20 -25
- package/lib/src/plugins/select/select.js +11 -1
- package/lib/src/utils/camera-bound.js +3 -1
- package/lib/src/utils/color.js +8 -4
- package/lib/src/utils/coordinate.js +1 -0
- package/lib/src/utils/create.js +4 -2
- package/lib/src/utils/events.js +15 -4
- package/lib/src/utils/index-db.js +18 -11
- package/lib/src/utils/init-helper.js +7 -2
- package/lib/src/utils/obj-utils.js +3 -2
- package/lib/src/utils/os.js +1 -0
- package/lib/src/utils/path.js +15 -4
- package/lib/src/utils/promise.js +3 -1
- package/lib/src/utils/proxy.js +2 -1
- package/lib/src/utils/road.js +20 -14
- package/lib/src/utils/road2.js +60 -39
- package/lib/src/utils/rules.js +1 -0
- package/lib/src/utils/string.js +3 -1
- package/lib/src/utils/svg.js +12 -11
- package/lib/src/utils/taskQueue.js +29 -29
- package/lib/src/utils/timer.js +8 -1
- package/lib/src/utils/translate.js +3 -1
- package/lib/src/utils/tween.js +8 -0
- package/lib/src/utils/webworker.js +10 -9
- package/package.json +2 -1
|
@@ -1,95 +1,67 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
1
|
/**
|
|
3
2
|
* 请求楼栋地面
|
|
4
|
-
*/ export function loadBuildingGround(
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (data) {
|
|
14
|
-
data.info = JSON.parse(data.info);
|
|
15
|
-
}
|
|
16
|
-
return data;
|
|
17
|
-
});
|
|
3
|
+
*/ export async function loadBuildingGround(param, config) {
|
|
4
|
+
let { brand, project } = param;
|
|
5
|
+
const { apiDomain, apiPath: { floorRange }, apiInfo } = config;
|
|
6
|
+
const url = "" + apiDomain + floorRange + "?brand=" + brand + "&project=" + project + "&phase=" + project + "&building=" + project;
|
|
7
|
+
const data = await fetch(url, apiInfo).then((res)=>res.json()).then((res)=>res.data).then((res)=>{
|
|
8
|
+
const data = (res || [])[0];
|
|
9
|
+
if (data) {
|
|
10
|
+
data.info = JSON.parse(data.info);
|
|
11
|
+
}
|
|
18
12
|
return data;
|
|
19
13
|
});
|
|
20
|
-
return
|
|
14
|
+
return data;
|
|
21
15
|
}
|
|
22
16
|
/**
|
|
23
17
|
* 加载图元
|
|
24
18
|
* @param param0
|
|
25
19
|
* @param config
|
|
26
20
|
* @returns
|
|
27
|
-
*/ export function loadGraphics(
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const data = yield fetch(url, apiInfo).then((res)=>res.json()).then((res)=>res.data).then((res)=>{
|
|
35
|
-
(res || []).map((item)=>item.info = JSON.parse(item.info));
|
|
36
|
-
return res || [];
|
|
37
|
-
});
|
|
38
|
-
return data;
|
|
21
|
+
*/ export async function loadGraphics(param, config) {
|
|
22
|
+
let { brand, project, floor, ts, resource_type_list } = param;
|
|
23
|
+
const { apiDomain, apiPath: { floorGraphic }, apiInfo } = config;
|
|
24
|
+
const url = "" + apiDomain + floorGraphic + "?brand=" + brand + "&project=" + project + "&phase=" + project + "&building=" + project + "&floor=" + floor + "&ts=" + ts + "&resource_type_list=" + resource_type_list;
|
|
25
|
+
const data = await fetch(url, apiInfo).then((res)=>res.json()).then((res)=>res.data).then((res)=>{
|
|
26
|
+
(res || []).map((item)=>item.info = JSON.parse(item.info));
|
|
27
|
+
return res || [];
|
|
39
28
|
});
|
|
40
|
-
return
|
|
29
|
+
return data;
|
|
41
30
|
}
|
|
42
31
|
/**
|
|
43
32
|
* 加载外部街道
|
|
44
33
|
* @param param0
|
|
45
34
|
* @param config
|
|
46
35
|
* @returns
|
|
47
|
-
*/ export function loadExternalStreet(
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} else {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return data;
|
|
62
|
-
});
|
|
63
|
-
return _loadExternalStreet.apply(this, arguments);
|
|
64
|
-
}
|
|
65
|
-
function downloadFileToBlob(fileId, config) {
|
|
66
|
-
return _downloadFileToBlob.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
function _downloadFileToBlob() {
|
|
69
|
-
_downloadFileToBlob = _async_to_generator(function*(fileId, config) {
|
|
70
|
-
const { apiDomain, apiInfo } = config;
|
|
71
|
-
return fetch(`${apiDomain}/api/inception-map/file/getFileStream?fileId=${fileId}`, apiInfo).then((res)=>res.blob());
|
|
36
|
+
*/ export async function loadExternalStreet(param, config) {
|
|
37
|
+
let { project, floor } = param;
|
|
38
|
+
const { apiDomain, apiInfo } = config;
|
|
39
|
+
const url = apiDomain + "/api/inception-map/external_street/get?projectCode=" + project + "&floorCode=" + floor;
|
|
40
|
+
const data = await fetch(url, apiInfo).then((res)=>res.json()).then((res)=>res.data).then((res)=>JSON.parse(res[0].streetInfo || "{}")).then((res)=>{
|
|
41
|
+
if (res.fileId) {
|
|
42
|
+
return downloadFileToJson(res.fileId, config);
|
|
43
|
+
} else {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
72
46
|
});
|
|
73
|
-
return
|
|
47
|
+
return data;
|
|
74
48
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
49
|
+
async function downloadFileToBlob(fileId, config) {
|
|
50
|
+
const { apiDomain, apiInfo } = config;
|
|
51
|
+
return fetch(apiDomain + "/api/inception-map/file/getFileStream?fileId=" + fileId, apiInfo).then((res)=>res.blob());
|
|
77
52
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
});
|
|
53
|
+
async function downloadFileToJson(fileId, config) {
|
|
54
|
+
const { apiDomain, apiInfo } = config;
|
|
55
|
+
return fetch(apiDomain + "/api/inception-map/file/getFileStream?fileId=" + fileId, apiInfo).then((res)=>res.arrayBuffer()).then((arrayBuffer)=>{
|
|
56
|
+
// 将 ArrayBuffer 转换为字符串
|
|
57
|
+
const decoder = new TextDecoder('utf-8');
|
|
58
|
+
const text = decoder.decode(arrayBuffer);
|
|
59
|
+
// 将字符串解析为 JSON
|
|
60
|
+
if (text) {
|
|
61
|
+
const jsonData = JSON.parse(text);
|
|
62
|
+
return jsonData;
|
|
63
|
+
} else {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
93
66
|
});
|
|
94
|
-
return _downloadFileToJson.apply(this, arguments);
|
|
95
67
|
}
|
|
@@ -1,48 +1,43 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
1
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
3
|
import { loadBuildingGround, loadGraphics } from "./api";
|
|
4
4
|
import { Floor } from "../../elements";
|
|
5
5
|
import { generatorKeyByObj, HooksName, transformGraphicData } from "../../utils";
|
|
6
6
|
export class CrLoader {
|
|
7
|
-
load(query) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_this.loadExternalStreet(query);
|
|
28
|
-
return data;
|
|
29
|
-
})();
|
|
7
|
+
async load(query) {
|
|
8
|
+
const cacheKey = generatorKeyByObj(query);
|
|
9
|
+
if (this.cacheData.has(cacheKey)) {
|
|
10
|
+
return this.cacheData.get(cacheKey);
|
|
11
|
+
}
|
|
12
|
+
const [, data] = await Promise.all([
|
|
13
|
+
this.loadBuildGround(query),
|
|
14
|
+
loadGraphics(query, this.bmap.config)
|
|
15
|
+
]);
|
|
16
|
+
const lenKey = generatorKeyByObj({
|
|
17
|
+
floor: query.floor,
|
|
18
|
+
ts: query.ts
|
|
19
|
+
});
|
|
20
|
+
transformGraphicData(data.map((item)=>item.info), this.bmap.buildingCenter, this.floorDataLengthMap.get(lenKey) || 0);
|
|
21
|
+
data.forEach((item)=>item.info.transformToBuildingGround = false);
|
|
22
|
+
this.cacheData.set(cacheKey, data);
|
|
23
|
+
const len = this.floorDataLengthMap.get(lenKey) || 0;
|
|
24
|
+
this.floorDataLengthMap.set(lenKey, len + data.length);
|
|
25
|
+
this.loadExternalStreet(query);
|
|
26
|
+
return data;
|
|
30
27
|
}
|
|
31
28
|
/**
|
|
32
29
|
* 加载外部街道
|
|
33
|
-
*/ loadExternalStreet(query) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// }
|
|
45
|
-
})();
|
|
30
|
+
*/ async loadExternalStreet(query) {
|
|
31
|
+
// const key = `project=${query.project}&floor=${query.floor}`
|
|
32
|
+
// if (this.externalStreetMap.has(key)) {
|
|
33
|
+
// return this.externalStreetMap.get(key)!
|
|
34
|
+
// } else {
|
|
35
|
+
// const res = await loadExternalStreet({ project: query.project, floor: query.floor }, this.bmap.config)
|
|
36
|
+
// if (res) {
|
|
37
|
+
// // TODO
|
|
38
|
+
// }
|
|
39
|
+
// console.log(res)
|
|
40
|
+
// }
|
|
46
41
|
}
|
|
47
42
|
switchFloorByData(data, floor) {
|
|
48
43
|
if (!data.length) {
|
|
@@ -110,79 +105,66 @@ export class CrLoader {
|
|
|
110
105
|
const graphicMap = floor.userData.graphicMap || new Map();
|
|
111
106
|
return data.filter((graphic)=>!graphicMap.has(graphic.element_uuid));
|
|
112
107
|
}
|
|
113
|
-
switchFloorByStoreData(query, floor) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const filterData = _this.filterData(storeData, floor);
|
|
120
|
-
_this.switchFloorByData(filterData, floor);
|
|
121
|
-
})();
|
|
108
|
+
async switchFloorByStoreData(query, floor) {
|
|
109
|
+
const storeData = await this.load(_extends({}, query, {
|
|
110
|
+
resource_type_list: "6"
|
|
111
|
+
}));
|
|
112
|
+
const filterData = this.filterData(storeData, floor);
|
|
113
|
+
this.switchFloorByData(filterData, floor);
|
|
122
114
|
}
|
|
123
|
-
switchFloorByOtherData(query, floor) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const filterData = _this.filterData(otherData, floor);
|
|
130
|
-
_this.switchFloorByData(filterData, floor);
|
|
131
|
-
})();
|
|
115
|
+
async switchFloorByOtherData(query, floor) {
|
|
116
|
+
const otherData = await this.load(_extends({}, query, {
|
|
117
|
+
resource_type_list: "1,2,3,4"
|
|
118
|
+
}));
|
|
119
|
+
const filterData = this.filterData(otherData, floor);
|
|
120
|
+
this.switchFloorByData(filterData, floor);
|
|
132
121
|
}
|
|
133
|
-
loadBuildGround(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return _this.bmap.currentBuildGround;
|
|
146
|
-
})();
|
|
122
|
+
async loadBuildGround(param) {
|
|
123
|
+
let { brand, project } = param;
|
|
124
|
+
const data = await this.loadBuildingGround({
|
|
125
|
+
brand,
|
|
126
|
+
project
|
|
127
|
+
});
|
|
128
|
+
this.bmap.currentBuildGround = data;
|
|
129
|
+
this.bmap.changeBuildingCenter(data, {
|
|
130
|
+
brand,
|
|
131
|
+
project
|
|
132
|
+
});
|
|
133
|
+
return this.bmap.currentBuildGround;
|
|
147
134
|
}
|
|
148
|
-
loadBuildingGround(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return promise;
|
|
168
|
-
})();
|
|
135
|
+
async loadBuildingGround(param) {
|
|
136
|
+
let { brand, project } = param;
|
|
137
|
+
const key = generatorKeyByObj({
|
|
138
|
+
brand,
|
|
139
|
+
project
|
|
140
|
+
});
|
|
141
|
+
if (this.buildingGroundMap.has(key)) {
|
|
142
|
+
const data = this.buildingGroundMap.get(key);
|
|
143
|
+
return data;
|
|
144
|
+
}
|
|
145
|
+
const promise = loadBuildingGround({
|
|
146
|
+
brand,
|
|
147
|
+
project
|
|
148
|
+
}, this.bmap.config).then((data)=>{
|
|
149
|
+
this.buildingGroundMap.set(key, data);
|
|
150
|
+
return data;
|
|
151
|
+
});
|
|
152
|
+
this.buildingGroundMap.set(key, promise);
|
|
153
|
+
return promise;
|
|
169
154
|
}
|
|
170
|
-
switchFloor(query) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
return floor;
|
|
185
|
-
})();
|
|
155
|
+
async switchFloor(query) {
|
|
156
|
+
const floor = new Floor(this.bmap.context);
|
|
157
|
+
floor.userData.graphicMap = new Map();
|
|
158
|
+
floor.name = query.floor;
|
|
159
|
+
try {
|
|
160
|
+
await Promise.all([
|
|
161
|
+
this.switchFloorByStoreData(query, floor),
|
|
162
|
+
this.switchFloorByOtherData(query, floor)
|
|
163
|
+
]);
|
|
164
|
+
} catch (e) {
|
|
165
|
+
console.log(e);
|
|
166
|
+
}
|
|
167
|
+
return floor;
|
|
186
168
|
}
|
|
187
169
|
dispose() {
|
|
188
170
|
this.cacheData.clear();
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import "core-js/modules/es.set.difference.v2.js";
|
|
2
|
+
import "core-js/modules/es.set.intersection.v2.js";
|
|
3
|
+
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
|
4
|
+
import "core-js/modules/es.set.is-subset-of.v2.js";
|
|
5
|
+
import "core-js/modules/es.set.is-superset-of.v2.js";
|
|
6
|
+
import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
7
|
+
import "core-js/modules/es.set.union.v2.js";
|
|
8
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
1
9
|
import { Poi, Poi2 } from "../../elements";
|
|
2
10
|
import { EventDispatcher, Vector2 } from "three";
|
|
3
11
|
import { Timer } from "../../utils";
|
|
4
12
|
export class HoverHelper extends EventDispatcher {
|
|
5
|
-
handleHoverGraphicsChange(graphics
|
|
13
|
+
handleHoverGraphicsChange(graphics) {
|
|
14
|
+
if (graphics === void 0) graphics = this.curGraphics;
|
|
6
15
|
this.dispatchEvent({
|
|
7
16
|
type: 'hover-change',
|
|
8
17
|
graphics: Array.from(graphics)
|
|
@@ -25,7 +34,8 @@ export class HoverHelper extends EventDispatcher {
|
|
|
25
34
|
this.timer.dispose();
|
|
26
35
|
}
|
|
27
36
|
constructor(context){
|
|
28
|
-
super(), this.context = context, this.curGraphics = new Set(), this.timer = new Timer(), this.graphicTimerMap = new Map(), this.onPointerMove = (
|
|
37
|
+
super(), this.context = context, this.curGraphics = new Set(), this.timer = new Timer(), this.graphicTimerMap = new Map(), this.onPointerMove = (param)=>{
|
|
38
|
+
let { graphics, pois, e } = param;
|
|
29
39
|
const poiGraphics = pois.map((item)=>{
|
|
30
40
|
var _this_context_currentFloor;
|
|
31
41
|
return (_this_context_currentFloor = this.context.currentFloor) == null ? void 0 : _this_context_currentFloor.graphicLayer.graphicMap.get(item.options.id);
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
+
import "core-js/modules/es.set.difference.v2.js";
|
|
3
|
+
import "core-js/modules/es.set.intersection.v2.js";
|
|
4
|
+
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
|
5
|
+
import "core-js/modules/es.set.is-subset-of.v2.js";
|
|
6
|
+
import "core-js/modules/es.set.is-superset-of.v2.js";
|
|
7
|
+
import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
8
|
+
import "core-js/modules/es.set.union.v2.js";
|
|
9
|
+
import "core-js/modules/es.array.push.js";
|
|
1
10
|
import { EventDispatcher } from "three";
|
|
2
11
|
import { BoxSelection } from "./box-selection";
|
|
3
12
|
import { isControl, isMac } from "../../utils";
|
|
@@ -108,7 +117,8 @@ export class Selection extends EventDispatcher {
|
|
|
108
117
|
if (isControl(e.key)) {
|
|
109
118
|
this.disableBoxSelection();
|
|
110
119
|
}
|
|
111
|
-
}, this.onBoxSelected = (
|
|
120
|
+
}, this.onBoxSelected = (param)=>{
|
|
121
|
+
let { list } = param;
|
|
112
122
|
this._list.clear();
|
|
113
123
|
list.forEach((item)=>{
|
|
114
124
|
this._list.add(item);
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 定位结果有三种:视觉定位结果、beacon定位结果、pdr定位结果
|
|
3
|
+
* 以 pdr 定位为主要流程,以视觉结果和beacon结果为校准,其中主视觉定位,beacon是在长期无视觉情况下才会采用的
|
|
4
|
+
* 以视觉定位结果计算角度、速度,通过卡尔曼滤波平滑速度和角度的变化
|
|
5
|
+
* 什么时候通过视觉、蓝牙校准pdr的结果???
|
|
6
|
+
*/
|
|
1
7
|
import { EventDispatcher } from "three";
|
|
2
|
-
import { Compass } from "./compass";
|
|
3
8
|
import { Timer } from "../../utils";
|
|
9
|
+
import { KalmanFilter } from "./kalman-filter";
|
|
4
10
|
export interface CarPosition {
|
|
5
11
|
position: [number, number];
|
|
6
12
|
time: number;
|
|
7
13
|
clientTime: number;
|
|
8
|
-
type: "vision" | "beacon";
|
|
14
|
+
type: "vision" | "beacon" | "pdr";
|
|
9
15
|
}
|
|
10
16
|
export interface CarPosInfo {
|
|
11
17
|
success: boolean;
|
|
@@ -14,25 +20,51 @@ export interface CarPosInfo {
|
|
|
14
20
|
speed: number;
|
|
15
21
|
}
|
|
16
22
|
interface CarInertialPositionEventMap {
|
|
17
|
-
|
|
23
|
+
"change-compass": {
|
|
18
24
|
value: number;
|
|
19
25
|
};
|
|
20
|
-
|
|
26
|
+
"change-position-compass": {
|
|
27
|
+
value: number;
|
|
28
|
+
};
|
|
29
|
+
"change-pos": {
|
|
21
30
|
value: CarPosInfo;
|
|
22
31
|
};
|
|
23
32
|
}
|
|
24
33
|
export declare class CarInertialPosition extends EventDispatcher<CarInertialPositionEventMap> {
|
|
25
34
|
history: CarPosition[];
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
visionHistory: CarPosition[];
|
|
36
|
+
speed: number;
|
|
37
|
+
angle: null | number;
|
|
28
38
|
timer: Timer;
|
|
29
39
|
positionTimer: number | null;
|
|
30
|
-
|
|
40
|
+
speedFilter: KalmanFilter;
|
|
41
|
+
visionExcessesCount: number;
|
|
42
|
+
beaconExcessesCount: number;
|
|
43
|
+
angleExcessesCount: number;
|
|
44
|
+
pathAngle: number;
|
|
31
45
|
constructor();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
setPathAngle(angle: number): void;
|
|
47
|
+
changeSpeed(): void;
|
|
48
|
+
changeAngle(histories?: CarPosition[]): void;
|
|
49
|
+
setAngle(angle: number, dispatch?: boolean): void;
|
|
50
|
+
/**
|
|
51
|
+
* 添加视觉结果
|
|
52
|
+
* @param position
|
|
53
|
+
* @param time
|
|
54
|
+
* @param duration
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
setPosition(position: CarPosition["position"], time: number, duration: number): void;
|
|
58
|
+
resetPdrPosition(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 获取 最后一个视觉坐标在加了pdr惯性的坐标
|
|
61
|
+
*/
|
|
62
|
+
getLastVisionPdrPos(): CarPosition | null;
|
|
63
|
+
private _setVisionHistoryForAngle;
|
|
64
|
+
addHistory(data: CarPosition): void;
|
|
65
|
+
setBeaconPosition(position: CarPosition["position"], time: number, duration: number): void;
|
|
35
66
|
startPositionTimer(): void;
|
|
67
|
+
changePosition(from?: string): void;
|
|
36
68
|
getPosition(from: string): CarPosInfo;
|
|
37
69
|
dispose(): void;
|
|
38
70
|
}
|