online_motion.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include <deque>
  2. using namespace std;
  3. //由于在鞋子里,判断蹲,并不完美,需要在SDK进行补充
  4. //后期考虑将蹲放置SDK上判断
  5. class online_motion
  6. {
  7. public:
  8. int online_detect_down(int right_front_mag, int left_front_mag, int right_back_mag, int left_back_mag,
  9. int* right_acc, int* left_acc);
  10. int online_detect_jump(int right_front_mag, int left_front_mag, int right_back_mag, int left_back_mag,
  11. int* right_acc, int* left_acc);
  12. int online_detect_touch_floor(int right_front_mag, int left_front_mag, int right_back_mag, int left_back_mag );
  13. void push_press_queue(deque<int>& press_queue ,int press, int queue_size);
  14. int check_press_queue_up(deque<int>& press_queue, int thresh_hold);
  15. int min_window_val(deque<int>& press_deque, int mid_window_size);
  16. int back_press_up_trend(deque<int>& left_press_deque, deque<int>& right_press_deque);
  17. private:
  18. deque<int> right_back_mag_queue;
  19. deque<int> left_back_mag_queue;
  20. deque<int> left_press_filter_window;
  21. deque<int> right_press_filter_window;
  22. deque<int> right_front_mag_queue;
  23. deque<int> left_front_mag_queue;
  24. deque<int> right_front_mag_canve_queue;
  25. deque<int> left_front_mag_canve_queue;
  26. deque<int> left_front_acc;
  27. deque<int> right_front_acc;
  28. int last_back_down = 0;
  29. int last_front_down = 0;
  30. int last_little_front_down = 0;
  31. int left_top_back_press = 0;
  32. int right_top_back_press = 0;
  33. int top_back_press_valid_time = 0;
  34. deque<int> left_front_press_queue_touch_floor;
  35. deque<int> left_back_press_queue_touch_floor;
  36. deque<int> right_front_press_queue_touch_floor;
  37. deque<int> right_back_press_queue_touch_floor;
  38. deque<int> right_front_jump_mag_queue;
  39. deque<int> left_front_jump_mag_queue;
  40. deque<int> right_acc_z_queue;
  41. deque<int> left_acc_z_queue;
  42. };