pub.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #pragma once
  2. #ifndef _pub_h__
  3. #define _pub_h__
  4. #include <iostream>
  5. #include <math.h>
  6. #include <stdlib.h>
  7. #include <vector>
  8. #include <string>
  9. using namespace std;
  10. #define LEFT_FOOT 1
  11. #define RIGHT_FOOT 2
  12. //#define DANCING_THRESH 5
  13. #define DANCING_THRESH 0
  14. #define CIRCLE_CENTER 22
  15. #define ORIGINTRAJ 0
  16. #define RUNGAME 1
  17. #define DANCEGAME 2
  18. #define H5GAME 3
  19. #define MONSTER 4
  20. #define RUINS 5
  21. #define CYCLE 6
  22. #define BIGFOOT 7
  23. #define FINGERGUESSING 8
  24. #define AEROBICS 9
  25. #define KONGFU 10
  26. #define TESTGAME 100
  27. #define RSSI_LIMIT
  28. #define PI 3.141592653
  29. #define DANCEGAME_MIN_RSSI 26
  30. #define PRESS_MIN 41000
  31. #define GAME_VERSION "0.4.57"
  32. enum CMD_MOTION
  33. {
  34. MOTION_STOP = 0,
  35. MOTION_RUN, // 跑
  36. MOTION_JUMP, // 跳
  37. MOTION_DOWN, // 蹲
  38. MOTION_LEFT, // 滑左
  39. MOTION_RIGHT, // 滑右
  40. MOTION_FRONT, // 滑前
  41. MOTION_BACK, // 滑后
  42. MOTION_LEFT_UP, // 点击-左上
  43. MOTION_LEFT_DOWN, // 点击-左下
  44. MOTION_RIGHT_UP, // 点击-右上
  45. MOTION_RIGHT_DOWN, // 点击-右下
  46. MOTION_STEP, // 点击-原地踩
  47. MOTION_JUMP_OC, // 开合跳
  48. MOTION_JUMP_VERTICAL, // 垂直跳
  49. MOTION_ROCK, //石头
  50. MOTION_SCISSORS, //剪刀
  51. MOTION_PAPER, //布
  52. MOTION_STRETCH_LEFT, //左伸腿
  53. MOTION_LIFT_LEFT, //左抬腿
  54. MOTION_STRETCH_RIGHT, //右伸腿
  55. MOTION_LIFT_RIGHT, //右抬腿
  56. MOTION_STRETCH_FRONT_LEFT,
  57. MOTION_STRETCH_FRONT_RIGHT,
  58. MOTION_DOWN_FRONT, //踮脚蹲
  59. NUMBERS_OF_MOTION,
  60. MOTION_CANCEL = 0x0100,
  61. };
  62. enum MOTION_COUNT_TYPE {
  63. STEP_COUNT = 0,
  64. JUMP_COUNT,
  65. DOWN_COUNT,
  66. KICK_COUNT,
  67. PAPER_COUNT,
  68. SCISSORS_COUNT,
  69. ROCK_COUNT,
  70. };
  71. enum CMD_INTERATION
  72. {
  73. NONE_INTERATION = 0,
  74. FRONT_LEFT,//左上键
  75. FRONT_RIGHT,//右上键
  76. BACK_LEFT,//左下键
  77. BACK_RIGHT,//右下键
  78. ENTER_KEY,//确认键
  79. CANCLE_KEY,//取消键
  80. };
  81. struct posData
  82. {
  83. float pos_x;
  84. float pos_y;
  85. float rssi;
  86. };
  87. struct FootActionState {
  88. int FootState;
  89. int StateCount;
  90. uint32_t Triggering_time;
  91. };
  92. struct globalPos_struct {
  93. int time_stamp;
  94. float pos_x;
  95. float pos_y;
  96. float pos_z;
  97. };
  98. struct SHOES_DATA_STRUCT{
  99. int gameTime;
  100. int right_pos_data[3];
  101. int right_att_data[3];
  102. int right_acc_data[3];
  103. int right_zupt;
  104. int right_front_mag;
  105. int right_back_mag;
  106. int left_pos_data[3];
  107. int left_att_data[3];
  108. int left_acc_data[3];
  109. int left_zupt;
  110. int left_front_mag;
  111. int left_back_mag;
  112. int jump;
  113. int down;
  114. int rssi;
  115. };
  116. #endif