Aerobics.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "PublicSDKMotion.h"
  2. #include <deque>
  3. #define PRESS_WINDOW_SIZE 10
  4. //struct same_position_press
  5. //{
  6. // int32_t left_mag;
  7. // int32_t right_mag;
  8. //};
  9. class Aerobics : public PublicSDKMotion
  10. {
  11. public:
  12. Aerobics();
  13. void setResult(deque<shoes_data_cell>& step_data_vector, int LEFT_OR_RIGHT);
  14. void ResetDenyDownTime(int time_stamp);
  15. bool isValidDown(int time_stamp);
  16. //float calVar(deque<same_position_press>& front_mag_deq);
  17. virtual void Process(int time_stamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_front_press, int right_back_press,
  18. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_front_press, int left_back_press,
  19. int jump, int down, int rssi);
  20. private:
  21. const float high_thresh = 0.1f;
  22. const float plane_thresh = 0.2f;
  23. deque<shoes_data_cell> left_shoes_data_vector;
  24. deque<shoes_data_cell> right_shoes_data_vector;
  25. deque<shoes_data_cell> left_step_data_vector;
  26. deque<shoes_data_cell> right_step_data_vector;
  27. int last_down;
  28. int last_jump;
  29. int stretch_left_status;
  30. int stretch_right_status;
  31. int stretch_front_left_status;
  32. int stretch_front_right_status;
  33. int lift_left_status;
  34. int lift_right_status;
  35. int left_wait_time;
  36. int right_wait_time;
  37. int special_down;
  38. int last_special_down;
  39. int deny_down_time;
  40. deque<int> left_acc_deque;
  41. deque<int> right_acc_deque;
  42. int wait_down = 0;
  43. //deque<same_position_press> front_mag_deq;
  44. //deque<same_position_press> back_mag_deq;
  45. };