@aibee/crc-bmap 0.1.11 → 0.1.13

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
@@ -9721,8 +9721,8 @@ var ImuPosition = class {
9721
9721
  this.last_valley_time = 0;
9722
9722
  this.last_peak_time = 0;
9723
9723
  this.last_step_time = 0;
9724
- this.min_step_time = 0.3;
9725
- this.max_step_time = 1;
9724
+ this.min_step_time = 300;
9725
+ this.max_step_time = 1e3;
9726
9726
  this.min_peak = 10 + 0.5;
9727
9727
  this.max_valley = 10 - 0.5;
9728
9728
  this.peak_num = 0;
@@ -9733,7 +9733,7 @@ var ImuPosition = class {
9733
9733
  this.last_fft_amp = 0;
9734
9734
  this.abnor_start_time = 0;
9735
9735
  this.abnor_fft_detected = false;
9736
- this.abnor_time_threshod = 4;
9736
+ this.abnor_time_threshod = 4e3;
9737
9737
  this.abnor_peak_time = 0;
9738
9738
  this.abnor_peak_accH = 0;
9739
9739
  this.const_step_length = 0.65;
@@ -9745,7 +9745,7 @@ var ImuPosition = class {
9745
9745
  this.delta_rot_sum_time_fifo = [];
9746
9746
  this.delta_yaw_accum = 0;
9747
9747
  this.delta_yaw_accum_timestamp = 0;
9748
- this.delta_yaw_time_threshold = 0.5;
9748
+ this.delta_yaw_time_threshold = 500;
9749
9749
  this.last_px = 0;
9750
9750
  this.last_py = 0;
9751
9751
  this.delta_px = 0;
@@ -9805,21 +9805,23 @@ var ImuPosition = class {
9805
9805
  } else if (!this.abnor_fft_detected) {
9806
9806
  this.abnor_start_time = 0;
9807
9807
  }
9808
+ console.log("pv_detected", pv_detected, fft_detected, recheck_detected, this.abnor_start_time, pv_mid_time);
9808
9809
  if (pv_detected && fft_detected && recheck_detected) {
9809
9810
  this.step_count++;
9810
9811
  this.last_step_time = pv_mid_time;
9811
9812
  detected_flag = true;
9812
- } else if (Math.abs(this.abnor_start_time) > 1e-3 && this.abnor_peak_time - this.abnor_start_time > this.abnor_time_threshod && this.step_count > 1 && this.abnor_peak_time - this.last_step_time > 1) {
9813
+ } else if (Math.abs(this.abnor_start_time) > 1e-3 && this.abnor_peak_time - this.abnor_start_time > this.abnor_time_threshod && this.step_count > 1 && this.abnor_peak_time - this.last_step_time > 1e3) {
9813
9814
  this.step_count++;
9814
9815
  this.last_step_time = pv_mid_time;
9815
9816
  detected_flag = true;
9816
9817
  } else {
9817
- if (pv_mid_time - this.last_step_time > 2) {
9818
+ if (pv_mid_time - this.last_step_time > 2e3) {
9818
9819
  this.state_count = 0;
9819
9820
  }
9820
9821
  detected_flag = false;
9821
9822
  }
9822
9823
  }
9824
+ console.log("detected_flag", detected_flag);
9823
9825
  if (detected_flag) {
9824
9826
  const yaw_rad = this.last_yaw / 180 * Math.PI;
9825
9827
  this.delta_px = this.const_step_length * Math.cos(yaw_rad);
@@ -9830,8 +9832,9 @@ var ImuPosition = class {
9830
9832
  }
9831
9833
  }
9832
9834
  imuFreUpdate() {
9835
+ console.log("this.accH_time_fifo", this.accH_time_fifo);
9833
9836
  if (this.accH_time_fifo.length > 2) {
9834
- if (this.accH_time_fifo[this.accH_time_fifo.length - 1] - this.accH_time_fifo[this.accH_time_fifo.length - 2] < 0 || this.accH_time_fifo[this.accH_time_fifo.length - 1] - this.accH_time_fifo[this.accH_time_fifo.length - 2] > 10 || this.accH_time_fifo[this.accH_time_fifo.length - 1] === this.accH_time_fifo[0]) {
9837
+ if (this.accH_time_fifo[this.accH_time_fifo.length - 1] - this.accH_time_fifo[this.accH_time_fifo.length - 2] < 0 || this.accH_time_fifo[this.accH_time_fifo.length - 1] - this.accH_time_fifo[this.accH_time_fifo.length - 2] > 1e4 || this.accH_time_fifo[this.accH_time_fifo.length - 1] === this.accH_time_fifo[0]) {
9835
9838
  console.warn(`pdr reset last one time ${this.accH_time_fifo[this.accH_time_fifo.length - 1]} last two time ${this.accH_time_fifo[this.accH_time_fifo.length - 2]}`);
9836
9839
  this.reset();
9837
9840
  }
@@ -9862,6 +9865,7 @@ var ImuPosition = class {
9862
9865
  const min_accH = Math.min(...pv_accH_fifo);
9863
9866
  let is_step_peak = false;
9864
9867
  let is_step_valley = false;
9868
+ console.log("mid_accH - min_accH", mid_accH - min_accH, mid_accH, max_accH, this.valley_num, this.peak_num, this.min_peak);
9865
9869
  if (Math.abs(mid_accH - min_accH) < 0.01 && mid_accH < this.max_valley && this.valley_num <= this.peak_num) {
9866
9870
  if (this.last_valley_time === void 0) {
9867
9871
  is_step_valley = true;