FootStep.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef _FootStep_H
  2. #define _FootStep_H
  3. #include <iostream>
  4. #include <cstring>
  5. #include <vector>
  6. #include <deque>
  7. using namespace std;
  8. #define LEAVE_TIME_STYPE 1
  9. #define CATCH_TIME_STYPE 2
  10. struct FLOOR_TIME_STYPE {
  11. int time_type;
  12. int time;
  13. };
  14. class FootStep
  15. {
  16. public:
  17. FootStep();
  18. //void stepCal(int timeStamp, int pos[3], int zupt);
  19. void stepCal(int timeStamp, int zupt, int front_mag, int back_mag, int *acc);
  20. int getStepFreq();
  21. int getStepStatus();
  22. int getStepCount();
  23. private:
  24. int stepStatus;//脚步状态 0 1 2
  25. int stepFreq; //脚步步频 分钟为单位
  26. int stepTag; //计算步数所用
  27. int zuptCount;
  28. int localTime;
  29. int last_time_stamp;
  30. int leaveFloorTime;
  31. int leaveFloorTime1;
  32. int leaveFloorTime2;
  33. int leaveTimeStatus;
  34. int catchFloorTime;
  35. int lastZupt;
  36. int stepCount;
  37. int last_pos[3];
  38. vector<FLOOR_TIME_STYPE> time_vector;
  39. float mean_vel;
  40. float mean_window_vel;
  41. float step_vel_buff[3];
  42. float vel_sqrt_sum;
  43. int vel_sqrt_num;
  44. float vel_sqrt_buff[3];
  45. int front_mag_min;
  46. int back_mag_min;
  47. int max_acc[3];
  48. int min_acc[3];
  49. int unzupt_count;
  50. int leave_time_wait = 0;
  51. deque<int> acc_z_deque;
  52. };
  53. #endif