TestGame.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include "PublicSDKMotion.h"
  2. struct acc_pos_struct
  3. {
  4. float pos_x;
  5. float pos_y;
  6. float pos_z;
  7. float acc_xy_norm;
  8. int zupt;
  9. };
  10. struct double_press_struct
  11. {
  12. int front_press;
  13. int back_press;
  14. int up_flag;
  15. int get_flag;
  16. };
  17. class TestGame : public PublicSDKMotion
  18. {
  19. public:
  20. TestGame();
  21. void setData(deque<acc_pos_struct>& shoes_data_vector, float pos_x, float pos_y, float pos_z, float acc_x, float acc_y, float acc_z, float heading, float pitch, float roll, int zupt);
  22. void calGlobalPos(deque<shoes_data_cell>& shoes_data_vector, deque<shoes_data_cell>& step_data_vector,
  23. float* global_pos, int LEFT_OR_RIGHT);
  24. //void ProcessResult(int zupt, int& zupt_count, int& has_init, float heading,
  25. // float& rotate_heading, float* global_pos, deque<shoes_data_cell>& step_data_vector,
  26. // deque<globalPos_struct>& global_pos_vector, int LEFT_OR_RIGHT);
  27. 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,
  28. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_front_press, int left_back_press,
  29. int jump, int down, int rssi);
  30. virtual void getResult(int* dec);
  31. virtual float getGamePos(int left_or_right, int index);
  32. private:
  33. deque<acc_pos_struct> left_shoes_data_vector;
  34. deque<acc_pos_struct> right_shoes_data_vector;
  35. float left_step_heading;
  36. float right_step_heading;
  37. float left_global_pos[3];
  38. float right_global_pos[3];
  39. float left_cmd_global_pos[3];
  40. float right_cmd_global_pos[3];
  41. deque<shoes_data_cell> left_step_data_vector;
  42. deque<shoes_data_cell> right_step_data_vector;
  43. deque<double_press_struct> left_press_vector;
  44. deque<double_press_struct> right_press_vector;
  45. float left_step_pos[3];
  46. float right_step_pos[3];
  47. int last_left_zupt;
  48. int last_right_zupt;
  49. int left_step;
  50. int right_step;
  51. int left_step_length;
  52. int right_step_length;
  53. int result[4];
  54. };