FingerGuessing.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #include "PublicSDKMotion.h"
  2. class FingerGuessing : public PublicSDKMotion
  3. {
  4. public:
  5. FingerGuessing();
  6. void setData(deque<shoes_data_cell>& shoes_data_vector, int time_stamp, float pos_x, float pos_y, float pos_z, float heading, float pitch, float roll, int zupt, int rssi);
  7. void calGlobalPos(deque<shoes_data_cell>& shoes_data_vector, deque<shoes_data_cell>& step_data_vector,
  8. float* global_pos, int LEFT_OR_RIGHT);
  9. void ProcessResult(int zupt, int& zupt_count, int& has_init, float heading,
  10. float& rotate_heading, float* global_pos, deque<shoes_data_cell>& step_data_vector,
  11. deque<globalPos_struct>& global_pos_vector, int& cmd_status, int LEFT_OR_RIGHT);
  12. 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,
  13. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_front_press, int left_back_press,
  14. int jump, int down, int rssi);
  15. virtual void getResult(int* dec);
  16. virtual float getGamePos(int left_or_right, int index);
  17. private:
  18. deque<shoes_data_cell> left_shoes_data_vector;
  19. deque<shoes_data_cell> right_shoes_data_vector;
  20. deque<globalPos_struct> right_global_pos_vector;
  21. deque<globalPos_struct> left_global_pos_vector;
  22. float left_step_heading;
  23. float right_step_heading;
  24. float left_global_pos[3];
  25. float right_global_pos[3];
  26. float left_cmd_global_pos[3];
  27. float right_cmd_global_pos[3];
  28. deque<shoes_data_cell> left_step_data_vector;
  29. deque<shoes_data_cell> right_step_data_vector;
  30. float left_step_pos[3];
  31. float right_step_pos[3];
  32. int jump_count;
  33. int down_count;
  34. int last_down;
  35. int last_jump;
  36. int down_wait_after_jump;
  37. int result[4];
  38. int last_left_zupt;
  39. int last_right_zupt;
  40. float left_heading;
  41. float right_heading;
  42. int left_foot_has_init;
  43. int right_foot_has_init;
  44. int left_zupt_count;
  45. int right_zupt_count;
  46. int right_cmd_status;
  47. int left_cmd_status;
  48. int last_right_cmd_status;
  49. int last_left_cmd_status;
  50. int right_cmd_cur_status;
  51. int left_cmd_cur_status;
  52. int right_cmd_wait_time;
  53. int left_cmd_wait_time;
  54. int max_acc_unzupt_left[3];
  55. int min_acc_unzupt_left[3];
  56. int max_acc_unzupt_right[3];
  57. int min_acc_unzupt_right[3];
  58. int rssi_buff[5];
  59. const int rssi_threshold = 32;
  60. };