@aibee/crc-bmap 0.8.50 → 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.esm.js CHANGED
@@ -11759,9 +11759,9 @@ var GroundTexture = class extends Object3D8 {
11759
11759
  });
11760
11760
  }
11761
11761
  dispose() {
11762
- var _this_mesh, _this_mesh1;
11763
- (_this_mesh = this.mesh) == null ? void 0 : _this_mesh.geometry.dispose();
11764
- ((_this_mesh1 = this.mesh) == null ? void 0 : _this_mesh1.material).forEach((item) => item.dispose());
11762
+ var _this_mesh_geometry, _this_mesh, _this_mesh_material, _this_mesh1;
11763
+ (_this_mesh = this.mesh) == null ? void 0 : (_this_mesh_geometry = _this_mesh.geometry) == null ? void 0 : _this_mesh_geometry.dispose();
11764
+ (_this_mesh1 = this.mesh) == null ? void 0 : (_this_mesh_material = _this_mesh1.material) == null ? void 0 : _this_mesh_material.forEach((item) => item.dispose());
11765
11765
  this.clear();
11766
11766
  }
11767
11767
  constructor(context, options) {
@@ -18322,16 +18322,18 @@ var PositioningSystem = class {
18322
18322
  success = true;
18323
18323
  }
18324
18324
  } else if (!this.particleFilter.getPosInitFlag() && this.using_gps && data_type === SENSOR_TYPE.GPS) {
18325
- const gps_pos = this.getGpsPosition(data);
18326
- success = gps_pos !== null;
18327
- console.log("gps_pos", gps_pos, data);
18328
- if (gps_pos) {
18329
- this.particleFilter.initParticlesByPos(gps_pos.x, gps_pos.y, () => true);
18330
- this.last_pos_time = time;
18331
- console.log("init Pos by gps success time " + time);
18332
- this.cacheSensorData.length = 0;
18333
- } else {
18334
- console.log("init Pos by gps fail time " + time);
18325
+ if (this.startTime && Date.now() - this.startTime > 3e3) {
18326
+ const gps_pos = this.getGpsPosition(data);
18327
+ success = gps_pos !== null;
18328
+ console.log("gps_pos", gps_pos, data);
18329
+ if (gps_pos) {
18330
+ this.particleFilter.initParticlesByPos(gps_pos.x, gps_pos.y, () => true);
18331
+ this.last_pos_time = time;
18332
+ console.log("init Pos by gps success time " + time);
18333
+ this.cacheSensorData.length = 0;
18334
+ } else {
18335
+ console.log("init Pos by gps fail time " + time);
18336
+ }
18335
18337
  }
18336
18338
  } else if (!this.particleFilter.getYawInitFlag() && data_type === SENSOR_TYPE.COMPASS) {
18337
18339
  const compass = data;
@@ -18403,7 +18405,7 @@ var PositioningSystem = class {
18403
18405
  this.sigmaBeacon = 5;
18404
18406
  this.gps_horizontalAccuracy = 10;
18405
18407
  this.using_gps = true;
18406
- this.last_beacon_time = null;
18408
+ this.last_beacon_time = Date.now();
18407
18409
  this.position_count = 0;
18408
18410
  this.gps_max_horizontalAccuracy = 20;
18409
18411
  this.MaxEstimateErr = 5;
@@ -18411,6 +18413,7 @@ var PositioningSystem = class {
18411
18413
  this.outTrustRegionNum = 0;
18412
18414
  this.TrustNum = 4;
18413
18415
  this.cacheSensorData = [];
18416
+ this.startTime = null;
18414
18417
  const config = _extends({}, defaultPdrPositionOptions, options);
18415
18418
  this.using_gps = config.using_gps;
18416
18419
  this.particleFilter = new ParticleFilter({
@@ -18437,6 +18440,7 @@ var PdrPosition = class extends EventDispatcher17 {
18437
18440
  }
18438
18441
  start() {
18439
18442
  this.sensor.start();
18443
+ this.pdr.startTime = Date.now();
18440
18444
  this.sensor.addEventListener("add-data-item", (param) => {
18441
18445
  let { item } = param;
18442
18446
  this.getPositionBySensorItem(item, !this._pause);