process_result.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. #ifndef _PRECESS_RESULT_H_
  2. #define _PRECESS_RESULT_H_
  3. #include "main.h"
  4. #include "motion_config.h"
  5. #include "footPDR.h"
  6. #include "motion_interface.h"
  7. #include "detect_step_by_acc.h"
  8. #include "detect_step_by_acc_gyr.h"
  9. #define GYR_LSB 16.4f
  10. #define ACC_LSB 2048.0f
  11. #if SH_NUMBER == 1
  12. float accBias[3] = {-0.0116f, 0.0122f, -0.0172f,};
  13. float accScale[3] = {1.0015f, 1.0010f, 0.9884f,};
  14. //float magBias[3] = { 377.7242f, 111.6333f, 258.3704f};
  15. float magBias[3] = { 521.4416f, 311.3539f, 203.1051f};
  16. float magScale[3] = {0.0040f, 0.0038f, 0.0037,};
  17. #elif SH_NUMBER == 2
  18. float accBias[3] = {-0.0143f, 0.0020f, -0.0295f};
  19. float accScale[3] = {1.0026f, 1.0017f, 0.9876f};
  20. float magBias[3] = {208.19076f, 676.30954f, -1314.16369f};
  21. float magScale[3] = {0.0040f, 0.0038f, 0.0039f};
  22. #elif SH_NUMBER == 3
  23. float accBias[3] = {-0.0073f, 0.0112f, -0.0120f,};
  24. float accScale[3] = {1.0011f, 0.9997f, 0.9932f};
  25. //float magBias[3] = { -91.4046f, -173.7336f, -16.4311f};
  26. //float magBias[3] = { -33.7960f, -182.2888f, -72.0429f};
  27. //float magBias[3] = { 98.2326f, -244.3920f, -112.4380f};
  28. float magBias[3] = { -2394.65484f, 6539.55844f, -1429.03f};
  29. float magScale[3] = { 0.004f , 0.0038f , 0.0037f,};
  30. #elif SH_NUMBER == 4
  31. float accBias[3] = { -0.0000f, 0.0096f, -0.0308f};
  32. float accScale[3] = {1.0002f, 1.0009f, 0.9910f};
  33. //float magBias[3] = {29.8783f, 142.8769f, -149.3421f};
  34. //float magBias[3] = { 18.2790f, 93.3995f, -146.4823};
  35. //float magBias[3] = { -15.8519f, 70.4827f, -128.3174f};
  36. float magBias[3] = {-72.9602f, -149.2124f, -154.5789f};
  37. float magScale[3] = { 0.0040f, 0.0040f, 0.0040f};
  38. #elif SH_NUMBER == 5
  39. float accBias[3] = { 0.0208f, 0.0066f, -0.0281f,};
  40. float accScale[3] = {1.0011f, 1.0004f, 0.9955f,};
  41. float magBias[3] = { 63.2058f , 113.6578f , -539.3837f};
  42. float magScale[3] = {0.0038f , 0.0038f , 0.0037f,};
  43. #elif SH_NUMBER == 6
  44. float accBias[3] = { -0.0173f, 0.0078f, -0.1042f};
  45. float accScale[3] = {1.0015f, 1.0002f, 0.9861f};
  46. float magBias[3] = {97.0186f, 685.1305f, -513.0043f};
  47. float magScale[3] = {0.0038f, 0.0039f, 0.0037f};
  48. #elif SH_NUMBER == 7
  49. float accBias[3] = { 0.0208f, 0.0066f, -0.0281f,};
  50. float accScale[3] = {1.0011f, 1.0004f, 0.9955f,};
  51. float magBias[3] = { 63.2058f , 113.6578f , -539.3837f};
  52. float magScale[3] = {0.0038f , 0.0038f , 0.0037f,};
  53. #elif SH_NUMBER == 8
  54. float accBias[3] = { -0.0055f, 0.0097f, -0.0550f};
  55. float accScale[3] = {1.0004f, 0.9991f, 1.0000f};
  56. float magBias[3] = {-80.7255f, 715.1156f, -870.1321f};
  57. float magScale[3] = {0.0037f, 0.0038f, 0.0036f};
  58. #elif SH_NUMBER == 9
  59. float accBias[3] = {-0.0178f, 0.0056f, -0.1022f};
  60. float accScale[3] = {1.0005f, 1.0017f, 0.9880f};
  61. float magBias[3] = {-86.6536f, 341.2955f, -674.9064f};
  62. float magScale[3] = {0.0039f, 0.0039f , 0.0040f,};
  63. #elif SH_NUMBER == 10
  64. float accBias[3] = { -0.0069f , 0.0141f , -0.0498f};
  65. float accScale[3] = {1.0007f , 1.0031f , 0.9970f};
  66. float magBias[3] = { -77.8889f, 482.7083f, -616.4837f};
  67. float magScale[3] = { 0.0040f, 0.0040f, 0.0039f,};
  68. #elif SH_NUMBER == 11
  69. float accBias[3] = {0.0149f, 0.0208f, -0.0272f};
  70. float accScale[3] = {1.0010f , 1.0008f , 0.9969f};
  71. //float magBias[3] = { -66.0267f, 473.8725f, -529.6988f};
  72. //float magScale[3] = {0.0040f, 0.0040f, 0.0040f};
  73. float magBias[3] = { -79.0751f, 471.0133f, -600.3712f};
  74. float magScale[3] = {0.0040f, 0.0041f , 0.0039f};
  75. #elif SH_NUMBER == 12
  76. float accBias[3] = {0.0025f, 0.0086f, -0.0016f,};
  77. float accScale[3] = {1.0007f, 1.0009f, 0.9948f,};
  78. //float magBias[3] = {54.5925f, 293.4265f, -684.2667f,};
  79. float magBias[3] = {36.3369f, 314.0196f, -709.6340f,};
  80. float magScale[3] = {0.0040f, 0.0040f, 0.0041f,};
  81. #elif SH_NUMBER == 13
  82. float accBias[3] = {0.0063f, 0.0053f, 0.0138f,};
  83. float accScale[3] = {0.9993f, 1.0022f, 0.9883f,};
  84. float magBias[3] = {292.1026f, 633.6321f, -664.0924f,};
  85. float magScale[3] = {0.0039f, 0.0039f, 0.0037f};
  86. #elif SH_NUMBER == 14
  87. float accBias[3] = {0.0244f, 0.0082f, 0.0898f,};
  88. float accScale[3] = {0.9992f, 1.0024f, 0.9848f,};
  89. float magBias[3] = {82.3285f, 418.0601f, -636.9080f};
  90. float magScale[3] = {0.0041f , 0.0042f, 0.0040f};
  91. #elif SH_NUMBER == 15
  92. float accBias[3] = {-0.0199f , 0.0149f , -0.0832f,};
  93. float accScale[3] = {1.0006f , 1.0012f , 0.9883f,};
  94. float magBias[3] = { -83.9929f, 378.1395f, -683.2781f};
  95. float magScale[3] = {0.0039f, 0.0040f, 0.0041f};
  96. #elif SH_NUMBER == 16
  97. float accBias[3] = {-0.0062f, 0.0176f, -0.0461f};
  98. float accScale[3] = {1.0006f, 1.0030f, 0.9965f};
  99. float magBias[3] = {-66.5185f, 497.9997f, -618.6814f};
  100. float magScale[3] = {0.0040f, 0.0041f, 0.0040f};
  101. #elif SH_NUMBER == 17
  102. float accBias[3] = {0.0201f, 0.0207f, 0.1268f};
  103. float accScale[3] = {0.9984f, 1.0027f, 0.9927f};
  104. float magBias[3] = {1238.45506f, 553.76179f, -466.85981f};
  105. float magScale[3] = {0.0041f, 0.0045f, 0.0043f};
  106. #elif SH_NUMBER == 18
  107. float accBias[3] = {-0.0338f, 0.0088f, -0.0118f};
  108. float accScale[3] = { 0.9995f, 1.0009f, 0.9926f};
  109. float magBias[3] = {1471.773663f, 551.73478f, -348.20543f};
  110. float magScale[3] = {0.0041f, 0.0046f, 0.0043f};
  111. #elif SH_NUMBER == 19
  112. float accBias[3] = {-0.017644f, 0.0044866f, -0.048548f};
  113. float accScale[3] = { 1.0011f, 1.0001f, 0.9911f};
  114. float magBias[3] = {294.8f, 1054.5f, -254.15f};
  115. float magScale[3] = {0.004482f, 0.0041116f, 0.004236f};
  116. #elif SH_NUMBER == 20
  117. float accBias[3] = {-0.02376f, 0.01068f, 0.069101f};
  118. float accScale[3] = { 0.99977f, 1.0007f, 0.99655f};
  119. float magBias[3] = { 285.12f, 1218.7f, -416.98f};
  120. float magScale[3] = {0.004411f, 0.0040035f, 0.0041864f};
  121. #elif SH_NUMBER == 21
  122. float accBias[3] = { 0.0176f, 0.0217f, 0.1217f};
  123. float accScale[3] = { 1.0032f, 1.0025f, 0.9973f};
  124. float magBias[3] = {357.05161f, 1111.658506f, -434.721060f};
  125. float magScale[3] = {0.0044f, 0.004f, 0.0042f};
  126. #elif SH_NUMBER == 22
  127. float accBias[3] = { -0.0371f, 0.0082f, -0.0177f};
  128. float accScale[3] = { 1.0032f, 1.0025f, 0.9973f};
  129. float magBias[3] = {443.781061f, 1401.779316f, -264.01198f};
  130. float magScale[3] = {0.0046f, 0.0041f, 0.0043f};
  131. #elif SH_NUMBER == 23
  132. float accBias[3] = { -0.0294f, 0.0088f, 0.0213f};
  133. float accScale[3] = { 1.0037f, 0.9976f, 0.9940f};
  134. float magBias[3] = {508.4243192f, 1189.075561f, -373.32054f};
  135. float magScale[3] = {0.0046f, 0.0042f, 0.0041};
  136. #elif SH_NUMBER == 24
  137. float accBias[3] = { -0.0119f, -0.0012f, 0.0454f};
  138. float accScale[3] = { 1.0002f, 0.9956f, 1.0038f};
  139. float magBias[3] = {726.44178f, 710.183522f, -510.867688f};
  140. float magScale[3] = {0.0045f, 0.0041f, 0.0042f};
  141. #elif SH_NUMBER == 25
  142. float accBias[3] = { -0.0065f, 0.0027f, 0.0271f};
  143. float accScale[3] = { 1.0005f, 0.9992f, 0.9952f};
  144. float magBias[3] = {213.41965895f, 1127.6071397f, -188.07170366f};
  145. float magScale[3] = {0.0044f, 0.004f, 0.0041f};
  146. #elif SH_NUMBER == 26
  147. float accBias[3] = { -0.0132f, 0.0037f, -0.0090f};
  148. float accScale[3] = { 1.0022f, 1.0008f, 0.9946f};
  149. float magBias[3] = {705.2909f, 888.2859f, -162.9662f};
  150. float magScale[3] = { 0.0045f, 0.0041f, 0.0043f};
  151. #elif SH_NUMBER == 27
  152. float accBias[3] = { -0.0176f, 0.0093f, 0.0459f};
  153. float accScale[3] = { 1.0022f, 1.0004f, 1.0050f};
  154. float magBias[3] = {-123.9147f, -5.1146f, -268.7183f};
  155. float magScale[3] = {0.0045f, 0.0040f, 0.0042f};
  156. #elif SH_NUMBER == 28
  157. float accBias[3] = { -0.0226f, 0.0083f, 0.0473f};
  158. float accScale[3] = { 1.0006f, 1.0019f, 0.9971f};
  159. float magBias[3] = { 270.3228f, 7.2314f, -93.2455f};
  160. float magScale[3] = { 0.0044f, 0.0039f, 0.0040f};
  161. #elif SH_NUMBER == 31
  162. float accBias[3] = { -0.007613f, 0.0049329f, -0.022617f};
  163. float accScale[3] = { 1.0374647f, 0.98994f, 0.995096f};
  164. float magBias[3] = { -591.6082f, 760.9560f, -194.1897};
  165. float magScale[3] = { 0.0047f, 0.0043f, 0.0043f};
  166. #elif SH_NUMBER == 32
  167. float accBias[3] = { -0.006894f, 0.013296f, -0.030154f};
  168. float accScale[3] = { 0.98567f, 1.0142618f, 0.99747f};
  169. float magBias[3] = { -526.1854f, 553.1508f, -142.6464f};
  170. float magScale[3] = { 0.0045f, 0.0042f, 0.0042f};
  171. #elif SH_NUMBER == 33
  172. float accBias[3] = { -0.0091f, 0.0124f, -0.0790f};
  173. float accScale[3] = { 1.0021f, 0.9966f, 0.9928f};
  174. float magBias[3] = {813.1402436536083f, 280.82271197483055f, -29.053538226463385f};
  175. float magScale[3] = {0.0042312985166727685f, 0.003920572901665482f, 0.0039770217454643255f};
  176. #elif SH_NUMBER == 34
  177. float accBias[3] = { -0.0141f, 0.0072f, 0.0108f};
  178. float accScale[3] = { 1.0091f , 0.9943f , 1.0023f};
  179. float magBias[3] = {-122.09773026023785f, -588.9466945960162f, -277.99760629602105f};
  180. float magScale[3] = {0.004216299267535813f, 0.003918950857638731f, 0.003974970092518379f};
  181. #
  182. #endif
  183. #ifdef WHITE_SH0
  184. #if IS_HOST
  185. float accBias[3] = { -0.0055f, 0.0114f, -0.0075f};
  186. float accScale[3] = {1.0011f, 0.9997f, 0.9930f};
  187. float magBias[3] = { 98.5793f, -199.4005f, -188.8333f};
  188. float magScale[3] = {0.0040f, 0.0040f, 0.0037f};
  189. #else
  190. /* slave*/
  191. float accBias[3] = { 0.0009f, 0.0062f, -0.0224f};
  192. float accScale[3] = {1.0000f, 1.0006f, 0.9913f};
  193. float magBias[3] = { -75.9748f, 80.7247, -134.6379f};
  194. float magScale[3] = { 0.0039f, 0.0037f, 0.0037f};
  195. #endif
  196. #elif defined BLUE_SHO
  197. #if IS_HOST
  198. float accBias[3] = { -0.0118f , 0.0130f , -0.0026f};
  199. float accScale[3] = {1.0015f , 1.0011f , 0.9896f};
  200. float magBias[3] = { 569.5943f , 271.8484f , 298.8276f};
  201. float magScale[3] = {0.0040f , 0.0037f , 0.0039f};
  202. #else
  203. /* slave*/
  204. float accBias[3] = {-0.0299f, 0.0114f , -0.0716f};
  205. float accScale[3] = {1.0017f, 1.0023f, 0.9884f};
  206. float magBias[3] = {324.02837f, 599.89072f, -1323.1148f};
  207. float magScale[3] = {0.0039f, 0.0037f, 0.0037f};
  208. #endif
  209. #endif
  210. #endif