@aibee/crc-bmap 0.8.51 → 0.8.52
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 +1 -1
- package/lib/bmap.esm.js +15 -11
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.min.js +1 -1
- package/lib/src/plugins/pdr-position/pdr.d.ts +1 -0
- package/lib/src/plugins/pdr-position/pdr.js +15 -11
- package/lib/src/plugins/pdr-position/position.js +1 -0
- package/lib/src/utils/road2.d.ts +7 -7
- package/package.json +1 -1
|
@@ -61,16 +61,19 @@ export class PositioningSystem {
|
|
|
61
61
|
success = true;
|
|
62
62
|
}
|
|
63
63
|
} else if (!this.particleFilter.getPosInitFlag() && this.using_gps && data_type === SENSOR_TYPE.GPS) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
// 3s内的初始定位不使用gps
|
|
65
|
+
if (this.startTime && Date.now() - this.startTime > 3000) {
|
|
66
|
+
const gps_pos = this.getGpsPosition(data);
|
|
67
|
+
success = gps_pos !== null;
|
|
68
|
+
console.log("gps_pos", gps_pos, data);
|
|
69
|
+
if (gps_pos) {
|
|
70
|
+
this.particleFilter.initParticlesByPos(gps_pos.x, gps_pos.y, ()=>true);
|
|
71
|
+
this.last_pos_time = time;
|
|
72
|
+
console.log("init Pos by gps success time " + time);
|
|
73
|
+
this.cacheSensorData.length = 0;
|
|
74
|
+
} else {
|
|
75
|
+
console.log("init Pos by gps fail time " + time);
|
|
76
|
+
}
|
|
74
77
|
}
|
|
75
78
|
} else if (!this.particleFilter.getYawInitFlag() && data_type === SENSOR_TYPE.COMPASS) {
|
|
76
79
|
const compass = data;
|
|
@@ -141,7 +144,7 @@ export class PositioningSystem {
|
|
|
141
144
|
this.sigmaBeacon = 5.0;
|
|
142
145
|
this.gps_horizontalAccuracy = 10;
|
|
143
146
|
this.using_gps = true;
|
|
144
|
-
this.last_beacon_time =
|
|
147
|
+
this.last_beacon_time = Date.now();
|
|
145
148
|
this.position_count = 0;
|
|
146
149
|
this.gps_max_horizontalAccuracy = 20;
|
|
147
150
|
this.MaxEstimateErr = 5;
|
|
@@ -149,6 +152,7 @@ export class PositioningSystem {
|
|
|
149
152
|
this.outTrustRegionNum = 0;
|
|
150
153
|
this.TrustNum = 4;
|
|
151
154
|
this.cacheSensorData = [];
|
|
155
|
+
this.startTime = null;
|
|
152
156
|
const config = _extends({}, defaultPdrPositionOptions, options);
|
|
153
157
|
this.using_gps = config.using_gps;
|
|
154
158
|
this.particleFilter = new ParticleFilter({
|
|
@@ -9,6 +9,7 @@ export class PdrPosition extends EventDispatcher {
|
|
|
9
9
|
}
|
|
10
10
|
start() {
|
|
11
11
|
this.sensor.start();
|
|
12
|
+
this.pdr.startTime = Date.now();
|
|
12
13
|
this.sensor.addEventListener("add-data-item", (param)=>{
|
|
13
14
|
let { item } = param;
|
|
14
15
|
this.getPositionBySensorItem(item, !this._pause);
|
package/lib/src/utils/road2.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface RoadData2 {
|
|
|
16
16
|
id: string;
|
|
17
17
|
cds: [number, number];
|
|
18
18
|
name: string;
|
|
19
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
19
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
20
20
|
floor: string;
|
|
21
21
|
locked: boolean;
|
|
22
22
|
nodeId: string;
|
|
@@ -89,7 +89,7 @@ export declare class RoadNetwork2 {
|
|
|
89
89
|
id: string;
|
|
90
90
|
cds: [number, number];
|
|
91
91
|
name: string;
|
|
92
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
92
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
93
93
|
floor: string;
|
|
94
94
|
locked: boolean;
|
|
95
95
|
nodeId: string;
|
|
@@ -110,7 +110,7 @@ export declare class RoadNetwork2 {
|
|
|
110
110
|
id: string;
|
|
111
111
|
cds: [number, number];
|
|
112
112
|
name: string;
|
|
113
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
113
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
114
114
|
floor: string;
|
|
115
115
|
locked: boolean;
|
|
116
116
|
nodeId: string;
|
|
@@ -130,7 +130,7 @@ export declare class RoadNetwork2 {
|
|
|
130
130
|
id: string;
|
|
131
131
|
cds: [number, number];
|
|
132
132
|
name: string;
|
|
133
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
133
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
134
134
|
floor: string;
|
|
135
135
|
locked: boolean;
|
|
136
136
|
nodeId: string;
|
|
@@ -158,7 +158,7 @@ export declare class RoadNetwork2 {
|
|
|
158
158
|
id: string;
|
|
159
159
|
cds: [number, number];
|
|
160
160
|
name: string;
|
|
161
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
161
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
162
162
|
floor: string;
|
|
163
163
|
locked: boolean;
|
|
164
164
|
nodeId: string;
|
|
@@ -178,7 +178,7 @@ export declare class RoadNetwork2 {
|
|
|
178
178
|
id: string;
|
|
179
179
|
cds: [number, number];
|
|
180
180
|
name: string;
|
|
181
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
181
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
182
182
|
floor: string;
|
|
183
183
|
locked: boolean;
|
|
184
184
|
nodeId: string;
|
|
@@ -198,7 +198,7 @@ export declare class RoadNetwork2 {
|
|
|
198
198
|
id: string;
|
|
199
199
|
cds: [number, number];
|
|
200
200
|
name: string;
|
|
201
|
-
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "store";
|
|
201
|
+
type: "normal" | "graph" | "straightLadder" | "staircase" | "escalator" | "facility" | "wall" | "lane" | "parkingSpace" | "texture2d" | "glb" | "ramp" | "connectionPoint" | "store";
|
|
202
202
|
floor: string;
|
|
203
203
|
locked: boolean;
|
|
204
204
|
nodeId: string;
|