pub.h 2.3 KB

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