leon vor 2 Jahren
Ursprung
Commit
18e6e1d80a
100 geänderte Dateien mit 744 neuen und 10153 gelöschten Zeilen
  1. BIN
      .DS_Store
  2. BIN
      DanceGame/Classes/FitfunTool/.DS_Store
  3. 0 2
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/FitfunSDK/Fitfuncore.framework/Headers/FitfunYDManager.h
  4. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/.DS_Store
  5. 8 2
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCarouselView.m
  6. 3 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.m
  7. 0 123
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/BigFoot.cpp
  8. 0 39
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/BigFoot.h
  9. 0 811
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceFoot.cpp
  10. 0 107
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceFoot.h
  11. 0 265
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceGame.cpp
  12. 0 39
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceGame.h
  13. 0 129
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/FootStep.cpp
  14. 0 49
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/FootStep.h
  15. 0 592
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Game.cpp
  16. 0 180
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Game.h
  17. 0 68
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/InertialTrajProcess.cpp
  18. 0 20
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/InertialTrajProcess.h
  19. 0 150
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Interaction.cpp
  20. 0 47
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Interaction.h
  21. 0 172
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/MonsterH5.cpp
  22. 0 15
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/MonsterH5.h
  23. 0 114
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/OriginTraj.cpp
  24. 0 30
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/OriginTraj.h
  25. 0 111
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RuinsExplore.cpp
  26. 0 53
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RuinsExplore.h
  27. 0 619
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RunGame.cpp
  28. 0 111
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RunGame.h
  29. 0 572
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/SingleFootAction.cpp
  30. 0 76
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/SingleFootAction.h
  31. 0 221
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Tricycle.cpp
  32. 0 60
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Tricycle.h
  33. 0 297
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/jumpH5.cpp
  34. 0 54
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/jumpH5.h
  35. 0 93
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/pub.h
  36. 0 186
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/publicMotion.cpp
  37. 0 58
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/publicMotion.h
  38. 0 22
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/testGame.cpp
  39. 0 24
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/testGame.h
  40. 2 3
      DanceGame/Classes/UnityAppController.mm
  41. 121 115
      DanceGame/Unity-iPhone.xcodeproj/project.pbxproj
  42. BIN
      DanceGame/Unity-iPhone.xcodeproj/project.xcworkspace/xcuserdata/duowan123.xcuserdatad/UserInterfaceState.xcuserstate
  43. BIN
      RunGame/.DS_Store
  44. BIN
      RunGame/SDK/.DS_Store
  45. 14 0
      RunGame/SDK/BLE/BTDataAnalysis.h
  46. 143 0
      RunGame/SDK/BLE/BTDataAnalysis.mm
  47. 20 149
      RunGame/SDK/BLE/BTDataProcess.mm
  48. 7 2
      RunGame/SDK/BLE/DebugView.h
  49. 9 2
      RunGame/SDK/BLE/DebugView.m
  50. 1 1
      RunGame/SDK/HTTP/socket/SocketRocketUtility.m
  51. 19 0
      RunGame/SDK/IOSPlatformSDK.mm
  52. BIN
      RunGame/SDK/ThirdClass/.DS_Store
  53. BIN
      RunGame/SDK/ThirdClass/AvoidCrash-master/.DS_Store
  54. BIN
      RunGame/SDK/ThirdClass/AvoidCrash-master/AvoidCrashDemo/.DS_Store
  55. 0 116
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.h
  56. 0 219
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.m
  57. 0 17
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashProtocol.h
  58. 0 37
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.h
  59. 0 18
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.m
  60. 0 25
      RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.h
  61. 0 258
      RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.m
  62. 0 25
      RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.h
  63. 0 96
      RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.m
  64. 0 24
      RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.h
  65. 0 56
      RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.m
  66. 0 26
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.h
  67. 0 169
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.m
  68. 0 23
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.h
  69. 0 74
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.m
  70. 0 24
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.h
  71. 0 95
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.m
  72. 0 29
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.h
  73. 0 97
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.m
  74. 0 34
      RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.h
  75. 0 221
      RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.m
  76. 0 29
      RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.h
  77. 0 204
      RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m
  78. BIN
      RunGame/SDK/ThirdClass/Bugly-2.5.9/.DS_Store
  79. BIN
      RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Bugly
  80. 163 0
      RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Headers/Bugly.h
  81. 141 0
      RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Headers/BuglyConfig.h
  82. 78 0
      RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Headers/BuglyLog.h
  83. 12 0
      RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Modules/module.modulemap
  84. 0 16
      RunGame/SDK/ThirdClass/BuglyManager.h
  85. 0 40
      RunGame/SDK/ThirdClass/BuglyManager.m
  86. BIN
      RunGame/SDK/ThirdClass/Bugly_2.5.0/.DS_Store
  87. 1 0
      RunGame/SDK/Tool/MYFactoryManager.h
  88. 1 1
      RunGame/SDK/UI/CarouselView/ShoesCarouselView.m
  89. 1 1
      RunGame/SDK/UI/CarouselView/TXCarouselView.m
  90. 0 122
      RunGame/SDK/shoes_sdk/BigFoot.cpp
  91. 0 39
      RunGame/SDK/shoes_sdk/BigFoot.h
  92. 0 811
      RunGame/SDK/shoes_sdk/DanceFoot.cpp
  93. 0 107
      RunGame/SDK/shoes_sdk/DanceFoot.h
  94. 0 265
      RunGame/SDK/shoes_sdk/DanceGame.cpp
  95. 0 39
      RunGame/SDK/shoes_sdk/DanceGame.h
  96. 0 129
      RunGame/SDK/shoes_sdk/FootStep.cpp
  97. 0 49
      RunGame/SDK/shoes_sdk/FootStep.h
  98. 0 587
      RunGame/SDK/shoes_sdk/Game.cpp
  99. 0 180
      RunGame/SDK/shoes_sdk/Game.h
  100. 0 68
      RunGame/SDK/shoes_sdk/InertialTrajProcess.cpp

BIN
.DS_Store


BIN
DanceGame/Classes/FitfunTool/.DS_Store


+ 0 - 2
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/FitfunSDK/Fitfuncore.framework/Headers/FitfunYDManager.h

@@ -11,8 +11,6 @@
 #import <UIKit/UIKit.h>
 #import "FitfunEnumType.h"
 
-
-
 @class FitfunAccountItem, FitfunHTTPSessionManagerTool;
 @interface FitfunYDManager : NSObject
 

BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/.DS_Store


+ 8 - 2
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/CarouselView/ShoesCarouselView.m

@@ -59,6 +59,14 @@ UIScrollViewDelegate
 
 @implementation ShoesCarouselView
 
+//- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
+//    UIView *hitView = [super hitTest:point withEvent:event];
+//    //如果上层透明视图是window 和 按钮(uibutton 继承自UIControl )就允许点击
+//    if(hitView.window == self && ![hitView isKindOfClass:[UIControl class]]){
+//        return nil;
+//    }
+//    return hitView;
+//}
 
 #pragma mark - 生命周期
 - (instancetype)initWithCoder:(NSCoder *)coder{
@@ -71,9 +79,7 @@ UIScrollViewDelegate
         self.currentState.isDidScroll = NO;
         self.currentState.isCenter = NO;
         self.currentState.isRestrict = NO;
-        
         self.userInteractionEnabled = NO;
-  
     }
     return self;
     

+ 3 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.m

@@ -28,6 +28,9 @@
 
 @implementation SearchDeviceViewController
 
+
+
+
 -(void)viewDidLoad{
     
     [super viewDidLoad];

+ 0 - 123
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/BigFoot.cpp

@@ -1,123 +0,0 @@
-#include "pub.h"
-
-#include "BigFoot.h"
-
-
-BigFoot::BigFoot()
-{
-	memset(result, 0, 4 * sizeof(int));
-
-	memset(left_min_acc, 0, 3 * sizeof(int));
-
-	memset(left_max_acc, 0, 3 * sizeof(int));
-
-	memset(right_min_acc, 0, 3 * sizeof(int));
-
-	memset(right_max_acc, 0, 3 * sizeof(int));
-
-	last_left_zupt = 1;
-
-	last_right_zupt = 1;
-}
-
-int BigFoot::station_acc(int* max_acc, int* min_acc)
-{
-	for (int i = 0; i < 3; i++)
-	{
-		if (max_acc[i] - min_acc[i] > 1024)
-		{
-			return 0;
-		}
-	}
-
-
-	return 1;
-}
-
-void BigFoot::getResult(int* matrix)
-{
-	memcpy(matrix, result, 4 * sizeof(int));
-}
-
-void BigFoot::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int girl_shoes)
-{
-
-
-	//需要用加速度过滤伪触地,如果期间是小于0.5g的则视为伪触地,过滤掉
-	//station_acc 判断方法
-
-	if (left_zupt && last_left_zupt == 0 && !station_acc(left_max_acc, left_min_acc))
-	//if (left_zupt && last_left_zupt == 0 )
-	{
-		result[0] = 1;
-		std::cout << "左脚踩了" << std::endl;
-	}
-	else
-	{
-		result[0] = 0;
-	}
-
-	if (right_zupt && last_right_zupt == 0 && !station_acc(right_max_acc, right_min_acc))
-	{
-		result[1] = 1;
-		std::cout << "右脚踩了" << std::endl;
-	}
-	else
-	{
-		result[1] = 0;
-	}
-	
-
-	last_left_zupt = left_zupt;
-
-	last_right_zupt = right_zupt;
-
-
-	if (left_zupt)
-	{
-		memcpy(left_min_acc, left_acc, 3 * sizeof(int));
-
-		memcpy(left_max_acc, left_acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (left_min_acc[i] > left_acc[i])
-			{
-				left_min_acc[i] = left_acc[i];
-			}
-
-			if (left_max_acc[i] < left_acc[i])
-			{
-				left_max_acc[i] = left_acc[i];
-			}
-		}
-	}
-
-	if (right_zupt)
-	{
-		memcpy(right_min_acc, right_acc, 3 * sizeof(int));
-
-		memcpy(right_max_acc, right_acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (right_min_acc[i] > right_acc[i])
-			{
-				right_min_acc[i] = right_acc[i];
-			}
-
-			if (right_max_acc[i] < right_acc[i])
-			{
-				right_max_acc[i] = right_acc[i];
-			}
-		}
-	}
-
-
-}

+ 0 - 39
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/BigFoot.h

@@ -1,39 +0,0 @@
-#pragma once
-#ifndef _BigFoot_H_
-#define _BigFoot_H_
-
-class BigFoot {
-public:
-
-	BigFoot();
-
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int girl_shoes);
-
-
-	void getResult(int* dec);
-
-	int station_acc(int* max_acc, int* min_acc);
-
-
-private:
-
-	int result[4];
-
-	int left_min_acc[3];
-
-	int left_max_acc[3];
-	
-	int right_min_acc[3];
-
-	int right_max_acc[3];
-
-	int last_left_zupt;
-
-	int last_right_zupt;
-
-};
-
-
-#endif

+ 0 - 811
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceFoot.cpp

@@ -1,811 +0,0 @@
-#include "DanceFoot.h"
-
-/*
-* 初始化脚步的数据
-*/
-DanceFoot::DanceFoot(int LEFT_OR_RIGHT)
-{
-	left_or_right = LEFT_OR_RIGHT;
-
-	foot_rssi = 0;
-	foot_zupt = 1;
-
-	rssi_zupt = 1;
-	
-	max_rssi = 0;
-	min_rssi = 100;
-
-	memset(attitude, 0, 3 * sizeof(float));
-	memset(globalPos, 0, 3 * sizeof(float));
-	memset(offsetPos, 0, 3 * sizeof(float));
-	memset(last_pos_g, 0, 2 * sizeof(float));
-	memset(pos, 0, 2 * sizeof(float));
-
-	last_pos[0] = 0;  last_pos[1] = 0;
-
-	last_zupt = 1;
-
-	danceTraj[0] = 0; danceTraj[1] = 0;
-
-	rotate_err = 0;
-
-	rotateCor[0] = 1.0; rotateCor[1] = 0.0; rotateCor[2] = 0.0; rotateCor[3] = 1.0;
-
-	zupt_count = 1;
-
-	pos_index = -1;
-}
-
-/*
-* 设置脚的姿态,当前位置,鞋子上来的位置偏移量, rssi, zupt变量
-*/
-
-int DanceFoot::setAttitude(float  att[3])
-{
-	memcpy(attitude, att, 3 * sizeof(float));
-
-	return 0;
-}
-
-int DanceFoot::setPosGlobal(float pos[3])
-{
-	memcpy(globalPos, pos, 3 * sizeof(float));
-
-	return 0;
-}
-
-int DanceFoot::setPosOffset(float pos[3])
-{
-	memcpy(offsetPos, pos, 3 * sizeof(float));
-
-	return 0;
-}
-
-int DanceFoot::setFootZupt(int zupt)
-{
-	foot_zupt = zupt;
-
-	return 0;
-}
-
-int DanceFoot::setFootRssi(int rssi)
-{
-	foot_rssi = rssi;
-	
-	return 0;
-}
-
-int DanceFoot::setMaxRssi(int rssi)
-{
-	max_rssi = rssi;
-
-	return 0;
-}
-
-int DanceFoot::setMinRssi(int rssi)
-{
-	min_rssi = rssi;
-	
-	return 0;
-}
-
-/*
-*  通过判断rssi的变化范围来确定是否没有位移,
-*  原地踏步返回0 ,有明显变化的返回1
-*/
-int DanceFoot::isMoveRssi(int rssi, int zupt)
-{
-	int result = 1;
-
-	if (zupt == 0)
-	{
-		if (rssi > max_rssi)
-		{
-			setMaxRssi(rssi);
-		}
-
-		if (rssi < min_rssi)
-		{
-			setMinRssi(rssi);
-		}
-	}
-	else
-	{
-		if (rssi_zupt == 0)
-		{
-			if (max_rssi - min_rssi < 3)
-			{
-				result = 0;
-			}
-		}
-
-		setMaxRssi(0);
-		setMinRssi(100);
-	}
-	
-	rssi_zupt = zupt;
-
-	return result;
-}
-/*
-* 处理全局位置的边界问题,全局位置应为40cmX40cm区域
-*/
-int DanceFoot::posBoundary(float pos[3])
-{
-	float posLength = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
-
-	if (posLength > 0.25)
-	{
-		pos[0] = pos[0] / posLength * 0.25;
-		pos[1] = pos[1] / posLength * 0.25;
-	}
-
-	return 0;
-}
-
-/*
-* 通过角度来判断跳舞毯的方向
-* 
-*/
-int DanceFoot::getGameDiretion(float *pos)
-{
-	float x = pos[0] ;
-	float y = pos[1] ;
-
-	if (left_or_right == LEFT_FOOT)
-	{
-		std::cout << "left_foot ";
-	}
-	else
-	{
-		std::cout << "right_foot ";
-	}
-
-	if((left_or_right == LEFT_FOOT&& sqrt((x+0.15) * (x+0.15) + y * y) < 0.1)
-		|| (left_or_right == RIGHT_FOOT && sqrt((x - 0.15) * (x - 0.15) + y * y) < 0.1))
-	{
-		if (left_or_right == LEFT_FOOT)
-		{
-			pos[0] = -0.5f;
-		}
-		else
-		{
-			pos[0] = 0.5f;
-		}
-		pos[1] = 0.0f;
-
-		std::cout << "danceGame result: zeros point. " << std::endl;
-		return MOTION_STEP;
-	}
-
-	float angle = atan2(y, x);
-
-
-	if (angle > 0.0f)
-	{
-		if (angle < 1.5708)
-		{
-			std::cout << "danceGame result: right up. " << std::endl;
-			return MOTION_RIGHT_UP;
-		}
-		else
-		{
-			std::cout << "danceGame result: left up. " << std::endl;
-			return MOTION_LEFT_UP;
-		}
-	}
-	else
-	{
-		if (angle > -1.5708)
-		{
-			std::cout << "danceGame result: right down. " << std::endl;
-			return MOTION_RIGHT_DOWN;
-		}
-		else
-		{
-			std::cout << "danceGame result: left down. " << std::endl;
-			return MOTION_LEFT_DOWN;
-		}
-	}
-
-	return MOTION_STEP;
-}
-
-
-
-
-/*
-* 计算鞋子的全局位置
-*/
-
-int DanceFoot::calGlobalPos(float pos_g[3], int rssi, int zupt, int press, int* acc)
-{
-
-
-	float pos_zero[2] = { 0, 0 };
-
-	float pos_offset[2] = {0, 0};
-
-	float pos_g_offset[2] = { 0,0 };
-
-	pos_g_offset[0] = pos_g[0] - last_pos_g[0];
-	pos_g_offset[1] = pos_g[1] - last_pos_g[1];
-
-	if (zupt == 1)
-	{
-		if (last_zupt == 1)
-		{
-			pos_g_offset[0] = 0;
-			pos_g_offset[1] = 0;
-		}
-	}//略去惯导的补偿项,这样是避免补偿过大,导致跳舞的轨迹有拖尾情况
-
-	last_pos_g[0] = pos_g[0];
-	last_pos_g[1] = pos_g[1];
-
-	pos[0] += pos_g_offset[0];
-	pos[1] += pos_g_offset[1]; 
-
-
-	pos_offset[0] = pos[0] - last_pos[0];
-	pos_offset[1] = pos[1] - last_pos[1];
-
-	/*
-	if (fabsf(pos_offset[0]) > 10 || fabsf(pos_offset[1]) > 10)
-	{
-		std::cout << "dancegame receive unnormal pos_offset: " << pos_offset[0] << " " << pos_offset[1] << std::endl;
-		pos_offset[0] = 0; pos_offset[1] = 0;
-	}
-	*/
-
-	if (last_zupt == 1 && zupt == 1)
-	{
-		data.clear();
-		
-	}
-	if (zupt == 0 || (zupt == 1 && last_zupt == 0))
-	{
-		posData pos_data;
-		pos_data.pos_x = rotateCor[0] * (danceTraj[0] + pos_offset[0]) + rotateCor[1] * (danceTraj[1] + pos_offset[1]);
-		pos_data.pos_y = rotateCor[2] * (danceTraj[0] + pos_offset[0]) + rotateCor[3] * (danceTraj[1] + pos_offset[1]);
-
-		pos_data.rssi = rssi;
-
-		data.push_back(pos_data);
-	}
-
-	if (zupt == 1 && rssi < DANCEGAME_MIN_RSSI)
-	{
-		setLastPos(pos);
-
-		setDanceTraj(pos_zero);
-	}
-
-
-
-	if (zupt == 1 && last_zupt == 0)
-	{
-		/*
-		* 检测rssi的信号变化,为直线特征做准备
-		*/
-		int rssi_min = data[0].rssi;
-		int rssi_max = data[0].rssi;
-
-		int rssi_min_index = 0;
-		int rssi_max_index = 0;
-
-		float pos_x_min = data[0].pos_x;
-		float pos_x_max = data[0].pos_x;
-
-		float pos_y_min = data[0].pos_y;
-		float pos_y_max = data[0].pos_y;
-
-		int len = data.size();
-
-		for (int i = 0; i < data.size(); i++)
-		{
-			if (data[i].rssi < rssi_min)
-			{
-				rssi_min = data[i].rssi;
-				rssi_min_index = i;
-			}
-
-			if (data[i].rssi >= rssi_max)
-			{
-				rssi_max = data[i].rssi;
-
-				rssi_max_index = i;
-			}
-
-			if (data[i].pos_x > pos_x_max)
-			{
-				pos_x_max = data[i].pos_x;
-			}
-
-			if (data[i].pos_x < pos_x_min)
-			{
-				pos_x_min = data[i].pos_x;
-			}
-
-			if (data[i].pos_y > pos_y_max)
-			{
-				pos_y_max = data[i].pos_y;
-			}
-
-			if (data[i].pos_y < pos_y_min)
-			{
-				pos_y_min = data[i].pos_y;
-			}
-		}
-
-		if (data.size() > 5)
-		{
-			int rssiSignal = rssiFeature(data);
-
-			switch(rssiSignal)
-			{
-				case 1:
-
-					break;
-				case 2://回到原点
-					if(left_or_right == LEFT_FOOT)
-						danceTraj[0] = -0.15; 
-					else
-						danceTraj[0] = 0.15;
-
-					danceTraj[1] = 0.0;
-
-					pos_offset[0] = 0.0; pos_offset[1] = 0.0;
-					break;
-
-				case 0:
-
-					if (fabsf(data[0].pos_y - data[len - 1].pos_y) > 0.3&& fabsf(pos_x_max - pos_x_min) < 0.2)
-					{
-						/////////////////检测到有跨越象限的情况,左脚当然会经过y = 0的时候, 而x = 0.1则为一个经验值
-
-						std::cout << "detect pass special point" << std::endl;
-
-						float special_offset[2] = { 0, 0 };
-
-						float mid_x = 0.5 * (data[0].pos_x + data[len - 1].pos_x);
-
-						float mid_y = 0.5 * (data[0].pos_y + data[len - 1].pos_y);
-
-
-						if (pos_x_max - pos_x_min < 0.2)
-						{
-							if (left_or_right == LEFT_FOOT)
-							{
-								special_offset[0] = -0.2 - mid_x;
-							}
-							else
-							{
-								special_offset[0] = 0.2 - mid_x;
-							}
-
-						}
-
-						special_offset[1] = -mid_y;
-
-
-						pos_offset[0] = pos_offset[0] + special_offset[0];
-
-						pos_offset[1] = pos_offset[1] + special_offset[1];
-
-					}
-					/**/
-					//检测到横移的情况
-					else if (fabs(data[0].pos_x - data[len - 1].pos_x) > 0.3)
-					{
-						std::cout << "detected horizontal line by pos_x" << std::endl;
-
-						float special_offset[2] = { 0,0 };
-
-						float mid_x = 0.5 * (data[0].pos_x + data[len - 1].pos_x);
-
-						float mid_y = 0.5 * (data[0].pos_y + data[len - 1].pos_y);
-
-						if (pos_y_max - pos_y_min < 0.15)
-						{
-							if (left_or_right == LEFT_FOOT)
-							{
-								special_offset[0] = -0.15 - mid_x;
-
-							}
-							else
-							{
-								special_offset[0] = 0.15 - mid_x;
-							}
-
-							if (data[0].pos_y > 0)
-							{
-								special_offset[1] = 0.2 - mid_y;
-							}
-							else
-							{
-								special_offset[1] = -0.2 - mid_y;
-							}
-
-							std::cout << "debug :" << special_offset[0] << " " << special_offset[1] << std::endl;
-							pos_offset[0] = pos_offset[0] + special_offset[0];
-
-							pos_offset[1] = pos_offset[1] + special_offset[1];
-						}
-						/*
-						else
-						{
-							special_offset[0] = -mid_x;
-
-							if (rssi_min <= 35 && data[0].rssi - rssi_min > 10 && data[len - 1].rssi - rssi_min > 10)
-							{
-								special_offset[1] = -mid_y;
-							}
-
-							pos_offset[0] = pos_offset[0] + special_offset[0];
-
-							pos_offset[1] = pos_offset[1] + special_offset[1];
-
-							std::cout << "debug2 :" << special_offset[0] << " " << special_offset[1] << std::endl;
-
-						}
-						*/
-
-					}
-
-
-					break;
-				default:
-						break;
-		
-	
-			}
-
-		}
-		
-		if ((sqrt(pos_offset[0] * pos_offset[0] + pos_offset[1] * pos_offset[1]) < 0.1))
-		{
-			pos_offset[0] = 0; pos_offset[1] = 0;
-
-			if (acc_status == 0) 
-			{
-				std::cout << "appear error command on zero_vel status (dance__foot) " << endl;
-			}
-		}
-
-		danceTraj[0] = danceTraj[0] + pos_offset[0];
-		danceTraj[1] = danceTraj[1] + pos_offset[1];
-
-		
-		if (rssi < DANCEGAME_MIN_RSSI)
-		{
-			setDanceTraj(pos_zero);
-		}
-
-		setLastPos(pos);
-
-		pos_offset[0] = 0.0; pos_offset[1] = 0.0;
-
-		float dancePos[2];
-
-		dancePos[0] = rotateCor[0] * danceTraj[0] + rotateCor[1] * danceTraj[1];
-		dancePos[1] = rotateCor[2] * danceTraj[0] + rotateCor[3] * danceTraj[1];
-
-		pos_index = getGameDiretion(dancePos);
-	}
-
-	float dancePos[2];
-
-	dancePos[0] = rotateCor[0] * (danceTraj[0] + pos_offset[0]) + rotateCor[1] * (danceTraj[1] + pos_offset[1]);
-	dancePos[1] = rotateCor[2] * (danceTraj[0] + pos_offset[0]) + rotateCor[3] * (danceTraj[1] + pos_offset[1]);
-
-
-	setLastZupt(zupt);
-
-	gamePos[0] = dancePos[0];
-	gamePos[1] = dancePos[1];
-	gamePos[2] = pos_g[2];
-
-	if (zupt == 1)
-	{
-		zupt_count = 3;
-	}
-	else
-	{
-		zupt_count--;
-	}
-
-	if (zupt_count <= 0)
-	{
-		pos_index = -1;
-	}
-
-	acc_status = getAccStatus(zupt, acc, acc_max, acc_min);
-
-	return pos_index;
-
-}
-
-/*
-* 打印pos和RSSI的
-*/
-
-void DanceFoot::printPosData(vector<posData> data)
-{
-	for (int i = 0; i < data.size(); i++)
-	{
-		std::cout << data[i].pos_x << " " <<data[i].pos_y << " "<< data[i].rssi << std::endl;
-	}
-}
-
-/*
-* 通过位移以及RSSI来判断是否为原地踏步
-*/
-
-int DanceFoot::isMove(vector<posData> data)
-{
-	int n = data.size();
-
-	if (n <= 1)
-	{
-		return 0;
-	}
-
-	int rssi_left = data[0].rssi;
-	int rssi_right = data[(n-1)].rssi;
-
-	float x = data[0].pos_x - data[(n-1)].pos_x;
-	float y = data[0].pos_y - data[(n-1)].pos_y;
-
-	int rssi_min = rssi_left;
-
-	for (int i = 0; i < n; i++)
-	{
-		if (rssi_min > data[i].rssi)
-			rssi_min = data[i].rssi;
-	}
-		
-	if (abs(rssi_right - rssi_left) > 10 && rssi_min > 40
-		&& fabsf(x) > 0.1 )
-	{
-		std::cout << "检测到左右横移" << std::endl;
-
-		if (x < 0)
-			return -1;
-		else
-			return 1;
-	}
-
-	return 0;
-}
-
-/*
-* 设置上一次的last_pos
-*/
-void DanceFoot::setLastPos(float* lastPos)
-{
-	last_pos[0] = lastPos[0];
-	last_pos[1] = lastPos[1];
-}
-
-
-/*
-* 设置上一次的zupt
-*/
-
-void DanceFoot::setLastZupt(int lastZupt)
-{
-	last_zupt = lastZupt;
-}
-
-/*
-* 设置跳舞轨迹
-*/
-
-void DanceFoot::setDanceTraj(float* traj)
-{
-	if(left_or_right == LEFT_FOOT)
-		danceTraj[0] = traj[0] - 0.15;
-	else
-		danceTraj[0] = traj[0] + 0.15;
-
-	danceTraj[1] = traj[1];
-}
-
-/*
-* 计算斜率
-*/
-
-float DanceFoot::calSlope(vector<posData> data)
-{
-	int i = 0;
-	int len = data.size();
-
-	float x2_sum = 0, x_sum = 0, xy_sum = 0, y_sum = 0;
-
-	float slope = 0.0f;
-
-	for (i = 0; i < len; i++)
-	{
-		x2_sum += (data[i].pos_x * data[i].pos_x);
-
-		x_sum += (data[i].pos_x);
-		
-		y_sum += (data[i].pos_y);
-
-		xy_sum += (data[i].pos_x * data[i].pos_y);
-	}
-
-	//b = (x2_sum * y_sum - x_sum * xy_sum) / ((len * x2_sum) - x_sum * x_sum);
-
-	slope = (len * xy_sum - x_sum * y_sum) / (len * x2_sum - x_sum * x_sum);
-
-	std::cout << len << " " << x2_sum << " " << x_sum << " " << y_sum << " " << xy_sum << " " << atan(slope) << std::endl;
-
-	return slope;
-
-}
-
-float DanceFoot::calCor(vector<posData> data)
-{
-	//printPosData(data);
-
-	float start_x = data[0].pos_x;
-	float start_y = data[0].pos_y;
-
-	int len = data.size();
-
-	float end_x = data[len - 1].pos_x;
-	float end_y = data[len - 1].pos_y;
-
-	float a = start_y - end_y;
-	float b = -(start_x - end_x);
-
-	float c = start_x * end_y - start_y * end_x;
-
-	float d = 1 / sqrt(a * a + b * b);
-
-	float  distance = 0;
-	
-	for (int i = 0; i < len - 1; i++)
-	{
-		float diatance_tmp = (a * data[i].pos_x + b * data[i].pos_y + c) * d;
-
-		if (fabsf(diatance_tmp) > fabsf(distance))
-		{
-			distance = diatance_tmp;
-		}
-	}
-
-	return distance;
-}
-
-
-float DanceFoot::getGamePos(int index)
-{
-	if (index < 0 || index > 2)
-		return -1;
-	return gamePos[index];
-}
-
-int DanceFoot::rssiFeature(vector<posData> data)
-{
-	//printPosData(data);
-
-	int startRssi = data[0].rssi;
-	int dataLength = data.size();
-
-	int endRssi = data[dataLength - 1].rssi;
-
-	int minDistance = 99;
-
-	int minIndex = 0;//默认为从原点触发
-
-	int i = 0;
-
-	int min_rssi = data[0].rssi;
-
-	while (i < dataLength)
-	{
-		if (min_rssi > data[i].rssi)
-		{
-			min_rssi = data[i].rssi;
-
-			minIndex = i;
-		}
-
-		i++;
-	}
-
-	i = 0;
-
-	int maybeStraight = 0;
-
-	if (min_rssi < 25)
-	{
-		min_rssi = min_rssi + 2;
-	}
-
-	while (i < dataLength)
-	{
-		if (min_rssi >= data[i].rssi)
-		{
-			if (fabs(data[dataLength - 1].pos_y - data[i].pos_y) > 0.1 && fabs(data[0].pos_y - data[i].pos_y) > 0.1)
-			{
-				maybeStraight = 1;
-				break;
-			}
-		}
-		i++;
-	}
-
-	float length_tmp = sqrt((data[0].pos_y - data[dataLength - 1].pos_y) * (data[0].pos_y - data[dataLength - 1].pos_y)
-		+ (data[0].pos_x - data[dataLength - 1].pos_x) * (data[0].pos_x - data[dataLength - 1].pos_x));
-
-	if (endRssi < 28)
-	{
-		return 2;
-	}
-
-	if ((maybeStraight)|| (fabsf(data[0].pos_y - data[dataLength - 1].pos_y)>0.4 && fabsf(data[0].pos_x - data[dataLength - 1].pos_x) < 0.1))
-	{
-		std::cout << "Maybe straight line" << std::endl;
-		return 0;
-	}
-
-	if (startRssi < 28 && endRssi - startRssi > 10 && length_tmp > 0.08)
-	{
-		std::cout << "function debug: zero start!!!!!" << std::endl;
-		return 1; //标志为从原点出发
-	}
-
-	if ( endRssi < 28 && startRssi - endRssi > 10 && length_tmp > 0.08)
-	{
-		std::cout << "function debug: zero end!!!!!" << std::endl;
-		return 2; //标志回到原点
-	}
-
-
-	std::cout << "startRssi: " << startRssi << " endRssi: " << endRssi << " min_rssi: " << min_rssi << " length_tmp: " << length_tmp <<std::endl;
-	return 0; //则是标志为其他的特征
-}
-
-int DanceFoot::getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc)
-{
-	/*
-	* 在游戏测试的时候发现有左右乱飞的情况,现在以及乱跳的情况,现在用加速度过滤这一个情况
-	* 尽量不在嵌入式上修改
-	*/
-	if (zupt)
-	{
-		memcpy(max_acc, acc, 3 * sizeof(int));
-		memcpy(min_acc, acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (max_acc[i] < acc[i])
-			{
-				max_acc[i] = acc[i];
-			}
-
-			if (min_acc[i] > acc[i])
-			{
-				min_acc[i] = acc[i];
-			}
-		}
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		if (max_acc[i] - min_acc[i] > 1024)
-		{
-			return 1;
-		}
-	}
-
-	return 0;
-}
-
-

+ 0 - 107
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceFoot.h

@@ -1,107 +0,0 @@
-
-#ifndef __dance_foot_h__
-#define __dance_foot_h__
-
-
-#include "pub.h"
-
-class DanceFoot
-{
-	public:
-		DanceFoot(int LEFT_OR_RIGHT);
-		DanceFoot() {};//Ìí¼ÓÒ»¸öȱʡ¹¹Ô캯Êý
-
-		int setPosOffset(float Pos[3]);
-		int setPosGlobal(float Pos[3]);
-		int setAttitude(float att[3]);
-
-		int setFootZupt(int zupt);
-		int setFootRssi(int rssi);
-
-		int setMaxRssi(int rssi);
-		int setMinRssi(int rssi);
-
-		int isMoveRssi(int rssi, int zupt);
-
-		int calGlobalPos(float pos[3], int rssi, int zupt, int press);
-
-		int posBoundary(float pos[3]);
-
-		int isGlobalZero(float pos[3], float pos_offset[3], int rssi);
-
-		int getDirection(float pos[3], float pos_offset[3], int rssi);
-
-		int getDirectionCorner(float pos[3], float pos_offset[3]);
-
-		int getDirectionLine(float pos[3], float pos_offset[3]);
-
-		int getGameDiretion(float pos[3]);
-
-		void printPosData(vector<posData> data);
-
-		int isMove(vector<posData> data);
-
-		void setLastPos(float* lastPos);
-
-		void setLastZupt(int lastZupt);
-
-		void setDanceTraj(float* traj);
-
-		float calSlope(vector<posData> data);
-
-		float getGamePos(int index);
-
-		float calCor(vector<posData> data);
-
-		int rssiFeature(vector<posData> data);
-
-		int calGlobalPos(float pos_g[3], int rssi, int zupt, int press, int* acc);
-
-		int getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc);
-
-	private:
-
-
-		float gamePos[3];
-
-		float last_pos[2];
-
-		int last_zupt;
-
-		float danceTraj[2];
-
-		float rotate_err;
-
-		float rotateCor[4];
-
-		float last_pos_g[2] = { 0, 0 };
-
-		float pos[2] = { 0, 0 };
-
-		vector<posData> data;
-
-		int left_or_right;
-
-		int foot_rssi;
-		int foot_zupt;
-
-		int rssi_zupt;
-
-		int max_rssi;
-		int min_rssi;
-
-		float attitude[3];
-		float globalPos[3];
-		float offsetPos[3];
-
-		int pos_index;
-		int zupt_count;
-
-		int acc_status;
-
-		int acc_max[3];
-
-		int acc_min[3];
-};
-
-#endif

+ 0 - 265
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceGame.cpp

@@ -1,265 +0,0 @@
-
-#include "DanceGame.h"
-
-/*
-* 初始化DanceGame对象,分左右脚来判断
-*/
-
-DanceGame::DanceGame()
-{
-	leftFoot = DanceFoot(LEFT_FOOT);
-
-	rightFoot = DanceFoot(RIGHT_FOOT);
-
-	memset(result, -1, 4 * sizeof(int));
-
-	left_result = -1;
-	right_result = -1;
-
-	for (int i = 0; i < 3; i++)
-		for(int j = 0; j < 15; j++)
-	{
-			left_acc_buff[i][j] = 0;
-			right_acc_buff[i][j] = 0;
-	}
-
-}
-
-/*
-* DanceGame主接口,承接Game类的主要调用
-*/
-
-void  DanceGame::Process(int* right_pos, int* right_att, int *right_acc,int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int rssi)
-{
-	static int left_zupt_count = 0;
-	static int right_zupt_count = 0;
-	static float leftRotate[4] = { 1.0, 0.0, 0.0, 1.0 };
-	static float rightRotate[4] = { 1.0, 0.0, 0.0, 1.0 };
-
-	float left_acc_f[3], right_acc_f[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		left_acc_f[i] = left_acc[i] / 2048.f;
-		right_acc_f[i] = right_acc[i] / 2048.f;
-
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		for (int j = 0; j < 14; j++)
-		{
-			left_acc_buff[i][j] = left_acc_buff[i][j + 1];
-			right_acc_buff[i][j] = right_acc_buff[i][j + 1];
-		}
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		left_acc_buff[i][14] = left_acc_f[i];
-		right_acc_buff[i][14] = right_acc_f[i];
-	}
-
-	int left_zupt_acc =  isBalance(left_acc_buff);
-	int right_zupt_acc = isBalance(right_acc_buff);
-
-
-	if (left_zupt_acc && rssi < DANCEGAME_MIN_RSSI)
-	{
-		left_zupt = 1;
-	}
-
-	if (right_zupt_acc && rssi < DANCEGAME_MIN_RSSI)
-	{
-		right_zupt = 1;
-	}
-
-
-	if ((left_zupt || left_zupt_acc) && rssi < DANCEGAME_MIN_RSSI)
-	{
-		left_zupt_count++;
-	}
-	else
-	{
-		left_zupt_count = 0;
-	}
-
-	if ((right_zupt || right_zupt_acc) && rssi < DANCEGAME_MIN_RSSI)
-	{
-		//rotateTrajRight.ResetHeading(right_att[0]);
-		right_zupt_count++;
-	}
-	else
-	{
-		right_zupt_count = 0;
-	}
-
-	if (rssi > DANCEGAME_MIN_RSSI)
-	{
-		left_zupt_count = 0;
-		right_zupt_count = 0;
-	}
-
-	if (left_zupt_count > 100 && right_zupt_count > 100)
-	{
-		float leftTheta = float(left_att[0]) * 0.0001f;
-		float rightTheta = float(right_att[0]) * 0.0001f;
-
-		leftRotate[0] = cos(leftTheta); leftRotate[1] = sin(leftTheta);
-		leftRotate[2] = -sin(leftTheta); leftRotate[3] = cos(leftTheta);
-
-		rightRotate[0] = cos(rightTheta);  rightRotate[1] = sin(rightTheta);
-		rightRotate[2] = -sin(rightTheta); rightRotate[3] = cos(rightTheta);
-
-		std::cout << "matrix has inited!" << std::endl;
-
-		left_zupt_count = 0;
-		right_zupt_count = 0;
-
-
-	}
-
-	float left_pos_g[3];
-
-	float pos_tmp[2];
-
-	float right_pos_g[3];
-
-	pos_tmp[0] = leftRotate[0] * left_pos[0] * 0.01 + leftRotate[1] * left_pos[1] * 0.01;
-	pos_tmp[1] = leftRotate[2] * left_pos[0] * 0.01 + leftRotate[3] * left_pos[1] * 0.01;
-	
-	left_pos_g[0] = 0.9848 * pos_tmp[0] - 0.1736 * pos_tmp[1];
-	left_pos_g[1] = 0.1736 * pos_tmp[0] + 0.9848 * pos_tmp[1];
-
-	left_pos_g[2] = left_pos[2] * 0.01;
-
-	pos_tmp[0] = rightRotate[0] * right_pos[0] * 0.01 + rightRotate[1] * right_pos[1] * 0.01f;
-	pos_tmp[1] = rightRotate[2] * right_pos[0] * 0.01 + rightRotate[3] * right_pos[1] * 0.01f;
-
-	right_pos_g[0] = 0.9848 * pos_tmp[0] + 0.1736 * pos_tmp[1];
-	right_pos_g[1] = -0.1736 * pos_tmp[0] + 0.9848 * pos_tmp[1];
-
-	right_pos_g[2] = right_pos[2] * 0.01;
-
-	
-
-	int left_result_tmp, right_result_tmp;
-
-	left_result_tmp = leftFoot.calGlobalPos(left_pos_g, rssi, left_zupt, left_press, left_acc);
-
-
-	right_result_tmp = rightFoot.calGlobalPos(right_pos_g, rssi, right_zupt, right_press, right_acc);
-
-
-
-	if (left_result != left_result_tmp && left_result_tmp != -1)
-	{
-		result[0] = left_result_tmp;
-	}
-	else
-	{
-		result[0] = -1;
-	}
-	
-	if(left_result != -1 && left_result_tmp == -1)
-	{
-		result[0] = left_result | MOTION_CANCEL;
-	}
-	
-	left_result = left_result_tmp;
-
-
-	if (right_result != right_result_tmp && right_result_tmp != -1)
-	{
-		result[1] = right_result_tmp;
-	}
-	else
-	{
-		result[1] = -1;
-	}
-	
-	if (right_result != -1 && right_result_tmp == -1)
-	{
-		result[1] = right_result | MOTION_CANCEL;
-	}
-	
-	right_result = right_result_tmp;
-
-
-	/*
-	result[0] = leftFoot.calGlobalPos(left_pos_g, rssi, left_zupt, left_press);
-	result[1] = rightFoot.calGlobalPos(right_pos_g, rssi, right_zupt, right_press);
-	*/
-	
-}
-
-/*
-* 通过三轴加速度判断是否稳定
-*/
-
-int DanceGame::isBalance(float acc_buff[3][15])
-{
-	float max_val[3];
-	float min_val[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		max_val[i] = acc_buff[i][0];
-		min_val[i] = acc_buff[i][0];
-	}
-	for (int i = 0; i < 3; i++)
-	{
-		for (int j = 0; j < 15; j++)
-		{
-			if (acc_buff[i][j] > max_val[i])
-			{
-				max_val[i] = acc_buff[i][j];
-			}
-
-			if (acc_buff[i][j] < min_val[i])
-			{
-				min_val[i] = acc_buff[i][j];
-			}
-		}
-	}
-
-	if (max_val[0] - min_val[0] < 0.05f && max_val[1] - min_val[1] < 0.05f && max_val[2] - min_val[2] < 0.05f)
-	{	
-		return 1;
-		/*
-		if (fabsf(min_val[0]) < 0.2f && fabsf(max_val[0]) < 0.2f
-			&& fabsf(min_val[1]) < 0.2f && fabsf(max_val[1]) < 0.2f
-			&& min_val[2] > 0.94f && max_val[2] < 1.6f)
-		{
-			std::cout << "test" << endl;
-			return 1;
-		}
-		*/
-	}
-
-	return 0;
-}
-
-/*
-* 获取跳舞游戏结果
-*/
-
-void DanceGame::getResult(int *matrix)
-{
-	memcpy(matrix, result, 4 * sizeof(int));
-}
-
-
-float DanceGame::getGamePos(int left_or_right, int index)
-{
-	if (index < 0 || index > 2)
-		return -1;
-
-	if (left_or_right == LEFT_FOOT)
-		return leftFoot.getGamePos(index);
-	else
-		return rightFoot.getGamePos(index);
-}
-

+ 0 - 39
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/DanceGame.h

@@ -1,39 +0,0 @@
-#pragma once
-#ifndef __dance_game_h__
-#define __dance_game_h__
-
-#include "DanceFoot.h"
-
-class DanceGame {
-
-	public :
-		DanceGame();
-
-		//void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos, int* left_att, int left_zupt, int jump, int down, int rssi);
-		void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-			int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-			int jump, int down, int rssi);
-
-		void getResult(int *matrix);
-
-		float getGamePos(int left_or_right, int index);
-
-		int isBalance(float acc_buff[3][15]);
-
-	private:
-
-		DanceFoot leftFoot;
-		DanceFoot rightFoot;
-
-		int result[4];
-
-		int left_result;
-		int right_result;
-
-		float left_acc_buff[3][15];
-		float right_acc_buff[3][15];
-
-
-};
-
-#endif

+ 0 - 129
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/FootStep.cpp

@@ -1,129 +0,0 @@
-#include "FootStep.h"
-
-FootStep::FootStep()
-{
-	/*
-		初始化均为0
-	*/
-	stepStatus = 0;
-	stepFreq = 0;
-	stepTag = 0;
-	zuptCount = 0;
-
-	lastZupt = 1;
-
-	leaveFloorTime1 = 0;
-	leaveFloorTime2 = 0;
-
-	leaveTimeStatus = 1;
-
-	catchFloorTime = 0;
-
-	localTime = 0;
-
-	last_time_stamp = 0;
-
-	stepCount = 0;
-
-	memset(last_pos, 0, 3 * sizeof(int));
-}
-
-void FootStep::stepCal(int timeStamp, int pos[3], int zupt, int girl_shoes)
-{
-	//计算累计的时间
-	static int stepFreqBuff[5];
-	static int buffIndex;
-
-	if (zupt)
-	{
-		memcpy(last_pos, pos, 3 * sizeof(int));
-	}
-
-	int pos_tmp[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		pos_tmp[i] = pos[i] - last_pos[i];
-	}
-
-	int timeDistance;
-	if (timeStamp - last_time_stamp < 0)
-	{
-		timeDistance = 256 + timeStamp - last_time_stamp;
-	}
-	else
-	{
-		timeDistance = timeStamp - last_time_stamp;
-	}
-
-	last_time_stamp = timeStamp;
-
-	localTime += timeDistance;
-
-
-	if (pos_tmp[0] * pos_tmp[0] + pos_tmp[1] * pos_tmp[1] + pos_tmp[2] * pos_tmp[2] > 0)
-	{
-		stepTag = 1;
-	}
-
-
-	if (lastZupt == 0 && zupt == 1 && stepTag == 1 )
-	{
-		
-		int walkTime = 8 * (localTime - leaveFloorTime1);
-
-		// 模块发过来的频率为40ms发一次,所以一秒能发25次,
-		//所以计算步频的话一分钟除以walkTime 再除以一个2
-
-		stepFreq = 60 * 1000 / walkTime;
-
-		if (girl_shoes)
-		{
-			stepFreq *= 2;
-		}
-		
-
-		leaveFloorTime1 = localTime;
-		
-		stepTag = 0;
-
-		stepCount++;
-	}
-
-	lastZupt = zupt;
-	
-	if (zupt == 1)
-		zuptCount++;
-	else
-		zuptCount = 0;
-
-	if (zuptCount > 50)
-	{
-		stepStatus = 0;
-		stepFreq = 0;
-		stepTag = 0;
-	}
-
-}
-
-int FootStep::getStepFreq()
-{
-	return stepFreq;
-}
-
-int FootStep::getStepStatus()
-{
-	if (stepFreq == 0)
-		return 0;
-
-	else if (stepFreq > 130)
-		return 2;
-
-	else
-		return 1;
-}
-
-int FootStep::getStepCount()
-{
-	return stepCount;
-}

+ 0 - 49
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/FootStep.h

@@ -1,49 +0,0 @@
-#pragma once
-#ifndef _FootStep_H
-#define _FootStep_H
-
-#include <iostream>
-
-class FootStep
-{
-public:
-
-	FootStep();
-
-	//void stepCal(int timeStamp, int pos[3], int zupt);
-
-	void stepCal(int timeStamp, int pos[3], int zupt, int girl_shoes);
-
-	int getStepFreq();
-	int getStepStatus();
-
-	int getStepCount();
-
-private:
-
-	int stepStatus;//脚步状态 0 1 2
-	int stepFreq;	//脚步步频 分钟为单位
-	int stepTag;	//计算步数所用
-	int zuptCount;
-	
-	int localTime;
-	int last_time_stamp;
-
-	int leaveFloorTime;
-
-	int leaveFloorTime1;
-	int leaveFloorTime2;
-
-	int leaveTimeStatus;
-
-	int catchFloorTime;
-
-	int lastZupt;
-
-	int stepCount;
-
-	int last_pos[3];
-
-};
-
-#endif

+ 0 - 592
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Game.cpp

@@ -1,592 +0,0 @@
-#include "Game.h"
-
-Game::Game(int gametype)
-{
-	GameType = gametype;
-
-	rotateTrajLeft = InertialTrajProcess();
-	rotateTrajRight = InertialTrajProcess();
-
-	leftFootStep = FootStep();
-	rightFootStep = FootStep();
-
-	publicmotion = publicMotion();
-
-	rotateMatrix[0] = 1.0f;
-	rotateMatrix[1] = 0.0f;
-	rotateMatrix[2] = 0.0f;
-	rotateMatrix[3] = 1.0f;
-
-	leftStepRate = 0;
-	rightStepRate = 0;
-
-	leftRate = 0;
-	rightRate = 0;
-
-	last_down = 0;
-	last_jump = 0;
-
-	down_count = 0;
-	jump_count = 0;
-
-	last_left_step = 0;
-	last_right_step = 0;
-
-	down_wait = 0;
-	avoid_down_between_jump = 0;
-
-	interaction = Interaction();
-
-	InteractionCMD = -1;
-
-	shoes_down = 0;
-
-	if (GameType == RUNGAME)
-	{
-		rungame = RunGame();
-	}
-	else if (GameType == DANCEGAME)
-	{
-		dancegame = DanceGame();
-	}
-
-	else if (GameType == ORIGINTRAJ)
-	{
-		originTraj = OriginTraj();
-	}
-
-	else if (GameType == H5GAME)
-	{
-		jumpH5game = jumpH5();
-	}
-
-	else if (GameType == MONSTER)
-	{
-		monsterH5 = MonsterH5();
-	}
-
-	else if (GameType == RUINS)
-	{
-		ruinsExplore = RuinsExplore();
-	}
-	else if (GameType == CYCLE)
-	{
-		tricycle = Tricycle();
-	}
-
-	else if (GameType == BIGFOOT)
-	{
-		bigfoot = BigFoot();
-	}
-	
-	else if (GameType == TESTGAME)
-	{
-		testgame = testGame();
-	}
-	
-
-}
-
-int Game::getInteractionCMD()
-{
-	return InteractionCMD;
-}
-
-void Game::processCalorieData(int down, int jump)
-{
-
-	if (down)
-	{
-		down_wait = 20;
-	}
-
-	if (jump)
-	{
-		avoid_down_between_jump = 20;
-	}
-
-	if (avoid_down_between_jump > 0 && h_zupt == 0 && s_zupt == 0)
-	{
-		avoid_down_between_jump = 20;
-	}
-
-	if (avoid_down_between_jump > 0 && down == 1)
-	{
-		avoid_down_between_jump = 20;
-	}
-
-	if (avoid_down_between_jump > 0)
-	{
-		down_wait = 0;
-		down = 0;
-		last_down = 0;
-	}
-
-	if (down_wait > 0)
-	{
-		down = 1;
-
-		down_wait --;
-	}
-
-	if (avoid_down_between_jump)
-	{
-		avoid_down_between_jump--;
-	}
-	
-	if (down == 0 && last_down == 1)
-	{
-		down_count++;
-
-		std::cout << "蹲的次数 : " << down_count << endl;
-	}
-
-	if (last_jump == 0 && jump == 1)
-	{
-		jump_count++;
-		std::cout << "跳的次数 : " << jump_count << endl;
-
-	}
-
-	last_down = down;
-	last_jump = jump;
-}
-
-
-int Game::getGameDownCount()
-{
-	return down_count;
-}
-
-int Game::getGameJumpCount()
-{
-	return jump_count;
-}
-
-int Game::onlineDownEstimate()
-{
-	if (posTimeStamp % 8 != 0)
-	{
-		return 0;
-	}
-
-
-}
-
-void Game::GameProcess(int timeStamp, int* right_pos, int* right_att, int *right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press, 
-	int jump, int down, int rssi, int girl_shoes)
-{
-
-	leftFootStep.stepCal(timeStamp, left_pos, left_zupt, girl_shoes);
-
-	rightFootStep.stepCal(timeStamp, right_pos, right_zupt, girl_shoes);
-	
-	
-	interaction.Process(gameTime, right_pos, right_att, right_acc, right_zupt, right_press,
-		left_pos, left_att, left_acc, left_zupt, left_press,
-		jump, down, rssi);
-
-	InteractionCMD = interaction.get_motion_state();
-
-	processCalorieData(down, jump);
-	
-	
-	if (GameType == RUNGAME)
-	{
-		//跑酷游戏处理函数
-
-	
-		rungame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, rssi);
-
-		//跑酷游戏处理结果获取
-		rungame.getResult(resultMatrix);
-	}
-	else if (GameType == DANCEGAME)
-	{
-		dancegame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, rssi);
-
-		dancegame.getResult(resultMatrix);
-	}
-	else if (GameType == ORIGINTRAJ)
-	{
-		originTraj.Process(right_pos, right_att, right_zupt, left_pos, left_att, left_zupt);
-	}
-
-	else if (GameType == H5GAME)
-	{
-		if (left_zupt)
-		{
-			rotateTrajLeft.ResetHeading(left_att[0]);
-		}
-		rotateTrajLeft.TrajRotate(left_pos);
-
-		if (right_zupt)
-		{
-			rotateTrajRight.ResetHeading(right_att[0]);
-		}
-		rotateTrajRight.TrajRotate(right_pos);
-
-		jumpH5game.Process(right_pos, right_att, right_acc, right_press, right_zupt,
-			left_pos, left_att, left_acc, left_press, left_zupt, jump, timeStamp, rssi);
-		jumpH5game.getResult(resultMatrix);
-	}
-
-	else if (GameType == MONSTER)
-	{
-		monsterH5.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press,
-			jump, down, rssi);
-
-		monsterH5.getResult(resultMatrix);
-	}
-
-	else if (GameType == RUINS)
-	{
-
-		ruinsExplore.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		//跑酷游戏处理结果获取
-		ruinsExplore.getResult(resultMatrix);
-	}
-
-	else if (GameType == CYCLE)
-	{
-
-		if (left_zupt)
-		{
-			rotateTrajLeft.ResetHeading(left_att[0]);
-		}
-		rotateTrajLeft.TrajRotate(left_pos);
-
-
-		if (right_zupt)
-		{
-			rotateTrajRight.ResetHeading(right_att[0]);
-		}
-		rotateTrajRight.TrajRotate(right_pos);
-
-
-		tricycle.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		tricycle.getResult(resultMatrix);
-
-		left_att[0] = resultMatrix[0];
-		resultMatrix[0] = -1;
-		resultMatrix[1] = -1;
-	}
-
-	else if (GameType == BIGFOOT)
-	{
-
-		bigfoot.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		//跑酷游戏处理结果获取
-		bigfoot.getResult(resultMatrix);
-	}
-
-	else if (GameType == TESTGAME)
-	{
-		testgame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		testgame.getResult(resultMatrix);
-	}
-	
-	/*
-	if (foot_data_file.is_open()&& GameType == DANCEGAME)
-	{
-		foot_data_file << timeStamp << " " << dancegame.getGamePos(LEFT_FOOT, 0) << " " << dancegame.getGamePos(LEFT_FOOT, 1) << " " << left_zupt <<
-			" " << dancegame.getGamePos(RIGHT_FOOT, 0) << " " << dancegame.getGamePos(RIGHT_FOOT, 1) << " " << right_zupt << " " << rssi
-			<< " " << bingo << std::endl;
-
-		bingo = 0;
-	}
-	*/
-	
-}
-
-void Game::RunGameProcess(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int girl_shoes)
-{
-	rungame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-		left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-}
-
-
-void Game::getGameResult(int* matrix)
-{
-	memcpy(matrix, resultMatrix, 4 * sizeof(int));
-}
-
-int Game::getStepStatus(int left_or_right)
-{
-	if (left_or_right == LEFT_FOOT)
-		return leftFootStep.getStepStatus();
-
-	else if (left_or_right == RIGHT_FOOT)
-		return rightFootStep.getStepStatus();
-
-	else
-		return -1;
-}
-
-int Game::getStepFreq( int left_or_right)
-{
-	if (left_or_right == LEFT_FOOT)
-		return leftFootStep.getStepFreq();
-
-	else if (left_or_right == RIGHT_FOOT)
-		return rightFootStep.getStepFreq();
-
-	else
-		return -1;
-}
-
-
-int Game::getStepCount(int left_or_right)
-{
-	if (left_or_right == LEFT_FOOT)
-		return leftFootStep.getStepCount();
-
-	else if (left_or_right == RIGHT_FOOT)
-		return rightFootStep.getStepCount();
-
-	else
-		return -1;
-}
-
-float Game::getGamePos(int left_or_right, int index)
-{
-	if (index < 0 || index >2)
-		return -1;
-
-	if (GameType == RUNGAME)
-	{
-		return rungame.getGamePos(left_or_right, index);
-	}
-	else if(GameType == DANCEGAME)
-	{
-		return dancegame.getGamePos(left_or_right, index);
-	}
-	else if (GameType == ORIGINTRAJ)
-	{
-		return originTraj.getGamePos(left_or_right, index);
-	}
-	else
-	{
-		return -1;
-	}
-}
-
-string Game::getVersion()
-{
-	return GAME_VERSION;
-}
-
-string Game::getGameDataStr()
-{
-	string data_str_temp = "";
-
-	//先记录右边
-
-	data_str_temp = data_str;
-
-	data_str = "";
-
-	return data_str_temp;
-
-}
-
-
-void Game::setGameDataStr()
-{
-	if (data_str.size() != 0)
-	{
-		data_str = "";
-	}
-	data_str += (to_string(right_pos_data[0]) + "," + to_string(right_pos_data[1]) + "," + to_string(right_pos_data[2]) + ",");
-	data_str += (to_string(right_att_data[0]) + "," + to_string(right_att_data[1]) + "," + to_string(right_att_data[2]) + ",");
-	data_str += (to_string(right_acc_data[0]) + "," + to_string(right_acc_data[1]) + "," + to_string(right_acc_data[2]) + ",");
-
-	data_str += (to_string(right_front_mag) + "," + to_string(right_back_mag) + "," + to_string(s_zupt) + ",");
-
-	data_str += (to_string(left_pos_data[0]) + "," + to_string(left_pos_data[1]) + "," + to_string(left_pos_data[2]) + ",");
-	data_str += (to_string(left_att_data[0]) + "," + to_string(left_att_data[1]) + "," + to_string(left_att_data[2]) + ",");
-	data_str += (to_string(left_acc_data[0]) + "," + to_string(left_acc_data[1]) + "," + to_string(left_acc_data[2]) + ",");
-
-	data_str += (to_string(left_front_mag) + "," + to_string(left_back_mag) + "," + to_string(h_zupt) + ",");
-
-	data_str += (to_string(down) + "," + to_string(jump) + "," + to_string(rssi) + "," + to_string(posTimeStamp) + ",");
-
-	data_str += (to_string(right_step) + "," + to_string(left_step) + "," + to_string(shoes_down) );
-
-}
-
-void Game::getFootAtt(int* left_att, int* right_att)
-{
-	memcpy(right_att, right_att_data, 3 * sizeof(int));
-	memcpy(left_att, left_att_data, 3 * sizeof(int));
-	
-}
-
-
-//解析鞋子的数据
-void Game::GameProcessBuf(uint8_t* buf, int len) {
-
-	static int last_game_time;
-
-	right_pos_data[0] = int32_t(buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3] << 0);
-	right_pos_data[1] = int32_t(buf[4] << 24 | buf[5] << 16 | buf[6] << 8 | buf[7] << 0);
-	right_pos_data[2] = int32_t(buf[8] << 24 | buf[9] << 16 | buf[10] << 8 | buf[11] << 0);
-
-	left_pos_data[0] = int32_t(buf[12] << 24 | buf[13] << 16 | buf[14] << 8 | buf[15] << 0);
-	left_pos_data[1] = int32_t(buf[16] << 24 | buf[17] << 16 | buf[18] << 8 | buf[19] << 0);
-	left_pos_data[2] = int32_t(buf[20] << 24 | buf[21] << 16 | buf[22] << 8 | buf[23] << 0);
-
-	right_att_data[0] = int16_t(buf[24] << 8 | buf[25] << 0);
-	right_att_data[1] = int16_t(buf[26] << 8 | buf[27] << 0);
-	right_att_data[2] = int16_t(buf[28] << 8 | buf[29] << 0);
-
-	left_att_data[0] = int16_t(buf[30] << 8 | buf[31] << 0);
-	left_att_data[1] = int16_t(buf[32] << 8 | buf[33] << 0);
-	left_att_data[2] = int16_t(buf[34] << 8 | buf[35] << 0);
-
-	right_acc_data[0] = int16_t(buf[36] << 8 | buf[37] << 0);
-	right_acc_data[1] = int16_t(buf[38] << 8 | buf[39] << 0);
-	right_acc_data[2] = int16_t(buf[40] << 8 | buf[41] << 0);
-
-	left_acc_data[0] = int16_t(buf[42] << 8 | buf[43] << 0);
-	left_acc_data[1] = int16_t(buf[44] << 8 | buf[45] << 0);
-	left_acc_data[2] = int16_t(buf[46] << 8 | buf[47] << 0);
-
-	girl_shoes = (buf[48] & 0x16) >> 4;
-
-	s_zupt = (buf[48] & 0x08) >> 3;
-
-	h_zupt = (buf[48] & 0x04) >> 2;
-
-	shoes_down = (buf[48] & 0x02) >> 1;
-
-	jump = (buf[48] & 0x01) >> 0;
-
-	rssi = (int) buf[49];
-
-	posTimeStamp = buf[50];
-
-	if (lastTimeStamp == -1)
-	{
-		lastTimeStamp = posTimeStamp;
-
-		return;
-
-	}
-
-
-	if (posTimeStamp - lastTimeStamp > - 100 && posTimeStamp - lastTimeStamp <=0)
-	{
-		std::cout << "receive old shoes package ( lastTimeStamp : " << lastTimeStamp << " posTimeStamp : " << posTimeStamp << " )" <<endl;
-
-		lastTimeStamp = posTimeStamp;
-
-		return;
-	}
-
-
-	gameTime += (posTimeStamp - lastTimeStamp < 0 ? posTimeStamp - lastTimeStamp + 256 : posTimeStamp - lastTimeStamp);
-
-	lastTimeStamp = posTimeStamp;
-
-
-	right_front_mag = uint16_t(buf[51] << 8 | buf[52] << 0);
-	right_back_mag = uint16_t(buf[53] << 8 | buf[54] << 0);
-
-	left_front_mag = uint16_t(buf[55] << 8 | buf[56] << 0);
-	left_back_mag = uint16_t(buf[57] << 8 | buf[58] << 0);
-
-	if (len > 59)
-	{
-		right_step = uint32_t(buf[59] << 24 | buf[60] << 16 | buf[61] << 8 | buf[62] << 0);
-		left_step = uint32_t(buf[63] << 24 | buf[64] << 16 | buf[65] << 8 | buf[66] << 0);
-	}
-	else
-	{
-		right_step = 0;
-		left_step = 0;
-	}
-
-	/*
-	* 利用步数来弥补丢失的触地信号,(PU鞋垫真几把垃圾)
-	*/
-
-	if (last_left_step != left_step)
-	{
-		h_zupt = 1;
-	}
-
-	if (last_right_step != right_step)
-	{
-		s_zupt = 1;
-	}
-
-	last_left_step = left_step;
-
-	last_right_step = right_step;
-
-	//SDK来判断蹲
-	if (publicmotion.getDownData(left_front_mag, right_front_mag, left_back_mag, right_back_mag))
-	{
-		down = 1;
-		//std::cout << "SDK down valic" << endl;
-	}
-	else
-	{
-		down = 0;
-	}
-	
-	GameProcess(gameTime,
-		right_pos_data, right_att_data, right_acc_data, s_zupt, (int)right_front_mag,
-		left_pos_data, left_att_data, left_acc_data, h_zupt, (int)left_front_mag,
-		jump, shoes_down, rssi, girl_shoes);
-	
-
-	setGameDataStr();
-
-}
-
-//游戏开始的时候触发的动作
-void Game::start(string path_root)
-{
-	string game_name;
-	
-	if (GameType == RUNGAME)
-	{
-		game_name = "rungame";
-	}
-	else if (GameType == DANCEGAME)
-	{
-		game_name = "dancegame";
-	}
-
-	stringstream ss;
-
-	ss << time(NULL);
-
-	foot_data_file.open(path_root + '/'+game_name + "_" + ss.str() + ".txt", fstream::out);
-}
-
-void Game::end()
-{
-	foot_data_file.close();
-}
-
-void Game::isBingo()
-{
-	bingo = 1;
-}

+ 0 - 180
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Game.h

@@ -1,180 +0,0 @@
-#pragma once
-#ifndef _Game_H_
-#define _Game_H_
-
-#include "pub.h"
-#include "RunGame.h"
-
-#include "InertialTrajProcess.h"
-#include "DanceGame.h"
-
-#include "FootStep.h"
-#include "Interaction.h"
-
-#include "jumpH5.h"
-#include "MonsterH5.h"
-
-#include "OriginTraj.h"
-
-#include "RuinsExplore.h"
-
-#include "Tricycle.h"
-
-#include "BigFoot.h"
-
-#include "publicMotion.h"
-
-#include "testGame.h"
-
-#include <fstream>
-#include <time.h>
-#include <sstream>
-
-class Game
-{
-		public:
-			Game(int gametype);
-
-			void GameProcess(int timeStamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-				int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-				int jump, int down, int rssi, int girl_shoes);
-
-			void GameProcessBuf(uint8_t* buf, int len);
-
-			void RunGameProcess(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-				int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-				int jump, int down, int girl_shoes);
-
-			void getGameResult(int* matrix);
-
-			void getFootAtt(int* left_att, int* right_att);
-
-			string getGameDataStr();
-
-			int getStepStatus(int left_or_right);
-			int getStepFreq(int left_or_right);
-			int getStepCount(int left_or_right);
-
-			float getGamePos(int left_or_right, int index);
-
-			string getVersion();
-
-			void start(string path_root);
-			void end();
-			void isBingo();
-
-			int getInteractionCMD();
-
-			void processCalorieData(int down, int jump);
-
-			int getGameDownCount();
-
-			int getGameJumpCount();
-
-			int onlineDownEstimate();
-
-			void setGameDataStr();
-
-		private:
-
-			int GameType;
-			RunGame rungame;
-			DanceGame dancegame;
-
-			InertialTrajProcess rotateTrajLeft;
-			InertialTrajProcess rotateTrajRight;
-
-			MonsterH5 monsterH5;
-
-			Interaction interaction;
-
-			FootStep leftFootStep;
-			FootStep rightFootStep;
-
-			OriginTraj originTraj;
-
-			jumpH5 jumpH5game;
-
-			RuinsExplore ruinsExplore;
-
-			Tricycle tricycle;
-
-			BigFoot bigfoot;
-
-			publicMotion publicmotion;
-
-			testGame testgame;
-
-			int leftStepRate;
-			int rightStepRate;
-			
-			int leftRate;
-			int rightRate;
-
-			int resultMatrix[4];
-
-			float rotateMatrix[4];
-
-			float leftRotate[4];
-			
-			float rightRotate[4];
-
-			fstream foot_data_file;
-
-			int bingo = 0;
-
-			int InteractionCMD;
-
-			int right_pos_data[3];
-			int right_att_data[3];
-
-			int left_pos_data[3];
-			int left_att_data[3];
-
-			int left_acc_data[3];
-			int right_acc_data[3];
-
-			int girl_shoes;
-
-			int s_zupt;
-			int h_zupt;
-
-			int down;
-			int jump;
-
-			int rssi;
-
-			int posTimeStamp;
-			int attTimeStamp;
-
-			uint32_t gameTime = 0;
-			int lastTimeStamp = -1;
-
-			uint16_t right_front_mag;
-			uint16_t right_back_mag;
-
-			uint16_t left_front_mag;
-			uint16_t left_back_mag;
-
-			uint32_t right_step;
-			uint32_t left_step;
-
-			int down_count;
-			int jump_count;
-			
-			int last_down;
-			int last_jump;
-
-			int down_wait;
-			int avoid_down_between_jump;
-
-			uint32_t last_left_step;
-			uint32_t last_right_step;
-
-			string data_str;
-
-			int shoes_down;
-
-};
-
-#endif

+ 0 - 68
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/InertialTrajProcess.cpp

@@ -1,68 +0,0 @@
-
-#include "InertialTrajProcess.h"
-#include <math.h>
-
-void InertialTrajProcess::TrajRotate(int *pos, float rotateMatrix[4])
-{
-	/*
-		本函数为将地理坐标的航向转移到自定义的X方向(鞋子朝向)
-	*/
-	float pos_f[3];
-
-	pos_f[2] = float(pos[2]) * 0.01f;
-	pos_f[1] = float(pos[1]) * 0.01f;
-	pos_f[0] = float(pos[0]) * 0.01f;
-
-	float posTemp[3];
-
-	posTemp[2] = pos_f[2];
-
-	posTemp[0] = rotateMatrix[0] * float(pos_f[0]) + rotateMatrix[1] * float(pos_f[1]);
-	posTemp[1] = rotateMatrix[2] * float(pos_f[0]) + rotateMatrix[3] * float(pos_f[1]);
-
-
-	pos[0] = (int)(posTemp[0] * 100.0f);
-	pos[1] = (int)(posTemp[1] * 100.0f);
-	pos[2] = (int)(posTemp[2] * 100.0f);
-}
-void InertialTrajProcess::TrajRotate(int* pos)
-{
-	/*
-		本函数为将地理坐标的航向转移到硬件所指的X方向(鞋子朝向)
-	*/
-	float pos_f[3];
-
-	pos_f[2] = float(pos[2]) * 0.01f;
-	pos_f[1] = float(pos[1]) * 0.01f;
-	pos_f[0] = float(pos[0]) * 0.01f;
-
-	float posTemp[3];
-
-	posTemp[2] = pos_f[2];
-
-	posTemp[0] = cos(curheading) * float(pos_f[0]) + sin(curheading) * float(pos_f[1]);
-	posTemp[1] = -sin(curheading) * float(pos_f[0]) + cos(curheading) * float(pos_f[1]);
-
-	
-	pos[0] = (int)(posTemp[0] * 100.0f);
-	pos[1] = (int)(posTemp[1] * 100.0f);
-	pos[2] = (int)(posTemp[2] * 100.0f);
-
-	//std::cout << "DanceGame:Rotate : " << pos[0] << " " << pos[1] << " " << pos[2] << std::endl;
-}
-
-void InertialTrajProcess::ResetHeading(int heading)
-{
-	/*
-		重置朝向
-	*/
-	curheading = (float)(heading  * 0.0001f);
-}
-
-InertialTrajProcess::InertialTrajProcess()
-{
-	memset(shoesPos, 0, 3 * sizeof(int));
-	
-	curheading = 0.0f;
-}
-

+ 0 - 20
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/InertialTrajProcess.h

@@ -1,20 +0,0 @@
-#pragma once
-
-#ifndef _inertialtrajprocess_h_
-#define _inertialtrajprocess_h_
-
-#include <iostream>
-
-class InertialTrajProcess
-{
-	public:
-		InertialTrajProcess();
-		void TrajRotate(int* pos);
-		void TrajRotate(int *pos, float rotateMatrix[4]);
-		void ResetHeading(int heading);
-
-	private:
-		int shoesPos[3];
-		float curheading;
-};
-#endif

+ 0 - 150
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Interaction.cpp

@@ -1,150 +0,0 @@
-
-
-#include "Interaction.h"
-
-
-Interaction::Interaction()
-{
-	rotateTrajLeft = InertialTrajProcess();  
-	rotateTrajRight = InertialTrajProcess();
-
-	same_zupt_count = 0;
-	canEnter = 0;
-
-	memset(left_last_pos, 0, 3 * sizeof(float));
-	memset(right_last_pos, 0, 3 * sizeof(float));
-	
-	memset(left_last_pos_tmp, 0, 3 * sizeof(float));
-	memset(right_last_pos_tmp, 0, 3 * sizeof(float));
-
-	motion_state = -1;
-
-	can_report_motion_state = 0;
-
-	leftFootAction = SingleFootAction(LEFT_FOOT);
-	rightFootAction = SingleFootAction(RIGHT_FOOT);
-
-	time_interval = 0;
-}
-
-int Interaction::get_motion_state()
-{
-	return motion_state;
-}
-
-
-void Interaction::Process(uint32_t _time, int32_t* right_pos, int* right_att, int *right_acc,int right_zupt, int right_press,
-	int32_t* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press, int jump, int down, int rssi)
-{
-	int32_t right_pos_org[3]; int32_t left_pos_org[3];
-
-	memcpy(right_pos_org, right_pos, 3 * sizeof(int32_t));
-	memcpy(left_pos_org, left_pos, 3 * sizeof(int32_t));
-
-	if (left_zupt && right_zupt && rssi < 30)
-	{
-		rotateTrajLeft.ResetHeading(left_att[0] - 1745);
-
-		rotateTrajRight.ResetHeading(right_att[0] + 1745);
-	}
-	rotateTrajRight.TrajRotate(right_pos_org);
-	rotateTrajLeft.TrajRotate(left_pos_org);
-
-	if (left_zupt)
-	{
-		memcpy(left_last_pos, left_pos_org, 3 * sizeof(int32_t));
-	}
-
-	if (right_zupt)
-	{
-		memcpy(right_last_pos, right_pos_org, 3 * sizeof(int32_t));
-	}
-
-	int left_pos_tmp[3];
-	int right_pos_tmp[3];
-
-	float right_acc_f[3];
-	float left_acc_f[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		left_pos_tmp[i] = left_pos_org[i] - left_last_pos[i];
-		right_pos_tmp[i] = right_pos_org[i] - right_last_pos[i];
-
-		right_acc_f[i] = right_acc[i] / 2048.0f;
-		left_acc_f[i]  = left_acc[i] / 2048.0f;
-	}
-
-	//std::cout << "right_acc_f : " << right_acc_f[0] << ", " << right_acc_f[1] << ", " << right_acc_f[2] << endl;
-
-	//if (left_zupt == 0)
-	//{
-	//	std::cout << "left_pos_tmp : " << left_pos_tmp[0] << ", " << left_pos_tmp[1] << ", " << left_pos_tmp[2] << endl;
-	//}
-
-	leftFootAction.run(_time, left_pos_tmp[0], left_pos_tmp[1], left_pos_tmp[2], left_zupt, rssi, left_att[1] * 0.0001f, left_acc_f);
-
-	rightFootAction.run(_time, right_pos_tmp[0], right_pos_tmp[1], right_pos_tmp[2], right_zupt, rssi, right_att[1] * 0.0001f, right_acc_f);
-
-	FootActionState left_motion = leftFootAction.get_interation_state();
-	FootActionState right_motion = rightFootAction.get_interation_state();
-
-	if (left_motion.FootState == BACK_LEFT && left_motion.StateCount != lastLeftState.StateCount)
-	{
-		motion_state = left_motion.FootState;
-		std::cout << "Interation 渴놔 璘신" << std::endl;
-
-		if (motion_state == BACK_LEFT)
-		{
-			std::cout << "璘신 : 璘苟" << endl;
-		}
-		else if (motion_state == FRONT_LEFT)
-		{
-			std::cout << "璘신 : 璘�" << endl;
-		}
-	}
-	else if (right_motion.FootState == BACK_RIGHT && right_motion.StateCount != lastRightState.StateCount)
-	{
-		motion_state = right_motion.FootState;
-
-		if (motion_state == ENTER_KEY)
-		{
-			motion_state = CANCLE_KEY;
-		}
-
-		if (motion_state == FRONT_RIGHT)
-		{
-			std::cout << "塘신 : 塘�" << endl;
-		}
-		else if (motion_state == BACK_RIGHT)
-		{
-			std::cout << "塘신 : 塘苟" << endl;
-		}
-		//std::cout << "Interation 渴놔 塘신" << std::endl;
-	}
-	else if (left_motion.FootState == ENTER_KEY && left_motion.StateCount != lastLeftState.StateCount)
-	{
-		motion_state = left_motion.FootState;
-	}
-	else if (right_motion.FootState == ENTER_KEY && right_motion.StateCount != lastRightState.StateCount)
-	{
-		motion_state = CANCLE_KEY;
-	}
-	else
-	{
-		motion_state = -1;
-	}
-	
-	if (motion_state == CANCLE_KEY || motion_state == ENTER_KEY)
-	{
-		std::cout << "혤句or횅훰숩 time: " << _time <<endl;
-	}
-	memcpy(left_last_pos_tmp, left_pos_tmp, 3 * sizeof(int32_t));
-	memcpy(right_last_pos_tmp, right_pos_tmp, 3 * sizeof(int32_t));
-
-	left_zupt_last = left_zupt;
-	right_zupt_last = right_zupt;
-
-	lastLeftState = left_motion;
-	lastRightState = right_motion;
-}

+ 0 - 47
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Interaction.h

@@ -1,47 +0,0 @@
-
-#include "InertialTrajProcess.h"
-
-#include "SingleFootAction.h"
-
-#define  STOP_ANGLE  -0.9f
-
-class  Interaction {
-public:
-	Interaction();
-	void Process(uint32_t _time, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int rssi);
-
-	int get_motion_state();
-
-private:
-	InertialTrajProcess rotateTrajLeft;
-	InertialTrajProcess rotateTrajRight;
-
-	int same_zupt_count;
-	int canEnter;
-	int stopGame;
-
-	int motion_state;
-	int can_report_motion_state;
-
-	int left_stop_signal_count;
-	int right_stop_signal_count;
-
-	int32_t left_last_pos[3];
-	int32_t right_last_pos[3];
-
-	int left_last_pos_tmp[3];
-	int right_last_pos_tmp[3];
-
-	int left_zupt_last;
-	int right_zupt_last;
-
-	SingleFootAction leftFootAction = NULL;
-	SingleFootAction rightFootAction = NULL;
-
-	FootActionState lastLeftState;
-	FootActionState lastRightState;
-
-	int time_interval;
-};

+ 0 - 172
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/MonsterH5.cpp

@@ -1,172 +0,0 @@
-
-#include "MonsterH5.h"
-
-void MonsterH5::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int rssi)
-{
-	static int right_zupt_count = 0;
-	static int left_zupt_count = 0;
-	
-	static int last_right_zupt = 0;
-	static int last_left_zupt = 0;
-
-	static int right_wait = 0;
-	static int left_wait = 0;
-
-	int right_is_zupt = 0;
-
-	static int left_trigger_wait = 0;
-	static int right_trigger_wait = 0;
-
-	static float left_max_z_unzero = 1.0f;
-	static float left_min_z_unzero = 1.0f;
-
-	static float right_max_z_unzero = 1.0f;
-	static float right_min_z_unzero = 1.0f;
-
-
-	if (right_trigger_wait > 0)
-	{
-		float right_acc_z = right_acc[2] / 2048.f;
-
-		if (right_acc_z > right_max_z_unzero)
-		{
-			right_max_z_unzero = right_acc_z;
-		}
-
-		if (right_acc_z < right_min_z_unzero)
-		{
-			right_min_z_unzero = right_acc_z;
-		}
-	}
-	else
-	{
-		right_max_z_unzero = 1.0f;
-		right_min_z_unzero = 1.0f;
-	}
-
-	if (left_trigger_wait > 0)
-	{
-		float left_acc_z = left_acc[2] / 2048.f;
-
-		if (left_acc_z > left_max_z_unzero)
-		{
-			left_max_z_unzero = left_acc_z;
-		}
-
-		if (left_acc_z < left_min_z_unzero)
-		{
-			left_min_z_unzero = left_acc_z;
-		}
-	}
-	else
-	{
-		left_max_z_unzero = 1.0f;
-		left_min_z_unzero = 1.0f;   
-	}
-
-	
-
-	if (right_zupt == 1 && last_right_zupt == 0 && 
-		(right_trigger_wait <= 0 || (right_max_z_unzero >2.0f && right_min_z_unzero <0.0f)))
-	
-	//if (right_zupt == 1 && last_right_zupt == 0)
-	{
-		std::cout << "塘신뇰랙劫뒈" << endl;
-		result[1] = 1;
-
-		right_wait = 5;
-
-
-		right_max_z_unzero = 1.0f;
-		right_min_z_unzero = 1.0f;
-		
-	}
-	else
-	{
-		result[1] = 0;
-	}
-
-	if (left_zupt == 1 && last_left_zupt == 0 && 
-		(left_trigger_wait <=0 || (left_max_z_unzero > 2.0f && left_min_z_unzero < 0.0f)))
-	{
-		std::cout << "璘신뇰랙劫뒈" << endl;
-
-		result[0] = 1;
-
-		left_wait = 5;
-
-		left_max_z_unzero = 1.0f;
-		left_min_z_unzero = 1.0f;
-
-	}
-	else
-	{
-		result[0] = 0;
-	}
-
-	//털뙤崗신뇰뒀
-	if (right_wait > 0 && left_wait > 0)
-	{
-		result[2] = 1;
-
-		std::cout << "崗신꽂뒈" << std::endl;
-	}
-	else
-	{
-		result[2] = 0;
-	}
-
-
-	if (right_zupt == 1)
-	{
-		right_trigger_wait = 15;
-	}
-	else
-	{
-		right_trigger_wait--;
-	}
-
-
-	if (left_zupt == 1)
-	{
-		left_trigger_wait = 15;
-	}
-	else
-	{
-		left_trigger_wait--;
-	}
-
-	last_right_zupt = right_zupt;
-	last_left_zupt = left_zupt;
-
-	if (left_wait > 0)
-	{
-		left_wait--;
-	}
-
-	if (right_wait > 0)
-	{
-		right_wait--;
-	}
-
-	if (right_trigger_wait > 0)
-	{
-		right_trigger_wait--;
-	}
-
-	if (left_trigger_wait > 0)
-	{
-		left_trigger_wait--;
-	}
-
-
-
-}
-
-
-void MonsterH5::getResult(int* dec)
-{
-	memcpy(dec, result, 4 * sizeof(int));
-}

+ 0 - 15
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/MonsterH5.h

@@ -1,15 +0,0 @@
-#pragma once
-
-#include "pub.h"
-
-class MonsterH5 {
-public:
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int rssi);
-
-	void getResult(int* dec);
-
-private:
-	int result[4];
-};

+ 0 - 114
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/OriginTraj.cpp

@@ -1,114 +0,0 @@
-#include "OriginTraj.h"
-
-OriginTraj::OriginTraj()
-{
-	start_traj = 0;
-
-	left_zupt_count = 0;
-	right_zupt_count = 0;
-
-	leftRotate[0] = 1.0; leftRotate[1] = 0.0;
-	leftRotate[2] = 0.0; leftRotate[3] = 1.0;
-
-	rightRotate[0] = 1.0; rightRotate[1] = 0.0;
-	rightRotate[2] = 0.0; rightRotate[3] = 1.0;
-
-	
-	memset(left_cur_pos, 0, 3 * sizeof(float));
-	memset(right_cur_pos, 0, 3 * sizeof(float));
-
-	memset(start_left_pos, 0, 3 * sizeof(float));
-	memset(start_right_pos, 0, 3 * sizeof(float));
-}
-
-
-void OriginTraj::Process(int* right_pos, int* right_att, int right_zupt, int* left_pos, int* left_att, int left_zupt)
-{
-	if (left_zupt)
-	{
-		left_zupt_count++;
-	}
-	else
-	{
-		left_zupt_count = 0;
-	}
-
-	if (right_zupt)
-	{
-		right_zupt_count++;
-	}
-	else
-	{
-		right_zupt_count = 0;
-	}
-
-
-	if (left_zupt_count > 50 && right_zupt_count > 50 && start_traj == 0)
-	{
-		float leftTheta = float(left_att[0]) * 0.0001f;
-		float rightTheta = float(right_att[0]) * 0.0001f;
-
-		leftRotate[0] = cos(leftTheta); leftRotate[1] = sin(leftTheta);
-		leftRotate[2] = -sin(leftTheta); leftRotate[3] = cos(leftTheta);
-
-
-		rightRotate[0] = cos(rightTheta);  rightRotate[1] = sin(rightTheta);
-		rightRotate[2] = -sin(rightTheta); rightRotate[3] = cos(rightTheta);
-
-		start_traj = 1;
-
-		for (int i = 0; i < 3; i++)
-		{
-			start_left_pos[i] = left_pos[i] * 0.01f;
-			start_right_pos[i] = right_pos[i] * 0.01f;
-		}
-
-		std::cout << "CAN PLOT TRAJ" << std::endl;
-	}
-
-	if (start_traj == 1)
-	{
-		float left_pos_tmp[3];
-		float right_pos_tmp[3];
-
-		for (int i = 0; i < 3; i++)
-		{
-			left_pos_tmp[i] = left_pos[i] * 0.01f - start_left_pos[i];
-			right_pos_tmp[i] = right_pos[i] * 0.01f - start_right_pos[i];
-		}
-
-		left_cur_pos[0] = leftRotate[0] * left_pos_tmp[0]  + leftRotate[1] * left_pos_tmp[1] ;
-		left_cur_pos[1] = leftRotate[2] * left_pos_tmp[0]  + leftRotate[3] * left_pos_tmp[1] ;
-
-		left_cur_pos[2] = left_pos_tmp[2];
-
-		right_cur_pos[0] = rightRotate[0] * right_pos_tmp[0] + rightRotate[1] * right_pos_tmp[1];
-		right_cur_pos[1] = rightRotate[2] * right_pos_tmp[0] + rightRotate[3] * right_pos_tmp[1];
-
-		right_cur_pos[2] = right_pos_tmp[2];
-
-		memcpy(left_pos_tmp, left_cur_pos, 3 * sizeof(float));
-		memcpy(right_pos_tmp, right_cur_pos, 3 * sizeof(float));
-
-		left_cur_pos[0] = 0.991444861 * left_pos_tmp[0] - 0.13052619 * left_pos_tmp[1];
-		left_cur_pos[1] = 0.13052619 * left_pos_tmp[0] + 0.991444861 * left_pos_tmp[1];
-
-		right_cur_pos[0] = 0.991444861 * right_pos_tmp[0] + 0.13052619 * right_pos_tmp[1];
-		right_cur_pos[1] = -0.13052619 * right_pos_tmp[0] + 0.991444861 * right_pos_tmp[1];
-
-	}
-
-}
-
-float OriginTraj::getGamePos(int left_or_right, int index)
-{
-	if (index < 0 || index > 2)
-		return -1;
-	
-	if (left_or_right == LEFT_FOOT)
-	{
-		return left_cur_pos[index];
-	}
-	else
-		return right_cur_pos[index];
-}

+ 0 - 30
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/OriginTraj.h

@@ -1,30 +0,0 @@
-#ifndef _OriginTraj_H
-#define _OriginTraj_H
-
-#include "pub.h"
-
-class OriginTraj {
-public: 
-
-	OriginTraj();
-
-	void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos, int* left_att, int left_zupt );
-
-	float getGamePos(int left_or_right, int index);
-
-private:
-
-	int start_traj = 0;
-	int left_zupt_count = 0;
-	int right_zupt_count = 0;
-	float left_cur_pos[3];
-	float right_cur_pos[3];
-
-	float start_left_pos[3];
-	float start_right_pos[3];
-
-	float leftRotate[4] = { 1.0, 0.0, 0.0, 1.0 };
-	float rightRotate[4] = { 1.0, 0.0, 0.0, 1.0 };
-};
-
-#endif

+ 0 - 111
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RuinsExplore.cpp

@@ -1,111 +0,0 @@
-
-#include "RuinsExplore.h"
-
-RuinsExplore::RuinsExplore()
-{
-	last_jump = 0;
-
-	last_jump_time = 0;
-
-
-	left_zupt = 0;
-	right_zupt = 0;
-
-	memset(result, 0, 4 * sizeof(int));
-
-}
-
-void RuinsExplore::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int girl_shoes)
-{
-	/*
-		跑酷游戏处理接口,
-		暂时在同一个函数里分开处理左右脚的数据,往后再优化
-	*/
-
-
-	int left_pos_tmp[3];
-	int right_pos_tmp[3];
-
-
-
-	left_acc_status = getAccStatus(left_zupt, left_acc, left_acc_max, left_acc_min);
-
-	right_acc_status = getAccStatus(right_zupt, right_acc, right_acc_max, right_acc_min);
-
-	result[2] = getResultJump(jump);
-
-}
-
-int RuinsExplore::getResultJump(int jump)
-{
-	int isJump = -1;
-
-	last_jump_time++;
-
-	if (last_jump == 0 && jump == 1 && left_acc_status == 1 && right_acc_status == 1)
-	{
-		static int jump_count = 0;
-
-		printf(" RuinsExplore' motion is Jump : %d\n", jump_count++);
-
-		isJump = MOTION_JUMP;
-
-		last_jump_time = 0;
-	}
-	else
-	{
-		if (last_jump == 0 && jump == 1 && !(left_acc_status == 1 && right_acc_status == 1))
-		{
-			std::cout << " RuinsExplore appear error command on zero_vel status (jump command) " << endl;
-		}
-	}
-
-	last_jump = jump;
-
-	return isJump;
-}
-
-void RuinsExplore::getResult(int* dec)
-{
-	memcpy(dec, result, 4 * sizeof(int));
-}
-
-int RuinsExplore::getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc)
-{
-	/*
-	* 在游戏测试的时候发现有左右乱飞的情况,现在以及乱跳的情况,现在用加速度过滤这一个情况
-	* 尽量不在嵌入式上修改
-	*/
-	if (zupt)
-	{
-		memcpy(max_acc, acc, 3 * sizeof(int));
-		memcpy(min_acc, acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (max_acc[i] < acc[i])
-			{
-				max_acc[i] = acc[i];
-			}
-
-			if (min_acc[i] > acc[i])
-			{
-				min_acc[i] = acc[i];
-			}
-		}
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		if (max_acc[i] - min_acc[i] > 1024)
-		{
-			return 1;
-		}
-	}
-
-	return 0;
-}

+ 0 - 53
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RuinsExplore.h

@@ -1,53 +0,0 @@
-#pragma once
-
-#ifndef __ruins_explore_h__
-#define __ruins_explore_h__
-
-#include "pub.h"
-
-class RuinsExplore
-{
-public:
-
-	RuinsExplore();
-
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int girl_shoes);
-
-	int getResultJump(int jump);
-
-	int getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc);
-
-	void getResult(int* dec);
-
-private:
-
-	int result[4];
-
-	int last_jump;
-
-	int left_zupt;
-
-	int right_zupt;
-
-
-	int last_jump_time;
-
-	int right_acc_status;
-
-	int left_acc_status;
-
-	int right_acc_max[3];
-
-	int left_acc_max[3];
-
-	int right_acc_min[3];
-
-	int left_acc_min[3];
-
-};
-
-
-
-#endif

+ 0 - 619
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RunGame.cpp

@@ -1,619 +0,0 @@
-
-#include "RunGame.h"
-
-#include "pub.h"
-
-int rotateGamePos(int* pos, float heading, int left_or_right);
-
-void check_vector(vector<POS_X_CELL> &data_vector, int zupt)
-{
-	//1、当 当前为触地时刻, 应保证 data_vector 仅有两个zupt
-	// vector 不可能为空,不作 空的判断
-
-	if (zupt == 1)
-	{
-		//如果输入为触地信号,那么应该先弹出头部zupt为0的数据
-		if (data_vector.size() == 1)
-		{
-			return;
-		}
-		while (data_vector.size() != 0)
-		{
-			if (data_vector[0].zupt == 0)
-			{
-				data_vector.erase(data_vector.begin());
-			}
-			else
-			{
-				break;
-			}
-		}
-
-		//再检测当前数组应该保持两个ZUPT就好
-		if (data_vector.size() == 1)
-		{
-			return;
-		}
-
-		//先统计当前有几个zupt吧
-		int zupt_count = 0;
-		for (int i = 0; i < data_vector.size(); i++)
-		{
-			if (data_vector[i].zupt == 1)
-			{
-				zupt_count++;
-			}
-		}
-
-		if (zupt_count <= 1)
-		{
-			std::cout << "rungame error 1 zupt_count : " << zupt_count <<endl;
-		}
-
-		//删除多余的触地数据
-		int delete_data_count = zupt_count - 2;
-
-		while (delete_data_count > 0)
-		{
-			if (data_vector[0].zupt == 1)
-			{
-				delete_data_count--;
-			}
-			data_vector.erase(data_vector.begin());
-		}
-
-		//判断额外的情况,如果数据长度就只有两个,而且都是zupt,那么就需要删除头部
-
-		if (data_vector.size() == 2 && data_vector[0].zupt == 1 && data_vector[1].zupt == 1)
-		{
-			data_vector.erase(data_vector.begin());
-		}
-
-	}
-	else
-	{
-		//当前信号为触地信号
-		//保证当前应该只有一个zupt信号
-		 
-		if (data_vector.size() == 1)
-		{
-			data_vector.clear();
-		}
-
-		int zupt_count = 0;
-		for (int i = 0; i < data_vector.size(); i++)
-		{
-			if (data_vector[i].zupt == 1)
-			{
-				zupt_count++;
-			}
-		}
-
-		if (zupt_count == 0)
-		{
-			data_vector.clear();
-		}
-
-		//删除多余的触地数据
-		int delete_data_count = zupt_count - 1;
-
-		while (delete_data_count > 0)
-		{
-			if (data_vector[0].zupt == 1)
-			{
-				delete_data_count--;
-			}
-			data_vector.erase(data_vector.begin());
-		}
-
-	}
-}
-
-//计算结果的时候应该保持
-int calResult_LEFT(vector<POS_X_CELL>& data_vector)
-{
-	int motion = 0;
-	if (data_vector.size() <= 1)
-	{
-		return motion;
-	}
-
-	//经过检查后,保证了头部只有一个触地信号, 
-	//那么应当将触地信号设置本数据段的初始方向,计算一系列旋转后的位置
-
-	vector<int> pos_x_vector;
-	int pos_temp[3];
-	float heading_temp = data_vector[0].heading * 0.0001f;
-
-	for (int  i = 0; i < data_vector.size(); i++)
-	{
-		pos_temp[0] = data_vector[i].pos_x;
-		pos_temp[1] = data_vector[i].pos_y;
-		pos_temp[2] = data_vector[i].pos_z;
-
-		pos_x_vector.push_back(rotateGamePos(pos_temp, heading_temp, LEFT_FOOT));
-	}
-
-	//左脚的话应该先找到最大值,及对应的位置
-	int max_val = pos_x_vector[0];
-	int max_val_index = 0;
-	for (int i = 0; i < pos_x_vector.size(); i++)
-	{
-		if (max_val < pos_x_vector[i])
-		{
-			max_val = pos_x_vector[i];
-
-			max_val_index = i;
-		}
-	}
-	//再做判断
-	if (max_val - pos_x_vector[pos_x_vector.size() - 1] > 15 && data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f)
-	{
-		for (int i = 0; i < pos_x_vector.size(); i++)
-		{
-			std::cout << pos_x_vector[i] << " , " << data_vector[i].zupt << " , " ;
-		}
-		std::cout << endl;
-
-
-		if (data_vector[data_vector.size() - 1].zupt == 1)
-		{
-			POS_X_CELL  temp = data_vector[data_vector.size() - 1];
-			data_vector.clear();
-
-			data_vector.push_back(temp);
-		}
-		else
-		{
-			data_vector.clear();
-		}
-
-		motion = 1;
-	}
-	else
-	{
-		if (data_vector[data_vector.size() - 1].zupt == 1 && data_vector[0].zupt == 1)
-		{
-			std::cout << "debug queue" << endl;
-			for (int i = 0; i < pos_x_vector.size(); i++)
-			{
-				std::cout << pos_x_vector[i] << " , " << data_vector[i].zupt << " , ";
-			}
-			std::cout << endl;
-
-			//在检测结果的时候,还能遇到两个触地信号,那么直接这段数据清空,留最新的触地信号
-			POS_X_CELL  temp = data_vector[data_vector.size() - 1];
-			data_vector.clear();
-
-			data_vector.push_back(temp);
-		}
-	}
-
-	return motion;
-}
-
-int calResult_RIGHT(vector<POS_X_CELL>& data_vector)
-{
-	int motion = 0;
-	if (data_vector.size() <= 1)
-	{
-		return motion;
-	}
-
-	//经过检查后,保证了头部只有一个触地信号, 
-	//那么应当将触地信号设置本数据段的初始方向,计算一系列旋转后的位置
-
-	vector<int> pos_x_vector;
-	int pos_temp[3];
-	float heading_temp = data_vector[0].heading * 0.0001f;
-
-	for (int i = 0; i < data_vector.size(); i++)
-	{
-		pos_temp[0] = data_vector[i].pos_x;
-		pos_temp[1] = data_vector[i].pos_y;
-		pos_temp[2] = data_vector[i].pos_z;
-
-		pos_x_vector.push_back(rotateGamePos(pos_temp, heading_temp, LEFT_FOOT));
-	}
-
-	//右脚的话应该先找到最小值,及对应的位置
-	int min_val = pos_x_vector[0];
-	int min_val_index = 0;
-	for (int i = 0; i < pos_x_vector.size(); i++)
-	{
-		if (min_val > pos_x_vector[i])
-		{
-			min_val = pos_x_vector[i];
-
-			min_val_index = i;
-		}
-	}
-	//再做判断
-	if (pos_x_vector[pos_x_vector.size() - 1] - min_val > 15 && data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f)
-	{
-		std::cout << "right_foot pos_offset : ";
-
-		for (int i = 0; i < pos_x_vector.size(); i++)
-		{
-			std::cout << pos_x_vector[i] << " , " << data_vector[i].zupt << " , ";
-		}
-		std::cout << endl;
-		
-
-		if (data_vector[data_vector.size() - 1].zupt == 1)
-		{
-			POS_X_CELL  temp = data_vector[data_vector.size() - 1];
-			data_vector.clear();
-
-			data_vector.push_back(temp);
-		}
-		else
-		{
-			data_vector.clear();
-		}
-
-		motion = 1;
-	}
-	else
-	{
-		if (data_vector[data_vector.size() - 1].zupt == 1 && data_vector[0].zupt == 1)
-		{
-			std::cout << "debug queue" << endl;
-			for (int i = 0; i < pos_x_vector.size(); i++)
-			{
-				std::cout << pos_x_vector[i] << " , " << data_vector[i].zupt << " , ";
-			}
-			std::cout << endl;
-
-			//在检测结果的时候,还能遇到两个触地信号,那么直接这段数据清空,留最新的触地信号
-			POS_X_CELL  temp = data_vector[data_vector.size() - 1];
-			data_vector.clear();
-
-			data_vector.push_back(temp);
-		}
-
-		
-	}
-
-	return motion;
-}
-
-void RunGame::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int rssi)
-{
-
-
-	POS_X_CELL left_pos_x_cell = { left_pos[0], left_pos[1], left_pos[2], left_att[0], left_att[1], left_zupt };
-
-	POS_X_CELL right_pos_x_cell = { right_pos[0], right_pos[1], right_pos[2], right_att[0], right_att[1],right_zupt };
-
-	left_q.push_back(left_pos_x_cell);
-	right_q.push_back(right_pos_x_cell);
-
-	check_vector(left_q, left_zupt);
-
-	check_vector(right_q, right_zupt);
-
-
-	if (calResult_LEFT(left_q))
-	{
-		result[0] = MOTION_LEFT;
-
-		std::cout << "appear LEFT_MOTION CMD" << endl;
-	}
-	else
-	{
-		result[0] = -1;
-	}
-
-	if (calResult_RIGHT(right_q))
-	{
-		result[1] = MOTION_RIGHT;
-
-		std::cout << "appear RIGHT_MOTION CMD" << endl;
-	}
-	else
-	{
-		result[1] = -1;
-	}
-
-
-
-	result[2] = getResultJump(jump);
-
-	result[3] = getResultDown(down);
-
-
-	last_left_zupt = left_zupt;
-	last_right_zupt = right_zupt;
-
-
-}
-
-void RunGame::getResult(int* dec)
-{
-	memcpy(dec, result, 4 * sizeof(int));
-}
-
-void RunGame::setResultConLeft(int zupt)
-{
-	if (zupt == 1)
-	{
-		left_has_result = 1;
-		left_pos_offset_min = 0;
-	}
-
-}
-
-void RunGame::setResultConRight(int zupt)
-{
-	if (zupt == 1)
-	{
-		right_has_result = 1;
-		right_pos_offset_min = 0;
-	}
-}
-
-int RunGame::getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc)
-{
-	/*
-	* 在游戏测试的时候发现有左右乱飞的情况,现在以及乱跳的情况,现在用加速度过滤这一个情况
-	* 尽量不在嵌入式上修改
-	*/
-	if (zupt)
-	{
-		memcpy(max_acc, acc, 3 * sizeof(int));
-		memcpy(min_acc, acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (max_acc[i] < acc[i])
-			{
-				max_acc[i] = acc[i];
-			}
-
-			if (min_acc[i] > acc[i])
-			{
-				min_acc[i] = acc[i];
-			}
-		}
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		if (max_acc[i] - min_acc[i] > 1024)
-		{
-			return 1;
-		}
-	}
-
-	return 0;
-}
-
-
-int RunGame::getResultLeft(int *pos, int girl_shoes, float pitch)
-{
-	int isLeft = -1;
-
-	int distance_threshold = 15;
-
-	if (pos[0] > left_pos_offset_min)
-	{
-		left_pos_offset_min = pos[0];
-
-	}
-
-	if (left_has_result == 1 && pos[0] - left_pos_offset_min < -distance_threshold && pitch < 0.3f )
-	{
-		printf("this motion is Left\n");
-		isLeft = MOTION_LEFT;
-		left_has_result = 0;
-	}
-	else if (left_has_result == 1 && pos[0] - left_pos_offset_min < -distance_threshold && left_acc_status == 0)
-	{
-		std::cout << "appear error command on zero_vel status (left_foot) " << endl;
-
-	}
-
-	return isLeft;
-}
-
-int RunGame::getResultRight(int *pos, int girl_shoes, float pitch)
-{
-	int isRight = -1;
-
-	int distance_threshold = 15;
-
-
-	if (pos[0] < right_pos_offset_min)
-	{
-		right_pos_offset_min = pos[0];
-	}
-
-	if (right_has_result == 1 && pos[0] - right_pos_offset_min > distance_threshold && pitch < 0.3f )
-	{
-		printf("this motion is Right\n");
-
-		isRight = MOTION_RIGHT;
-
-		right_has_result = 0;
-	}
-	else if (right_has_result == 1 && pos[0] - right_pos_offset_min > distance_threshold && right_acc_status == 0)
-	{
-		std::cout << "appear error command on zero_vel status (right_foot) " << endl;
-
-	}
-
-	return isRight;
-}
-
-int RunGame::getResultLeftRight(int* pos, int devNum)
-{
-	if (devNum == LEFT_FOOT && pos[1] < 0)
-	{
-		return MOTION_LEFT;
-	}
-
-	if (devNum == RIGHT_FOOT && pos[1] > 0)
-	{
-		return MOTION_RIGHT;
-	}
-
-	return -1;
-}
-
-int RunGame::getResultJump(int jump)
-{
-	int isJump = -1;
-
-	last_jump_time++;
-
-	if (last_jump == 0 && jump == 1)
-	{
-		static int jump_count = 0;
-
-		printf("this motion is Jump : %d\n", jump_count++);
-
-		isJump = MOTION_JUMP;
-
-		last_jump_time = 0;
-	}
-	else
-	{
-		if (last_jump == 0 && jump == 1 && !(left_acc_status == 1 && right_acc_status == 1))
-		{
-			std::cout << "appear error command on zero_vel status (jump command) " << endl;
-		}
-	}
-
-	last_jump = jump;
-
-	return isJump;
-}
-
-int RunGame::getResultDown(int down)
-{
-	int isDown = -1;
-	
-	if (last_down == 0 && down == 1 && last_jump_time > 10)
-	{
-		printf("this motion is Down\n");
-		isDown = MOTION_DOWN;
-	}
-
-	last_down = down;
-
-	return isDown;
-
-}
-
-float RunGame::getGamePos(int left_or_right, int index)
-{
-	if (index < 0 || index > 2)
-		return -1;
-
-	if (left_or_right == LEFT_FOOT)
-	{
-		return left_game_pos[index] * 0.01f;
-	}
-	else
-	{
-		return right_game_pos[index] * 0.01f;
-	}
-}
-
-RunGame::RunGame()
-{
-	last_down = 0;
-	last_jump = 0;
-
-	last_jump_time = 0;
-
-	left_has_result = 0;
-	right_has_result = 0;
-
-	left_zupt = 0;
-	right_zupt = 0;
-
-	left_pos_offset_min = 0;
-	right_pos_offset_min = 0;
-
-	memset(result, 0, 4 * sizeof(int));
-
-	memset(left_last_pos, 0, 3 * sizeof(int));
-	memset(right_last_pos, 0, 3 * sizeof(int));
-
-	left_reset_heading = 0.f;
-
-	right_reset_heading = 0.f;
-	
-	has_init_heading = 0;
-	
-	zupt_count = 0;
-
-	memset(left_game_pos, 0, 3 * sizeof(int));
-	memset(right_game_pos, 0, 3 * sizeof(int));
-
-	last_left_zupt = 1;
-	last_right_zupt = 1;
-}
-
-void RunGame::setGameheading(int left_zupt, int right_zupt, float left_heading, float right_heading , int rssi)
-{
-
-	if (left_zupt)
-	{
-		left_reset_heading = left_heading;
-	}
-
-	if (right_zupt)
-	{
-		right_reset_heading = right_heading;
-	}
-	
-
-}
-
-int rotateGamePos(int* pos, float heading,int left_or_right)
-{
-	float pos_f[3];
-
-	pos_f[2] = float(pos[2]) * 0.01f;
-	pos_f[1] = float(pos[1]) * 0.01f;
-	pos_f[0] = float(pos[0]) * 0.01f;
-
-	float posTemp[3];
-
-	posTemp[2] = pos_f[2];
-
-	
-	if (left_or_right == LEFT_FOOT)
-	{
-		posTemp[0] =  cos(heading) * float(pos_f[0]) + sin(heading) * float(pos_f[1]);
-		posTemp[1] = -sin(heading) * float(pos_f[0]) + cos(heading) * float(pos_f[1]);
-
-		/*
-		*  因为女生跑的时候,左鞋鞋子朝向是往左的,导致不在人体的主方向,会使估计的X方向轨迹会变长
-		*/
-		pos_f[0] = 0.9848 * posTemp[0] - 0.1736 * posTemp[1];
-		pos_f[1] = 0.1736 * posTemp[0] + 0.9848 * posTemp[1];
-	}
-	else
-	{
-		posTemp[0] = cos(heading) * float(pos_f[0]) + sin(heading) * float(pos_f[1]);
-		posTemp[1] = -sin(heading) * float(pos_f[0]) + cos(heading) * float(pos_f[1]);
-
-		pos_f[0] = 0.9848 * posTemp[0] + 0.1736 * posTemp[1];
-		pos_f[1] = - 0.1736 * posTemp[0] + 0.9848 * posTemp[1];
-	}
-	/*
-	pos[0] = (int)(pos_f[0] * 100.0f);
-	pos[1] = (int)(pos_f[1] * 100.0f);
-	pos[2] = (int)(pos_f[2] * 100.0f);
-	*/
-
-	return (int)(pos_f[0] * 100.0f);
-}

+ 0 - 111
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/RunGame.h

@@ -1,111 +0,0 @@
-#pragma once
-#ifndef _RunGame_H_
-#define _RunGame_H_
-
-#include <vector>
-
-using namespace std;
-
-struct POS_X_CELL
-{
-	//位置
-	int pos_x;
-	int pos_y;
-	int pos_z;
-
-	//角度
-	int heading;
-	int pitch;
-
-	int zupt;
-};
-
-class RunGame
-{
-	public:
-		RunGame();
-		int getResultLeftRight(int* pos, int devNum);
-		int getResultJump(int jump);
-		int getResultDown(int down);
-		void setResultConLeft(int zupt);
-		void setResultConRight(int zupt);
-
-		int getResultLeft(int *pos, int girl_shoes, float pitch);
-		int getResultRight(int* pos, int girl_shoes, float pitch);
-
-		//void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos,
-		//	int* left_att, int left_zupt, int jump, int down, int girl_shoes);
-
-		void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-			int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-			int jump, int down, int rssi);
-
-		void getResult(int *dec);
-
-		int getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc);
-
-		void setGameheading(int left_zupt, int right_zupt, float left_heading, float right_heading, int rssi);
-
-		void rotateGamePos(int* pos, int left_or_right);
-
-		float getGamePos(int left_or_right, int index);
-
-		int  calResult(vector<POS_X_CELL> &q, int last_zupt , int zupt, int left_or_right);
-
-	private:
-
-		int last_down;
-		int last_jump;
-
-		int left_has_result;
-		int right_has_result;
-		int left_zupt;
-		int right_zupt;
-
-		int left_pos_offset_min;
-		int right_pos_offset_min;
-
-		int left_last_pos[3];
-
-		int right_last_pos[3];
-
-		int result[4];
-
-		int last_jump_time;
-
-		int right_acc_status;
-		
-		int left_acc_status;
-
-		int right_acc_max[3];
-
-		int left_acc_max[3];
-		
-		int right_acc_min[3];
-
-		int left_acc_min[3];
-
-		//开局重置方向
-
-		float left_reset_heading;
-		
-		float right_reset_heading;
-		
-		int has_init_heading;
-
-		int zupt_count;
-
-		//测试用的pos
-		int left_game_pos[3];
-
-		int right_game_pos[3];
-
-		int last_left_zupt;
-		int last_right_zupt;
-
-		vector<POS_X_CELL> left_q;
-		vector<POS_X_CELL> right_q;
-
-};
-
-#endif

+ 0 - 572
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/SingleFootAction.cpp

@@ -1,572 +0,0 @@
-#include "SingleFootAction.h"
-
-
-void SingleFootAction::run(uint32_t _time, int x, int y, int z,int zupt, int rssi, float pitch, float *acc)
-{
-	//std::cout << "pitch : " << pitch <<endl;
-
-	/*
-	int enter_signal_result = -1;
-	int direction_signal_result = -1;
-
-	can_listen_enter_signal(acc, pitch);
-
-	int enter_signal_tmp = enter_signal_listen(acc, pitch);
-
-	if (last_enter_signal != enter_signal_tmp && enter_signal_tmp > 0 && enter_signal_cooling == 0)
-	{
-		enter_signal = enter_signal_tmp;
-
-		enter_signal_result = ENTER_KEY;
-		
-		enter_signal_cooling = 20;
-
-		std::cout << "输出垫脚信号 : " << enter_signal << endl;
-	}
-
-	if (enter_signal_tmp > 0)
-	{
-		enter_signal_cooling = 20;
-	}
-
-	last_enter_signal = enter_signal_tmp;
-	
-
-	can_listen_direction_signal(rssi);
-	
-	direction_signal = direction_signal_listen(last_x, last_y, zupt, rssi);
-
-	if (direction_signal > 0 && can_report_motion == 1)
-	{
-		can_report_motion = 0;
-
-		if (pitch < 0.78f)
-		{
-			direction_signal_result = direction_signal;
-		}
-		std::cout << "direction_signal : " << direction_signal << endl;
-	}
-	*/
-
-	direction_signal_listen_new(_time, last_x, last_y, zupt, rssi, pitch);
-
-	enter_signal_listen_new(_time, acc, pitch);
-
-	last_zupt = zupt;
-
-	last_x = x; last_y = y; last_z = z;
-	/*
-	if (enter_signal_cooling > 0)
-	{
-		enter_signal_cooling--;
-	}
-
-	if (enter_signal_result != -1 )
-	{
-		if (footActionState.FootState == ENTER_KEY)
-		{
-			footActionState.StateCount ++;
-			footActionState.Triggering_time = _time;
-		}
-		else
-		{
-			footActionState.FootState = ENTER_KEY;
-			footActionState.StateCount = 1;
-			footActionState.Triggering_time = _time;
-		}
-	}
-
-	if (zupt == 1)
-	{
-		footActionState.Triggering_time = _time;
-	}
-	*/
-}
-
-void SingleFootAction::reset_interation_state()
-{
-	footActionState.FootState = 0;
-	footActionState.StateCount = 0;
-	footActionState.Triggering_time = 0;
-}
-
-float cal_acc_var(float* acc, int length)
-{
-	//计算均值
-	float mean_val = 0;
-
-	for (int i = 0; i < length; i++)
-	{
-		mean_val += acc[i];
-	}
-	
-	mean_val /= length;
-
-	//计算总体方差
-
-	float var_val = 0;
-	for (int i = 0; i < length; i++)
-	{
-		var_val += ((acc[i] - mean_val) * (acc[i] - mean_val));
-	}
-
-	return var_val / length;
-
-}
-
-int SingleFootAction::enter_signal_listen_new(uint32_t _time, float* acc, float pitch)
-{
-	memcpy(acc_x_buff, acc_x_buff + 1, 9 * sizeof(float));
-
-	acc_x_buff[9] = acc[0];
-
-	//计算加速度的总体方差(n)
-
-	float acc_var = cal_acc_var(acc_x_buff, 10);
-
-
-	//x轴速度剧烈抖动,而且俯仰角大于45度,则证明是踮脚
-	if (acc_var > 1.0f && pitch > 0.78f)
-	{
-		//can_report_enter_signal = 0;
-		//std::cout << "抖动状态下判断脚掂起来" << endl;
-		if (footActionState.FootState != ENTER_KEY)
-		{
-			//std::cout << "抖动状态下判断脚掂起来" << endl;
-			footActionState.FootState = ENTER_KEY;
-			footActionState.StateCount = 1;
-
-		}
-		else
-		{
-			if (_time - footActionState.Triggering_time > 10)
-			{
-				//std::cout << "抖动状态下判断脚掂起来" << endl;
-				footActionState.StateCount ++ ;
-
-				std::cout << "test" << endl;
-			}
-		}
-
-		footActionState.Triggering_time = _time;
-	}
-	
-	return -1;
-}
-
-int SingleFootAction::enter_signal_listen(float *acc, float pitch)
-{	
-	memcpy(acc_x_buff, acc_x_buff + 1, 9 * sizeof(float));
-
-	acc_x_buff[9] = acc[0];
-
-    //计算加速度的总体方差(n)
-
-	float acc_var = cal_acc_var(acc_x_buff, 10);
-
-	
-	//x轴速度剧烈抖动,而且俯仰角大于45度,则证明是踮脚
-	if (acc_var > 1.0f && pitch > 0.78f)
-	{
-		can_report_enter_signal = 0;
-		//std::cout << "抖动状态下判断脚掂起来" << endl;
-		return 1;
-	}
-
-	//如果抖动检测不到,转入平稳状态, 判断俯仰角持续两秒
-
-	float acc_norm = sqrt(acc[0] * acc[0] + acc[1] * acc[1] + acc[2] * acc[2]);
-
-	//std::cout << "acc_norm : " << acc[0] << ", " << acc[1] << ", " << acc[2] << endl;
-
-	if (acc_norm < 1.1f && acc_norm > 0.9f && pitch > 0.78f)
-	{
-		big_pitch_count++;
-	}
-	else
-	{
-		big_pitch_count = 0;
-	}
-
-	if (big_pitch_count > 90 && can_report_enter_signal)
-	{
-		can_report_enter_signal = 0;
-		big_pitch_count = 0;
-
-		std::cout << "平稳状态下判断脚掂起来" << endl;
-
-		return 1;
-	}
-
-	return -1;
-
-}
-
-int SingleFootAction::can_listen_enter_signal(float* acc, float pitch)
-{
-	if (sqrt(acc[0] * acc[0] + acc[1] * acc[1] + acc[2] * acc[2]) > 1.5f || fabsf(pitch) < 0.2f)
-	{
-		can_report_enter_signal = 1;
-	}
-
-	return 0;
-}
-
-FootActionState SingleFootAction::get_interation_state()
-{
-	return footActionState;
-}
-
-int  SingleFootAction::direction_signal_listen_new(uint32_t _time, int x, int y, int zupt, int rssi, float pitch)
-{
-	float x_offset = x;
-	float y_offset = y;
-
-	if (pitch > 0.78f)
-	{
-		return -1;
-	}
-
-
-	if (last_zupt == 0 && zupt == 1)
-	{
-		if (_time - footActionState.FootState < 10)
-		{
-			return -1;
-		}
-		//触发判断大概的位置, 短距离通过RSSI判断
-		if (rssi < 30)
-		{
-			//先判断当前状态是什么状态,再判断次数
-			std::cout << "rssi 小于阈值" << endl;
-
-			if (left_or_right == LEFT_FOOT)
-			{
-				footActionState.FootState = BACK_LEFT;
-			}
-			else
-			{
-				footActionState.FootState = BACK_RIGHT;
-			}
-			footActionState.StateCount++;
-
-			footActionState.Triggering_time = _time;
-
-		}
-		//长距离移动判断, 通过IMU算出来的距离来判断
-		else if (sqrt(x_offset * x_offset + y_offset * y_offset) > 10.f)
-		{
-
-			float angle = atan2(y_offset, x_offset);
-
-			std::cout << "距离 大于阈值 angle: " << angle << endl;
-
-			if (left_or_right == RIGHT_FOOT && angle > -PI / 4 && angle < PI / 4)
-			{
-				footActionState.FootState = BACK_RIGHT;
-
-				footActionState.StateCount++;
-
-				footActionState.Triggering_time = _time;
-				
-			}
-			else if (left_or_right == LEFT_FOOT && 
-				((angle < PI  && angle > 3 *PI / 4) || (angle > -PI && angle < -3 * PI / 4)))
-			{
-				
-				footActionState.FootState = BACK_LEFT;
-
-				footActionState.StateCount ++;
-
-				footActionState.Triggering_time = _time;
-
-			}
-			else
-			{
-				footActionState.FootState = -1;
-			}
-
-		}
-		else 
-		{
-			if (left_or_right == LEFT_FOOT && footActionState.FootState == BACK_LEFT)
-			{
-				footActionState.StateCount++;
-
-				footActionState.Triggering_time = _time;
-			}
-			else if (left_or_right == LEFT_FOOT && footActionState.FootState == BACK_RIGHT)
-			{
-				footActionState.StateCount++;
-
-				footActionState.Triggering_time = _time;
-			}
-		}
-
-	}
-
-	return -1;
-}
-
-/*
-int  SingleFootAction::direction_signal_listen_new(uint32_t _time, int x, int y, int zupt, int rssi, float pitch)
-{
-	float x_offset = x;
-	float y_offset = y;
-
-	if (pitch > 0.78f)
-	{
-		return -1;
-	}
-
-
-	if ( last_zupt == 0 && zupt == 1)
-	{
-		if (_time - footActionState.FootState < 10)
-		{
-			return -1;
-		}
-		//触发判断大概的位置, 短距离通过RSSI判断
-		if (rssi < 30)
-		{
-			//先判断当前状态是什么状态,再判断次数
-			std::cout << "rssi 小于阈值" << endl;
-
-			if (footActionState.FootState == 0 || (footActionState.FootState != BACK_LEFT && footActionState.FootState != BACK_RIGHT))
-			{
-				if (left_or_right == LEFT_FOOT)
-				{
-					footActionState.FootState = BACK_LEFT;
-				}
-				else
-				{
-					footActionState.FootState = BACK_RIGHT;
-				}
-				footActionState.StateCount = 1;
-
-				footActionState.Triggering_time = _time;
-
-			}
-
-			else
-			{
-				
-				footActionState.StateCount  ++;
-
-				footActionState.Triggering_time = _time;
-			}
-			
-
-		}
-		//长距离移动判断, 通过IMU算出来的距离来判断
-		else if (sqrt(x_offset * x_offset + y_offset * y_offset) > 10.f)
-		{
-
-			if (left_or_right == LEFT_FOOT)
-			{
-				x_offset -= 5;
-			}
-			else
-			{
-				x_offset += 5;
-			}
-
-			float angle = atan2(y_offset, x_offset);
-
-			std::cout << "距离 大于阈值" << endl;
-
-			if (left_or_right == LEFT_FOOT && angle > PI / 2.0 && angle < PI)
-			{
-				if (footActionState.FootState == FRONT_LEFT)
-				{
-					footActionState.StateCount++;
-
-					footActionState.Triggering_time = _time;
-				}
-				else
-				{
-					footActionState.FootState = FRONT_LEFT;
-
-					footActionState.StateCount = 1;
-
-					footActionState.Triggering_time = _time;
-				}
-			}
-			else if (left_or_right == RIGHT_FOOT && angle < PI / 2.0 && angle >0.0f)
-			{
-				if (footActionState.FootState == FRONT_RIGHT)
-				{
-					footActionState.StateCount++;
-
-					footActionState.Triggering_time = _time;
-				}
-				else
-				{
-					footActionState.FootState = FRONT_RIGHT;
-
-					footActionState.StateCount = 1;
-
-					footActionState.Triggering_time = _time;
-				}
-			}
-
-		}
-
-		else 
-		{
-			std::cout << "距离、rssi 不符合阈值" << endl;
-			//rssi > 35 && length < 0.15
-			footActionState.StateCount++;
-
-			footActionState.Triggering_time = _time;
-		}
-	}
-
-	return -1;
-}
-*/
-
-int  SingleFootAction::direction_signal_listen(int x, int y, int zupt, int rssi)
-{	
-	float x_offset =  x;
-	float y_offset =  y;
-
-	if (left_or_right == LEFT_FOOT)
-	{
-		x_offset -= 5;
-	}
-	else
-	{
-		y_offset += 5;
-	}
-
-	//当触地、双脚靠拢的时候,判断归位,触发位置的判断
-	if (zupt == 1 && rssi < 35)
-	{
-		has_reset_signal = 1;
-	}
-
-	if (has_reset_signal == 1 && last_zupt == 0 && zupt == 1)
-	{
-		//触发判断大概的位置
-		if (rssi < 30 && on_floor_count == 0)
-		{
-			//短距离通过RSSI判断
-			if (left_or_right == LEFT_FOOT)
-			{
-				cmd_stage = BACK_LEFT;
-			}
-			else
-			{
-				cmd_stage = BACK_RIGHT;
-			}
-
-			time_s = clock();
-
-			on_floor_count = 1;
-
-			return -1;
-			
-		}
-		//长距离移动判断, 通过IMU算出来的距离来判断
-		else if (sqrt(x_offset * x_offset + y_offset * y_offset) > 15.f)
-		{
-			float angle = atan2(y_offset, x_offset);
-
-			if (left_or_right == LEFT_FOOT && angle > PI / 2.0 && angle < PI)
-			{
-				cmd_stage = FRONT_LEFT;
-				on_floor_count = 1;
-				time_s = clock();
-
-				return -1;
-			}
-			else if (left_or_right == RIGHT_FOOT && angle < PI / 2.0 && angle >0.0f)
-			{
-				cmd_stage = FRONT_RIGHT;
-				on_floor_count = 1;
-				time_s = clock();
-
-				return -1;
-			}
-		}
-		
-		/*
-		//第一次触地,触发命令类别的判断
-		if (on_floor_count == 0)
-		{
-			on_floor_count ++;
-
-			
-
-			//记录触发的时间,用以确认的时候,判断是不是在有效时间里面
-			if (cmd_stage == FRONT_LEFT || cmd_stage == FRONT_RIGHT || cmd_stage == BACK_LEFT || cmd_stage == BACK_RIGHT)
-			{
-				time_s = clock();
-			}
-
-			return -1;
-		}
-		*/
-		else if (on_floor_count == 1)
-		{
-			//已经确认了位置
-
-			//先判断是否在有效时间内
-			int result = -1;
-
-			double time_interval = (double)(clock() - time_s) / CLOCKS_PER_SEC;
-			
-			if (time_interval > 1.5)
-			{
-				std::cout << "debug : 两步之间超过限制 -- " << endl;
-			}
-
-			if (time_interval < 0.06)
-			{
-				std::cout << "抹去0.06s的噪声" << endl;
-				
-				return result;
-			}
-
-			if (time_interval < 1.5)
-			{
-
-				if ((cmd_stage == FRONT_LEFT || cmd_stage == FRONT_RIGHT) && sqrt(x_offset * x_offset + y_offset * y_offset) < 15.f)
-				{
-					result =  cmd_stage;
-				}
-				else if ((cmd_stage == BACK_LEFT || cmd_stage == BACK_RIGHT) && rssi < 35)
-				{
-					result = cmd_stage;
-				}
-				else
-				{
-					std::cout << "出现其他问题了" << std::endl;
-				}
-
-			}
-
-			on_floor_count = 0;
-			has_reset_signal = 0;
-			cmd_stage = 0;
-
-			return result;
-		}
-	}
-
-	return -1;
-}
-void SingleFootAction::can_listen_direction_signal(int rssi)
-{
-	if (rssi < 30)
-	{
-		can_report_motion = 1;
-	}
-}
-
-
-
-
-
-

+ 0 - 76
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/SingleFootAction.h

@@ -1,76 +0,0 @@
-
-#include "pub.h"
-#include "ctime"
-
-#define  STOP_ANGLE  -0.65f
-
-
-
-
-class  SingleFootAction {
-
-public:
-
-	SingleFootAction(int foot_type) : can_report_motion(0), pause_signal(0), enter_signal(0), 
-		direction_signal(-1), last_zupt(1), left_or_right(foot_type), interation_state(-1),
-		last_x(0), last_y(0), last_z(0), big_pitch_count(0), can_report_enter_signal(0), last_enter_signal(0),
-		enter_signal_cooling(0)
-	{};
-	void can_listen_direction_signal(int rssi);
-	//void pause_signal_listen(float pitch);
-	int direction_signal_listen(int x, int y, int zupt, int rssi);
-	//void set_motion_signal(int zupt);
-
-	//获取垫脚的以及暂停的信号
-	int enter_signal_listen(float* acc, float pitch);
-
-	int can_listen_enter_signal(float* acc, float pitch);
-
-	FootActionState get_interation_state();
-
-	void run(uint32_t _time, int x, int y, int z, int zupt, int rssi, float pitch, float* acc);
-
-	//新的脚步命令
-	int direction_signal_listen_new(uint32_t _time, int x, int y, int zupt, int rssi, float pitch);
-
-	void reset_interation_state();
-
-	int enter_signal_listen_new(uint32_t _time, float* acc, float pitch);
-
-private:
-	int pause_signal_count;
-	int can_report_motion;
-	int pause_signal;
-	int enter_signal;
-
-	int direction_signal;
-
-	int last_zupt;
-	int left_or_right;
-
-	int interation_state;
-
-	int last_x;
-	
-	int last_y;
-
-	int last_z;
-
-	float acc_x_buff[10];
-	float big_pitch_count;
-
-	int can_report_enter_signal;
-
-	int last_enter_signal;
-
-	int enter_signal_cooling;
-
-	int on_floor_count = 0;
-	int has_reset_signal = 0;
-
-	int cmd_stage = 0;
-
-	clock_t time_s = clock();
-
-	FootActionState footActionState = {0, 0 , 0};
-};

+ 0 - 221
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Tricycle.cpp

@@ -1,221 +0,0 @@
-
-#include "tricycle.h"
-
-#define  PI 3.141592653f
-
-
-Tricycle::Tricycle()
-{
-	memset(result, -1, 4 * sizeof(int));
-	result[0] = 0;
-
-	left_zupt_count = 0;
-	right_zupt_count = 0;
-
-	left_foot_init_heading = 0.0f;
-	right_foot_init_heading = 0.0f;
-
-	left_trigger_time = 0;
-	right_trigger_time = 0;
-
-	last_left_zupt = 1;
-	last_right_zupt = 1;
-
-	memset(last_left_pos, 0, 3 * sizeof(int));
-	memset(last_right_pos, 0, 3 * sizeof(int));
-	
-	left_jump_status = 0;
-	right_jump_status = 0;
-
-	has_init = 0;
-
-	last_jump = 0;
-
-	prop_status = 0;
-
-}
-
-void Tricycle::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int rssi)
-{
-	//1、确定初始的方向
-
-	if (left_zupt)
-	{
-		left_zupt_count++;
-	}
-	else
-	{
-		left_zupt_count = 0;
-	}
-
-	if (right_zupt)
-	{
-		right_zupt_count++;
-	}
-	else
-	{
-		right_zupt_count = 0;
-	}
-
-
-	float cur_left_heading = left_att[0] * 0.0001f;
-	float cur_right_heading = right_att[0] * 0.0001f;
-
-
-	//计算初始方向
-	if (left_zupt_count > 100 && right_zupt_count > 100 && rssi < 32)
-	{
-		left_foot_init_heading  = cur_left_heading;
-		right_foot_init_heading = cur_right_heading;
-
-		if (has_init == 0)
-		{
-			std::cout << "Cycle has inited !!!" << endl;
-		}
-
-		has_init = 1;
-
-	}
-
-
-	float left_heading_offset  = calHeadingOffset(left_foot_init_heading, cur_left_heading);
-
-	float right_heading_offset = calHeadingOffset(right_foot_init_heading, cur_right_heading);
-
-	//std::cout << "left_heading_offset : " << left_heading_offset << " right_heading_offset : " << right_heading_offset << endl;
-
-	if (fabsf(calHeadingOffset(left_heading_offset, right_heading_offset)) > PI/3.0f)
-	{
-		//std::cout<< "dual_foot_heading appear max angle" <<endl;
-	}
-
-
-	float game_heading_offset = (left_heading_offset + right_heading_offset) * 0.5f;
-
-	//std::cout << "前进度数 :" << game_heading_offset / PI * 180.0f<<endl;
-
-	//2、控制释放道具
-	//先设置一个触发命令的时间点,即怎么判定双脚同时触地,现在设置0.5S左右的大小来等待触地信号的同时到达
-
-	int down_prop = -1;
-
-	int up_prop = -1;
-
-	if (last_jump == 0 && jump)
-	{
-		left_jump_status = 1;
-		right_jump_status = 1;
-
-		std::cout << "过程中出现跳" << endl;
-	}
-
-
-	if ((left_zupt && last_left_zupt == 0) || (right_zupt && last_right_zupt == 0))
-	{
-		if (left_pos_offset < -15 && right_pos_offset > 15)
-		{
-			up_prop = 1;
-
-			prop_status = up_prop;
-
-			std::cout << "上层 发放物品" << endl;
-		}
-		else if (left_jump_status == 1 && right_jump_status == 1)
-		{	
-			if (abs(left_pos_offset) < 10 && abs(right_pos_offset) < 10 && prop_status == 1)
-			{
-				up_prop = 1;
-				std::cout << "因为上个状态是 上层发放物品,所以 这次也是 上层发放物品"  << endl;
-			}
-			else if (abs(left_pos_offset) < 8 && abs(right_pos_offset) < 8)
-			{
-				down_prop = 1;
-
-				prop_status = 0;
-
-				std::cout << "下层 发放物品" << endl;
-			}
-			else
-			{
-				prop_status = 0;
-			}
-			std::cout << "left_pos_offset : " << left_pos_offset << "  right_pos_offset : " << right_pos_offset << endl;
-		}
-
-		if (left_pos_offset > 8 && right_pos_offset < -8)
-		{
-			prop_status = 0;
-		}
-
-		left_jump_status = 0;
-		right_jump_status = 0;
-	}
-
-
-
-
-	if (left_zupt)
-	{
-
-		for (int i = 0; i < 3; i++)
-		{
-			last_left_pos[i] = left_pos[i];
-		}
-
-	}
-
-	left_pos_offset = left_pos[0] - last_left_pos[0];
-
-	if (right_zupt)
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			last_right_pos[i] = right_pos[i];
-		}
-	}
-
-	right_pos_offset = right_pos[0] - last_right_pos[0];
-
-	last_left_zupt = left_zupt;
-	last_right_zupt = right_zupt;
-
-	last_jump = jump;
-
-
-	result[0] = (int)(game_heading_offset * 10000.0f);
-
-	result[1] = result[0];
-
-	result[2] = (down_prop == 1 ? MOTION_JUMP_OC : -1);
-	result[3] = (up_prop == 1 ? MOTION_JUMP_VERTICAL : -1);
-
-	if (has_init == 0)
-	{
-		result[0] = 0;
-		result[1] = 0;
-	}
-
-}
-
-float Tricycle::calHeadingOffset(float init_heading, float cur_heading)
-{
-	float heading_offset = cur_heading - init_heading;
-
-	if (heading_offset > PI)
-	{
-		heading_offset = -(2 * PI - heading_offset);
-	}
-	else if (heading_offset < -PI)
-	{
-		heading_offset = (2 * PI + heading_offset);
-	}
-
-	return heading_offset;
-}
-
-void Tricycle::getResult(int* dec)
-{
-	memcpy(dec, result, 4 * sizeof(int));
-}

+ 0 - 60
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/Tricycle.h

@@ -1,60 +0,0 @@
-#pragma once
-#ifndef __tricycle_h__
-#define __tricycle_h__
-
-
-#include "pub.h"
-
-class Tricycle {
-
-public:
-	Tricycle();
-
-	//void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos, int* left_att, int left_zupt, int jump, int down, int rssi);
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int rssi);
-
-	void getResult(int* matrix);
-
-	float calHeadingOffset(float init_heading, float cur_heading);
-
-private:
-
-
-	int result[4];
-
-	int left_result;
-	int right_result;
-
-	int left_zupt_count;
-	int right_zupt_count;
-
-	
-	float left_foot_init_heading;
-	float right_foot_init_heading;
-
-	int left_trigger_time;
-	int right_trigger_time;
-
-	int last_left_zupt;
-	int last_right_zupt;
-
-	int last_left_pos[3];
-	int last_right_pos[3];
-
-	int left_jump_status;
-	int right_jump_status;
-
-	int has_init;
-
-	int left_pos_offset;
-	int right_pos_offset;
-
-	int last_jump;
-
-	int prop_status;
-
-};
-
-#endif

+ 0 - 297
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/jumpH5.cpp

@@ -1,297 +0,0 @@
-
-#include "jumpH5.h"
-
-int detect_sharp_trend(unsigned int *press_window, int length)
-{
-	unsigned int max_val = press_window[0];
-	unsigned int min_val = press_window[0];
-	
-	int max_index = 0;
-	int min_index = 0;
-
-	for(int i = 0; i < length; i++)
-	{
-		if (max_val < press_window[i])
-		{
-			max_val = press_window[i];
-
-			max_index = i;
-		}
-
-		if (min_val > press_window[i])
-		{
-			min_val = press_window[i];
-			
-			min_index = i;
-		}
-	}
-
-	if (max_index > min_index && max_val > min_val + 3000)
-	{
-		std::cout << "max_val - min_val : " << max_val - min_val << endl;
-		return 1;
-	}
-	return 0;
-}
-
-void jumpH5::Process(int* right_pos, int* right_att, int* right_acc, int right_press,int right_zupt, 
-	int* left_pos, int* left_att, int* left_acc, int left_press, int left_zupt,
-	int jump, int time_s, int rssi)
-{
-	static int right_stand_count = 0;
-	static int left_stand_count = 0;
-
-	int right_pos_offset[3];
-	int left_pos_offset[3];
-
-	memcpy(left_press_window, left_press_window + 1, 9 * sizeof(unsigned int));
-	left_press_window[9] = (unsigned int)(left_press);
-
-	//std::cout << "left_acc[2] : " << left_acc[2] << std::endl;
-
-	memcpy(right_press_window, right_press_window + 1, 9 * sizeof(unsigned int));
-	right_press_window[9] = (unsigned int)(right_press);
-
-	if (detect_sharp_trend(left_press_window, 10) == 1)
-	{
-		std::cout << "detect_sharp_trend == 1, left" << std::endl;
-		left_press_zupt_wait = 20;
-	}
-
-	if (detect_sharp_trend(right_press_window, 10) == 1)
-	{
-		right_press_zupt_wait = 20;
-	}
-
-
-	if ((right_att[0] == 1 || right_att[1] == 1 || right_att[2] == 1)
-		&& (right_press_zupt_wait > 0 || last_right_zupt == 1))
-	{
-		right_zupt = 1;
-
-		can_detect_acc_zero_right = 0;
-	}
-	else
-	{
-		right_zupt = 0;
-	}
-
-	if ((left_att[0] == 1 || left_att[1] == 1 || left_att[2] == 1)
-		&& (left_press_zupt_wait > 0 || last_left_zupt == 1))
-	{
-		left_zupt = 1;
-
-		can_detect_acc_zero_left = 0;
-	}
-	else
-	{
-		left_zupt = 0;
-	}
-
-
-	//计算时间戳
-	if (H5_receive_time == -256)
-	{
-		H5_receive_time = time_s;
-	}
-
-	H5_time_stamp += (time_s - H5_receive_time > 0 ? time_s - H5_receive_time : time_s - H5_receive_time + 256);
-
-	//std::cout << "H5_time_stamp : " << H5_time_stamp << std::endl;
-
-	//清空命令, 命令缓存160ms
-	if(H5_time_stamp - last_result_time_stamp > 16)
-		memset(H5_result, 0, 2 * sizeof(int));
-
-	for (int i = 0; i < 3; i++)
-	{
-		right_pos_offset[i] = right_pos[i] - last_right_pos[i];
-
-		left_pos_offset[i] = left_pos[i] - last_left_pos[i];
-	}
-	
-
-
-	if ((right_zupt == 0 && left_zupt == 0))
-	{
-		report_tag = 1;
-	}
-
-	//当左右脚都不是贴地面,输出高度,同时统计时间
-	if (report_tag == 1)
-	{
-		int jump_time = time_s - not_on_floor_time;
-		if (time_s - not_on_floor_time < 0)
-		{
-			jump_time += 256;
-		}
-		int high = 0;
-
-		if (abs(left_pos_offset[2]) < abs(right_pos_offset[2]))
-		{
-			high = left_pos_offset[2] > 0 ? left_pos_offset[2] : 0;
-		}
-		else
-		{
-			high = right_pos_offset[2] > 0 ? right_pos_offset[2] : 0;
-		}
-		//std::cout << "空中持续时间: " << jump_time << "/ms" << ",高度为:  "<< high << endl;
-
-		H5_result[0] = 3; H5_result[1] = jump_time;
-	}
-	else
-	{
-		not_on_floor_time = time_s;
-	}
-
-	//添加一个计时器,用以探测所有触发点,来判断是否触底
-	if (left_zupt == 1 && last_left_zupt == 0 && left_wait_time == 0)
-	{
-		left_wait_time = 10;
-
-		memcpy(left_pos_wait, left_pos_offset, 3 * sizeof(int));
-	}
-
-	if (right_zupt == 1 && last_right_zupt == 0 && right_wait_time == 0)
-	{
-		right_wait_time = 10;
-
-		memcpy(right_pos_wait, right_pos_offset, 3 * sizeof(int));
-
-	}
-
-	if ((left_wait_time > 0 && right_wait_time > 0) && report_tag == 1)
-	{
-		//证明双脚踏地, 暂时双脚踏地了,输出双个格子
-		if (next_result_wait == 0)
-		{
-			std::cout << "dual foot on floor" << std::endl;
-			next_result_wait = 5;
-
-			int distance_rssi = 0;
-
-			//利用rssi来判断距离,太近,近, 适中, 远,很远 的等级
-			if (rssi < 20)
-			{
-				std::cout << "双脚接地 距离过近" << endl;
-				distance_rssi = 0;
-			}
-			else if (rssi < 25)
-			{
-				std::cout << "双脚接地,距离稍微近" << endl;
-
-				distance_rssi = 1;
-			}
-			else if (rssi < 30)
-			{
-				std::cout << "双脚接地,距离合适" << endl;
-
-				distance_rssi = 2;
-			}
-			else if (rssi < 35)
-			{
-				std::cout << "双脚接地,距离稍微远" << endl;
-
-				distance_rssi = 3;
-			}
-
-			else 
-			{
-				std::cout << "双脚接地,距离过远" << endl;
-				distance_rssi = 4;
-			}
-
-			H5_result[0] = 1; H5_result[1] = distance_rssi; last_result_time_stamp = H5_time_stamp;
-			
-		}
-
-		left_wait_time = 0;
-		right_wait_time = 0;
-
-		report_tag = 0;
-
-	}
-	else if (left_wait_time == 0 && left_zupt == 1 && right_zupt == 0 && report_tag == 1 )
-	{
-		if (next_result_wait == 0)
-		{
-			std::cout << "only left foot on floor" << std::endl;
-			next_result_wait = 5;
-
-			H5_result[0] = 2; 
-			H5_result[1] = 1;
-			last_result_time_stamp = H5_time_stamp;
-		}
-		report_tag = 0;
-	}
-	else if (right_wait_time == 0 && right_zupt == 1 && left_zupt == 0 && report_tag == 1)
-	{
-		if (next_result_wait == 0)
-		{
-			std::cout << "only right foot on floor" << std::endl;
-			next_result_wait = 5;
-
-			H5_result[0] = 2;
-			H5_result[1] = 2;
-
-			last_result_time_stamp = H5_time_stamp;
-		}
-		report_tag = 0;
-	}
-
-	//直接存高度双脚高度
-	H5_result[2] = left_pos_offset[2] > 0 ? left_pos_offset[2] : 0;
-
-	H5_result[2] = H5_result[2] > 10 ? 10 : H5_result[2];
-
-	H5_result[3] = right_pos_offset[2] > 0 ? right_pos_offset[2] : 0;
-
-	H5_result[3] = H5_result[3] > 10 ? 10 : H5_result[3];
-
-	//计算偏移量, 检测到left_zupt
-	if(left_zupt == 1)
-		memcpy(last_left_pos, left_pos, 3 * sizeof(int));
-
-	if (right_zupt == 1)
-		memcpy(last_right_pos, right_pos, 3 * sizeof(int));
-	
-
-	if (left_wait_time > 0)
-	{
-		left_wait_time--;
-	}
-
-	if (right_wait_time > 0)
-	{
-		right_wait_time--;
-	}
-
-	if (next_result_wait > 0)
-	{
-		next_result_wait--;
-	}
-
-	if (left_press_zupt_wait > 0)
-	{
-		left_press_zupt_wait--;
-	}
-
-	if (right_press_zupt_wait > 0)
-	{
-		right_press_zupt_wait--;
-	}
-
-	//std::cout << "result: " << H5_result[0] << " " << H5_result[1] << " " << H5_result[2] << " " << H5_result[3] << " " << std::endl;
-
-	last_right_zupt = right_zupt;
-
-	last_left_zupt = left_zupt;
-
-	H5_receive_time = time_s;
-
-}
-
-void jumpH5::getResult(int* result)
-{
-	memcpy(result, H5_result, 4 * sizeof(int));
-}

+ 0 - 54
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/jumpH5.h

@@ -1,54 +0,0 @@
-#ifndef _jumpH5_H
-#define _jumpH5_H
-
-#include "pub.h"
-
-class jumpH5 {
-public:
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_press, int right_zupt,
-		int* left_pos, int* left_att, int* left_acc, int left_press, int left_zupt,
-		int jump, int time_s, int rssi);
-
-	void  getResult(int* result);
-private:
-
-	int last_right_pos[3];
-	int last_left_pos[3];
-
-	unsigned int left_press_window[10];
-	unsigned int right_press_window[10];
-
-	int left_press_zupt_wait = 0;
-	int right_press_zupt_wait = 0;
-
-	int can_detect_acc_zero_left = 0;
-
-	int can_detect_acc_zero_right = 0;
-
-	int last_right_zupt;
-	int last_left_zupt;
-
-	int left_wait_time = 0;
-	int right_wait_time = 0;
-
-	int left_pos_wait[3];
-	int right_pos_wait[3];
-
-	int report_tag = 0;
-
-	int next_result_wait = 0;
-
-	int not_on_floor_time = 0;
-	
-	int H5_result[4] = { 0,0,0,0 };
-
-	unsigned int H5_time_stamp = 0;
-
-	unsigned int last_result_time_stamp = 0;
-	
-	int H5_receive_time = -256;
-
-
-
-};
-#endif

+ 0 - 93
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/pub.h

@@ -1,93 +0,0 @@
-#pragma once
-#ifndef _pub_h__
-#define _pub_h__
-
-#include <iostream>
-#include <math.h>
-#include <stdlib.h>
-#include <vector>
-#include <string> 
-
-using namespace std;
-
-#define LEFT_FOOT 1
-#define RIGHT_FOOT 2
-
-//#define DANCING_THRESH 5
-#define DANCING_THRESH 0
-#define CIRCLE_CENTER 22
-
-#define ORIGINTRAJ 0
-#define RUNGAME 1
-#define DANCEGAME 2
-#define H5GAME 3
-#define MONSTER 4
-#define RUINS 5
-#define CYCLE 6
-#define BIGFOOT 7
-
-#define TESTGAME 100
-
-#define RSSI_LIMIT
-
-#define PI 3.141592653
-
-#define DANCEGAME_MIN_RSSI 26
-
-#define PRESS_MIN 41000
-
-#define GAME_VERSION "0.3.52"
-
-enum CMD_MOTION
-{
-    MOTION_STOP = 0,
-    MOTION_RUN, // 跑
-    MOTION_JUMP, // 跳
-    MOTION_DOWN, // 蹲
-    MOTION_LEFT, // 滑左
-    MOTION_RIGHT, // 滑右
-    MOTION_FRONT, // 滑前
-    MOTION_BACK, // 滑后
-    MOTION_LEFT_UP, // 点击-左上
-    MOTION_LEFT_DOWN, // 点击-左下
-    MOTION_RIGHT_UP, // 点击-右上
-    MOTION_RIGHT_DOWN, // 点击-右下
-    MOTION_STEP, // 点击-原地踩
-    MOTION_JUMP_OC, // 开合跳
-    MOTION_JUMP_VERTICAL, // 垂直跳
-
-
-    NUMBERS_OF_MOTION,
-
-    MOTION_CANCEL = 0x0100,
-};
-
-enum CMD_INTERATION
-{
-   NONE_INTERATION = 0,
-   FRONT_LEFT,//左上键
-   FRONT_RIGHT,//右上键
-   BACK_LEFT,//左下键
-   BACK_RIGHT,//右下键
-
-   ENTER_KEY,//确认键
-   CANCLE_KEY,//取消键
-};
-
-struct posData
-{
-	float pos_x;
-	float pos_y;
-	float rssi;
-};
-
-struct FootActionState {
-
-    int FootState;
-
-    int StateCount;
-
-    uint32_t Triggering_time;
-};
-
-#endif

+ 0 - 186
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/publicMotion.cpp

@@ -1,186 +0,0 @@
-#include "publicMotion.h"
-
-publicMotion::publicMotion()
-{
-	motion_time = 0;
-
-	memset(left_front_mag_window, 0, 5 * sizeof(int));
-
-	memset(right_front_mag_window, 0, 5 * sizeof(int));
-
-	memset(left_back_mag_window, 0, 5 * sizeof(int));
-
-	memset(right_back_mag_window, 0, 5 * sizeof(int));
-
-	memset(left_front_mag_mean_window, 0, 15 * sizeof(int));
-
-	memset(right_front_mag_mean_window, 0, 15 * sizeof(int));
-
-	memset(left_back_mag_mean_window, 0, 15 * sizeof(int));
-
-	memset(right_back_mag_mean_window, 0, 15 * sizeof(int));
-
-	left_front_up_time = 0;
-	right_front_up_time = 0;
-
-	left_back_up_time = 0;
-	right_back_up_time = 0;
-
-}
-
-void publicMotion::meanFiltData(int time_count, int mag_data, int* mag_data_window, int* mean_mag_data)
-{
-	if (time_count < 7)
-	{
-		mean_mag_data[time_count % 5] = mag_data;
-
-	}
-	else
-	{
-		float sum = 0;
-		for (int i = 0; i < 5; i++)
-		{
-			sum += mag_data_window[i];
-		}
-
-		mean_mag_data[time_count % 15] = sum / 5.;
-	}
-}
-
-/*
-* 均值滤波的窗口大小为10, 当检测到前三个的和 < 后三个数据的和,则视为上升的趋势
-* 上升的时候,还要检测上升趋势的最大值,防止两个凸曲线有重叠误判为蹲
-*/
-void  publicMotion::setSpecialPoint_part(int mag_data, int* mean_data, int* max_val, int* down_point, int* up_time)
-{
-	int prev_sum = (mean_data[(motion_time - 8) % 15] + mean_data[(motion_time - 7) % 15] + mean_data[(motion_time - 6) % 15]);
-
-	int prev_sum1 = (mean_data[(motion_time - 11) % 15] + mean_data[(motion_time - 10) % 15] + mean_data[(motion_time - 9) % 15]);
-	int prev_sum2 = (mean_data[(motion_time - 14) % 15] + mean_data[(motion_time - 13) % 15] + mean_data[(motion_time - 12) % 15]);
-
-	int back_sum = (mean_data[(motion_time - 2) % 15] + mean_data[(motion_time - 1) % 15] + mean_data[(motion_time) % 15]);
-
-	if (prev_sum < back_sum - 100 || prev_sum1 < back_sum - 10 || prev_sum2 < back_sum - 10)
-	{
-		if (*max_val < mean_data[motion_time % 15])
-		{
-			*max_val = mean_data[motion_time % 15];
-		}
-
-		(*up_time)++;
-	}
-	else
-	{
-		*max_val = mean_data[motion_time % 15];
-
-		*down_point = mean_data[motion_time % 15];
-
-		*up_time = 0;
-	}
-}
-
-void publicMotion::setSpecialPoint(int left_front_data, int right_front_data, int left_back_data, int right_back_data)
-{
-	if (motion_time < 10)
-	{
-		left_back_mag_point_val = left_back_data;
-		right_back_mag_point_val = right_back_data;
-
-		left_front_mag_point_val = left_front_data;
-		right_front_mag_point_val = right_front_data;
-
-		left_back_mag_up_max = left_back_data;
-		right_back_mag_up_max = right_back_data;
-
-		left_front_mag_up_max = left_front_data;
-		right_front_mag_up_max = right_front_data;
-	}
-	else
-	{
-
-		setSpecialPoint_part(left_front_data, left_front_mag_mean_window, &left_front_mag_up_max, &left_front_mag_point_val, &left_front_up_time);
-
-		setSpecialPoint_part(right_front_data, right_front_mag_mean_window, &right_front_mag_up_max, &right_front_mag_point_val, &right_front_up_time);
-
-		setSpecialPoint_part(left_back_data, left_back_mag_mean_window, &left_back_mag_up_max, &left_back_mag_point_val, &left_back_up_time);
-
-		setSpecialPoint_part(right_back_data, right_back_mag_mean_window, &right_back_mag_up_max, &right_back_mag_point_val, &right_back_up_time);
-	}
-}
-
-void publicMotion::setMagData(int left_front_data, int right_front_data, int left_back_data, int right_back_data)
-{
-
-	left_front_mag_window[motion_time % 5] = left_front_data;
-
-	right_front_mag_window[motion_time % 5] = right_front_data;
-
-	left_back_mag_window[motion_time % 5] = left_back_data;
-
-	right_back_mag_window[motion_time % 5] = right_back_data;
-
-	//均值滤波
-	meanFiltData(motion_time, left_front_data, left_front_mag_window, left_front_mag_mean_window);
-	meanFiltData(motion_time, right_front_data, right_front_mag_window, right_front_mag_mean_window);
-
-	meanFiltData(motion_time, left_back_data, left_back_mag_window, left_back_mag_mean_window);
-	meanFiltData(motion_time, right_back_data, right_back_mag_window, right_back_mag_mean_window);
-
-	setSpecialPoint(left_front_data, right_front_data, left_back_data, right_back_data);
-
-
-	motion_time++;
-
-}
-
-int publicMotion::getDownData(int left_front_data, int right_front_data, int left_back_data, int right_back_data)
-{
-	setMagData(left_front_data, right_front_data, left_back_data, right_back_data);
-
-	int  left_front_down_tag = 0;
-	int  right_front_down_tag = 0;
-
-	int  left_back_down_tag = 0;
-	int  right_back_down_tag = 0;
-
-	if (left_back_data - left_back_mag_point_val > 2000 || (left_back_data - left_back_mag_point_val > 1000 && left_back_mag_point_val > 15000))
-	{
-		left_back_down_tag = 1;
-	}
-
-	if (right_back_data - right_back_mag_point_val > 2000 || (right_back_data - right_back_mag_point_val > 1000 && right_back_mag_point_val > 15000))
-	{
-		right_back_down_tag = 1;
-	}
-
-
-	if (left_back_down_tag && right_back_down_tag
-		&& left_back_data - left_back_mag_up_max > -500 && right_back_data - right_back_mag_up_max > -500 &&
-		abs(left_back_up_time - right_back_up_time) < 10 && left_back_up_time > 3 && right_back_up_time > 3)
-	{
-
-		return 1;
-	}
-
-
-	if (left_front_data - left_front_mag_point_val > 2000 || (left_front_data - left_front_mag_point_val > 1000 && left_front_mag_point_val > 15000))
-	{
-		left_front_down_tag = 1;
-	}
-
-	if (right_front_data - right_front_mag_point_val > 2000 || (right_front_data - right_front_mag_point_val > 1000 && right_front_mag_point_val > 15000))
-	{
-		right_front_down_tag = 1;
-	}
-
-	if (left_front_down_tag && right_front_down_tag
-		&& left_front_data - left_front_mag_up_max > -500 && right_front_data - right_front_mag_up_max > -500
-		&& abs(left_front_up_time - right_front_up_time) < 10 && left_front_up_time > 3 && right_front_up_time > 3)
-	{
-
-		return 1;
-	}
-
-
-	return 0;
-}

+ 0 - 58
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/publicMotion.h

@@ -1,58 +0,0 @@
-#pragma once
-#ifndef _PUBLIC_MOTION_H
-#define _PUBLIC_MOTION_H
-
-#include <iostream>
-
-class publicMotion {
-
-public:
-	publicMotion();
-
-	void setMagData(int left_front_data, int right_front_data, int left_mag_data, int right_mag_data);
-	
-	void meanFiltData(int time_count, int mag_data, int* mag_data_window, int* mean_mag_data);
-
-	void setSpecialPoint(int left_front_data, int right_front_data, int left_mag_data, int right_mag_data);
-
-	int getDownData(int left_front_data, int right_front_data, int left_mag_data, int right_mag_data);
-
-	void setSpecialPoint_part(int mag_data, int* mean_data, int *max_val, int *down_point, int *up_time);
-
-private:
-	int left_front_mag_window[5];
-	int right_front_mag_window[5];
-
-	int left_back_mag_window[5];
-	int right_back_mag_window[5];
-
-	int left_front_mag_mean_window[15];
-	int right_front_mag_mean_window[15];
-
-	int left_back_mag_mean_window[15];
-	int right_back_mag_mean_window[15];
-
-	int motion_time;
-
-	int left_back_mag_point_val;
-	int right_back_mag_point_val;
-
-	int left_front_mag_point_val;
-	int right_front_mag_point_val;
-
-	int left_back_mag_up_max;
-	int right_back_mag_up_max;
-
-	int left_front_mag_up_max;
-	int right_front_mag_up_max;
-
-	int left_front_up_time;
-	int right_front_up_time;
-	
-	int left_back_up_time;
-	int right_back_up_time;
-
-};
-
-
-#endif

+ 0 - 22
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/testGame.cpp

@@ -1,22 +0,0 @@
-
-#include "testGame.h"
-
-testGame::testGame()
-{
-	for (int i = 0; i < 4; i++)
-	{
-		result[i] = 0;
-	}
-}
-
-void testGame::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int rssi)
-{
-	
-}
-
-void testGame::getResult(int* matrix)
-{
-	memcpy(matrix, result, 4 * sizeof(int));
-}

+ 0 - 24
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/testGame.h

@@ -1,24 +0,0 @@
-#pragma once
-#ifndef __test_game_h__
-#define __test_game_h__
-
-#include <iostream>
-
-class testGame {
-
-public:
-	testGame();
-
-	//void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos, int* left_att, int left_zupt, int jump, int down, int rssi);
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int rssi);
-
-	void getResult(int* matrix);
-
-private:
-
-	int result[4];
-};
-
-#endif

+ 2 - 3
DanceGame/Classes/UnityAppController.mm

@@ -245,10 +245,9 @@ extern "C" void UnityRequestQuit()
     NSDictionary* notifData = [NSDictionary dictionaryWithObjects: values forKeys: keys];
     AppController_SendNotificationWithArg(kUnityOnOpenURL, notifData);
     
-    // [FitfunSDKManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
+//     [FitfunSDKManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
     
-    IOSPlatformSDK * sdk = [IOSPlatformSDK sharedInstance];
-    [sdk startWithUrl:url];
+    [[IOSPlatformSDK sharedInstance] startWithUrl:url];
     
     return YES;
 }

+ 121 - 115
DanceGame/Unity-iPhone.xcodeproj/project.pbxproj

@@ -190,6 +190,23 @@
 		8CBD47E49638FD0CF890B3BC /* Il2CppMetadataUsage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C7A4AEC80BD848836F713B2 /* Il2CppMetadataUsage.cpp */; };
 		91E346D88C9D5D9F7D2FA874 /* Il2CppInteropDataTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5DC4F7E951D1ECD94986099 /* Il2CppInteropDataTable.cpp */; };
 		92E64B4E99F11D7332C25194 /* Il2CppCompilerCalculateTypeValues_10Table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A1348B696429D055C356554 /* Il2CppCompilerCalculateTypeValues_10Table.cpp */; };
+		9338AE7D279BB54600D74E1B /* H5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9338AE7C279BB54600D74E1B /* H5.cpp */; };
+		9394A7422797C1600031DB82 /* Interaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7232797C15F0031DB82 /* Interaction.cpp */; };
+		9394A7432797C1600031DB82 /* OriginTraj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7262797C15F0031DB82 /* OriginTraj.cpp */; };
+		9394A7442797C1600031DB82 /* DanceFoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7272797C15F0031DB82 /* DanceFoot.cpp */; };
+		9394A7452797C1600031DB82 /* SingleFootAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7292797C15F0031DB82 /* SingleFootAction.cpp */; };
+		9394A7462797C1600031DB82 /* Tricycle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A72A2797C15F0031DB82 /* Tricycle.cpp */; };
+		9394A7472797C1600031DB82 /* RunGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A72F2797C1600031DB82 /* RunGame.cpp */; };
+		9394A7482797C1600031DB82 /* jumpH5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7302797C1600031DB82 /* jumpH5.cpp */; };
+		9394A7492797C1600031DB82 /* MonsterH5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7312797C1600031DB82 /* MonsterH5.cpp */; };
+		9394A74A2797C1600031DB82 /* publicMotion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7352797C1600031DB82 /* publicMotion.cpp */; };
+		9394A74B2797C1600031DB82 /* FootStep.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7362797C1600031DB82 /* FootStep.cpp */; };
+		9394A74C2797C1600031DB82 /* Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7372797C1600031DB82 /* Game.cpp */; };
+		9394A74D2797C1600031DB82 /* RuinsExplore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7382797C1600031DB82 /* RuinsExplore.cpp */; };
+		9394A74E2797C1600031DB82 /* BigFoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7392797C1600031DB82 /* BigFoot.cpp */; };
+		9394A74F2797C1600031DB82 /* testGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A73B2797C1600031DB82 /* testGame.cpp */; };
+		9394A7502797C1600031DB82 /* DanceGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A73E2797C1600031DB82 /* DanceGame.cpp */; };
+		9394A7512797C1600031DB82 /* InertialTrajProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9394A7402797C1600031DB82 /* InertialTrajProcess.cpp */; };
 		93AFCE54278FCE1E00BF6965 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE3D278FCE1D00BF6965 /* NSArray+AvoidCrash.m */; };
 		93AFCE55278FCE1E00BF6965 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE3F278FCE1D00BF6965 /* NSString+AvoidCrash.m */; };
 		93AFCE56278FCE1E00BF6965 /* NSDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE40278FCE1D00BF6965 /* NSDictionary+AvoidCrash.m */; };
@@ -280,22 +297,6 @@
 		93E62D95276C86EA006975D1 /* GameObjc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93E62D39276C86EA006975D1 /* GameObjc.mm */; };
 		93E62D96276C86EA006975D1 /* MYFactoryManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E62D3A276C86EA006975D1 /* MYFactoryManager.m */; };
 		93E62D97276C86EA006975D1 /* UIView+ST.m in Sources */ = {isa = PBXBuildFile; fileRef = 93E62D3B276C86EA006975D1 /* UIView+ST.m */; };
-		93E73833278BD7550017A553 /* Tricycle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73813278BD7520017A553 /* Tricycle.cpp */; };
-		93E73834278BD7550017A553 /* BigFoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73816278BD7520017A553 /* BigFoot.cpp */; };
-		93E73835278BD7550017A553 /* OriginTraj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73817278BD7530017A553 /* OriginTraj.cpp */; };
-		93E73836278BD7550017A553 /* RuinsExplore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73818278BD7530017A553 /* RuinsExplore.cpp */; };
-		93E73837278BD7550017A553 /* RunGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7381B278BD7530017A553 /* RunGame.cpp */; };
-		93E73838278BD7550017A553 /* DanceFoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7381C278BD7530017A553 /* DanceFoot.cpp */; };
-		93E73839278BD7550017A553 /* MonsterH5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7381E278BD7530017A553 /* MonsterH5.cpp */; };
-		93E7383A278BD7550017A553 /* jumpH5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73820278BD7530017A553 /* jumpH5.cpp */; };
-		93E7383B278BD7550017A553 /* SingleFootAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73824278BD7540017A553 /* SingleFootAction.cpp */; };
-		93E7383C278BD7550017A553 /* Interaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E73826278BD7540017A553 /* Interaction.cpp */; };
-		93E7383D278BD7550017A553 /* testGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7382A278BD7540017A553 /* testGame.cpp */; };
-		93E7383E278BD7550017A553 /* InertialTrajProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7382B278BD7540017A553 /* InertialTrajProcess.cpp */; };
-		93E7383F278BD7550017A553 /* DanceGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7382C278BD7540017A553 /* DanceGame.cpp */; };
-		93E73840278BD7550017A553 /* publicMotion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7382D278BD7540017A553 /* publicMotion.cpp */; };
-		93E73841278BD7550017A553 /* FootStep.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7382E278BD7540017A553 /* FootStep.cpp */; };
-		93E73842278BD7550017A553 /* Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E7382F278BD7540017A553 /* Game.cpp */; };
 		95C14FE9BED3975E713BA10E /* Il2CppGenericMethodDefinitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F9B4A2295D8624A07C3365B /* Il2CppGenericMethodDefinitions.cpp */; };
 		960391221D6CE46E003BF157 /* MediaToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 960391211D6CE46E003BF157 /* MediaToolbox.framework */; };
 		964C4A8287776D92342413A7 /* Bulk_UnityEngine.ParticleSystemModule_0.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDCF425D8FFA89C9BA1A04FA /* Bulk_UnityEngine.ParticleSystemModule_0.cpp */; };
@@ -647,7 +648,42 @@
 		8D7740188BA9A89E03EE88A4 /* Il2CppCompilerCalculateTypeValues_32Table.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Il2CppCompilerCalculateTypeValues_32Table.cpp; path = Classes/Native/Il2CppCompilerCalculateTypeValues_32Table.cpp; sourceTree = SOURCE_ROOT; };
 		8DD1467686B0602CA38E0CC9 /* Bulk_UnityEngine.GridModule_0.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Bulk_UnityEngine.GridModule_0.cpp; path = Classes/Native/Bulk_UnityEngine.GridModule_0.cpp; sourceTree = SOURCE_ROOT; };
 		913F48D5B9075C1037EDE48D /* GenericMethods0.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GenericMethods0.cpp; path = Classes/Native/GenericMethods0.cpp; sourceTree = SOURCE_ROOT; };
+		9338AE7B279BB54500D74E1B /* H5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = H5.h; path = ../../../../../../../../shoe_sdk_c/H5.h; sourceTree = "<group>"; };
+		9338AE7C279BB54600D74E1B /* H5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = H5.cpp; path = ../../../../../../../../shoe_sdk_c/H5.cpp; sourceTree = "<group>"; };
 		935642749A1C0E55C636858E /* Bulk_Assembly-CSharp_1.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "Bulk_Assembly-CSharp_1.cpp"; path = "Classes/Native/Bulk_Assembly-CSharp_1.cpp"; sourceTree = SOURCE_ROOT; };
+		9394A7212797C15F0031DB82 /* DanceGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DanceGame.h; path = ../../../../../../../../shoe_sdk_c/DanceGame.h; sourceTree = "<group>"; };
+		9394A7222797C15F0031DB82 /* DanceFoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DanceFoot.h; path = ../../../../../../../../shoe_sdk_c/DanceFoot.h; sourceTree = "<group>"; };
+		9394A7232797C15F0031DB82 /* Interaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Interaction.cpp; path = ../../../../../../../../shoe_sdk_c/Interaction.cpp; sourceTree = "<group>"; };
+		9394A7242797C15F0031DB82 /* RunGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RunGame.h; path = ../../../../../../../../shoe_sdk_c/RunGame.h; sourceTree = "<group>"; };
+		9394A7252797C15F0031DB82 /* jumpH5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jumpH5.h; path = ../../../../../../../../shoe_sdk_c/jumpH5.h; sourceTree = "<group>"; };
+		9394A7262797C15F0031DB82 /* OriginTraj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OriginTraj.cpp; path = ../../../../../../../../shoe_sdk_c/OriginTraj.cpp; sourceTree = "<group>"; };
+		9394A7272797C15F0031DB82 /* DanceFoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DanceFoot.cpp; path = ../../../../../../../../shoe_sdk_c/DanceFoot.cpp; sourceTree = "<group>"; };
+		9394A7282797C15F0031DB82 /* InertialTrajProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InertialTrajProcess.h; path = ../../../../../../../../shoe_sdk_c/InertialTrajProcess.h; sourceTree = "<group>"; };
+		9394A7292797C15F0031DB82 /* SingleFootAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SingleFootAction.cpp; path = ../../../../../../../../shoe_sdk_c/SingleFootAction.cpp; sourceTree = "<group>"; };
+		9394A72A2797C15F0031DB82 /* Tricycle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tricycle.cpp; path = ../../../../../../../../shoe_sdk_c/Tricycle.cpp; sourceTree = "<group>"; };
+		9394A72B2797C15F0031DB82 /* SingleFootAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SingleFootAction.h; path = ../../../../../../../../shoe_sdk_c/SingleFootAction.h; sourceTree = "<group>"; };
+		9394A72C2797C15F0031DB82 /* MonsterH5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MonsterH5.h; path = ../../../../../../../../shoe_sdk_c/MonsterH5.h; sourceTree = "<group>"; };
+		9394A72D2797C1600031DB82 /* FootStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FootStep.h; path = ../../../../../../../../shoe_sdk_c/FootStep.h; sourceTree = "<group>"; };
+		9394A72E2797C1600031DB82 /* testGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testGame.h; path = ../../../../../../../../shoe_sdk_c/testGame.h; sourceTree = "<group>"; };
+		9394A72F2797C1600031DB82 /* RunGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RunGame.cpp; path = ../../../../../../../../shoe_sdk_c/RunGame.cpp; sourceTree = "<group>"; };
+		9394A7302797C1600031DB82 /* jumpH5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jumpH5.cpp; path = ../../../../../../../../shoe_sdk_c/jumpH5.cpp; sourceTree = "<group>"; };
+		9394A7312797C1600031DB82 /* MonsterH5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MonsterH5.cpp; path = ../../../../../../../../shoe_sdk_c/MonsterH5.cpp; sourceTree = "<group>"; };
+		9394A7322797C1600031DB82 /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Game.h; path = ../../../../../../../../shoe_sdk_c/Game.h; sourceTree = "<group>"; };
+		9394A7332797C1600031DB82 /* Tricycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tricycle.h; path = ../../../../../../../../shoe_sdk_c/Tricycle.h; sourceTree = "<group>"; };
+		9394A7342797C1600031DB82 /* RuinsExplore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RuinsExplore.h; path = ../../../../../../../../shoe_sdk_c/RuinsExplore.h; sourceTree = "<group>"; };
+		9394A7352797C1600031DB82 /* publicMotion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = publicMotion.cpp; path = ../../../../../../../../shoe_sdk_c/publicMotion.cpp; sourceTree = "<group>"; };
+		9394A7362797C1600031DB82 /* FootStep.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FootStep.cpp; path = ../../../../../../../../shoe_sdk_c/FootStep.cpp; sourceTree = "<group>"; };
+		9394A7372797C1600031DB82 /* Game.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Game.cpp; path = ../../../../../../../../shoe_sdk_c/Game.cpp; sourceTree = "<group>"; };
+		9394A7382797C1600031DB82 /* RuinsExplore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RuinsExplore.cpp; path = ../../../../../../../../shoe_sdk_c/RuinsExplore.cpp; sourceTree = "<group>"; };
+		9394A7392797C1600031DB82 /* BigFoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BigFoot.cpp; path = ../../../../../../../../shoe_sdk_c/BigFoot.cpp; sourceTree = "<group>"; };
+		9394A73A2797C1600031DB82 /* OriginTraj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OriginTraj.h; path = ../../../../../../../../shoe_sdk_c/OriginTraj.h; sourceTree = "<group>"; };
+		9394A73B2797C1600031DB82 /* testGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testGame.cpp; path = ../../../../../../../../shoe_sdk_c/testGame.cpp; sourceTree = "<group>"; };
+		9394A73C2797C1600031DB82 /* Interaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Interaction.h; path = ../../../../../../../../shoe_sdk_c/Interaction.h; sourceTree = "<group>"; };
+		9394A73D2797C1600031DB82 /* pub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pub.h; path = ../../../../../../../../shoe_sdk_c/pub.h; sourceTree = "<group>"; };
+		9394A73E2797C1600031DB82 /* DanceGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DanceGame.cpp; path = ../../../../../../../../shoe_sdk_c/DanceGame.cpp; sourceTree = "<group>"; };
+		9394A73F2797C1600031DB82 /* publicMotion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = publicMotion.h; path = ../../../../../../../../shoe_sdk_c/publicMotion.h; sourceTree = "<group>"; };
+		9394A7402797C1600031DB82 /* InertialTrajProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InertialTrajProcess.cpp; path = ../../../../../../../../shoe_sdk_c/InertialTrajProcess.cpp; sourceTree = "<group>"; };
+		9394A7412797C1600031DB82 /* BigFoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BigFoot.h; path = ../../../../../../../../shoe_sdk_c/BigFoot.h; sourceTree = "<group>"; };
 		93AFCE3D278FCE1D00BF6965 /* NSArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+AvoidCrash.m"; sourceTree = "<group>"; };
 		93AFCE3E278FCE1D00BF6965 /* AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrash.h; sourceTree = "<group>"; };
 		93AFCE3F278FCE1D00BF6965 /* NSString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AvoidCrash.m"; sourceTree = "<group>"; };
@@ -783,39 +819,6 @@
 		93E62D3A276C86EA006975D1 /* MYFactoryManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MYFactoryManager.m; sourceTree = "<group>"; };
 		93E62D3B276C86EA006975D1 /* UIView+ST.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ST.m"; sourceTree = "<group>"; };
 		93E62D98276C87D3006975D1 /* cn.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = cn.entitlements; path = "Unity-iPhone/cn.entitlements"; sourceTree = "<group>"; };
-		93E73812278BD7520017A553 /* jumpH5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jumpH5.h; sourceTree = "<group>"; };
-		93E73813278BD7520017A553 /* Tricycle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tricycle.cpp; sourceTree = "<group>"; };
-		93E73814278BD7520017A553 /* Tricycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tricycle.h; sourceTree = "<group>"; };
-		93E73815278BD7520017A553 /* InertialTrajProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InertialTrajProcess.h; sourceTree = "<group>"; };
-		93E73816278BD7520017A553 /* BigFoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BigFoot.cpp; sourceTree = "<group>"; };
-		93E73817278BD7530017A553 /* OriginTraj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginTraj.cpp; sourceTree = "<group>"; };
-		93E73818278BD7530017A553 /* RuinsExplore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuinsExplore.cpp; sourceTree = "<group>"; };
-		93E73819278BD7530017A553 /* testGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testGame.h; sourceTree = "<group>"; };
-		93E7381A278BD7530017A553 /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Game.h; sourceTree = "<group>"; };
-		93E7381B278BD7530017A553 /* RunGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunGame.cpp; sourceTree = "<group>"; };
-		93E7381C278BD7530017A553 /* DanceFoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DanceFoot.cpp; sourceTree = "<group>"; };
-		93E7381D278BD7530017A553 /* OriginTraj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginTraj.h; sourceTree = "<group>"; };
-		93E7381E278BD7530017A553 /* MonsterH5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MonsterH5.cpp; sourceTree = "<group>"; };
-		93E7381F278BD7530017A553 /* FootStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootStep.h; sourceTree = "<group>"; };
-		93E73820278BD7530017A553 /* jumpH5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jumpH5.cpp; sourceTree = "<group>"; };
-		93E73821278BD7530017A553 /* RuinsExplore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuinsExplore.h; sourceTree = "<group>"; };
-		93E73822278BD7530017A553 /* pub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pub.h; sourceTree = "<group>"; };
-		93E73823278BD7540017A553 /* SingleFootAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleFootAction.h; sourceTree = "<group>"; };
-		93E73824278BD7540017A553 /* SingleFootAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SingleFootAction.cpp; sourceTree = "<group>"; };
-		93E73825278BD7540017A553 /* DanceFoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DanceFoot.h; sourceTree = "<group>"; };
-		93E73826278BD7540017A553 /* Interaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Interaction.cpp; sourceTree = "<group>"; };
-		93E73827278BD7540017A553 /* BigFoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BigFoot.h; sourceTree = "<group>"; };
-		93E73828278BD7540017A553 /* MonsterH5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MonsterH5.h; sourceTree = "<group>"; };
-		93E73829278BD7540017A553 /* Interaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interaction.h; sourceTree = "<group>"; };
-		93E7382A278BD7540017A553 /* testGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testGame.cpp; sourceTree = "<group>"; };
-		93E7382B278BD7540017A553 /* InertialTrajProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InertialTrajProcess.cpp; sourceTree = "<group>"; };
-		93E7382C278BD7540017A553 /* DanceGame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DanceGame.cpp; sourceTree = "<group>"; };
-		93E7382D278BD7540017A553 /* publicMotion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = publicMotion.cpp; sourceTree = "<group>"; };
-		93E7382E278BD7540017A553 /* FootStep.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FootStep.cpp; sourceTree = "<group>"; };
-		93E7382F278BD7540017A553 /* Game.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Game.cpp; sourceTree = "<group>"; };
-		93E73830278BD7540017A553 /* DanceGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DanceGame.h; sourceTree = "<group>"; };
-		93E73831278BD7550017A553 /* publicMotion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = publicMotion.h; sourceTree = "<group>"; };
-		93E73832278BD7550017A553 /* RunGame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunGame.h; sourceTree = "<group>"; };
 		95B64AB492CDBEAF031F8A66 /* Bulk_System.Configuration_0.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Bulk_System.Configuration_0.cpp; path = Classes/Native/Bulk_System.Configuration_0.cpp; sourceTree = SOURCE_ROOT; };
 		960391211D6CE46E003BF157 /* MediaToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaToolbox.framework; path = System/Library/Frameworks/MediaToolbox.framework; sourceTree = SDKROOT; };
 		960B4109946F46C61115CA8B /* Bulk_Assembly-CSharp_26.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "Bulk_Assembly-CSharp_26.cpp"; path = "Classes/Native/Bulk_Assembly-CSharp_26.cpp"; sourceTree = SOURCE_ROOT; };
@@ -1190,6 +1193,48 @@
 			path = Unity;
 			sourceTree = "<group>";
 		};
+		9394A7202797C14E0031DB82 /* shoe_sdk_c */ = {
+			isa = PBXGroup;
+			children = (
+				9394A7392797C1600031DB82 /* BigFoot.cpp */,
+				9394A7412797C1600031DB82 /* BigFoot.h */,
+				9394A7272797C15F0031DB82 /* DanceFoot.cpp */,
+				9394A7222797C15F0031DB82 /* DanceFoot.h */,
+				9394A73E2797C1600031DB82 /* DanceGame.cpp */,
+				9394A7212797C15F0031DB82 /* DanceGame.h */,
+				9394A7362797C1600031DB82 /* FootStep.cpp */,
+				9394A72D2797C1600031DB82 /* FootStep.h */,
+				9394A7372797C1600031DB82 /* Game.cpp */,
+				9394A7322797C1600031DB82 /* Game.h */,
+				9394A7402797C1600031DB82 /* InertialTrajProcess.cpp */,
+				9394A7282797C15F0031DB82 /* InertialTrajProcess.h */,
+				9394A7232797C15F0031DB82 /* Interaction.cpp */,
+				9394A73C2797C1600031DB82 /* Interaction.h */,
+				9394A7302797C1600031DB82 /* jumpH5.cpp */,
+				9394A7252797C15F0031DB82 /* jumpH5.h */,
+				9394A7312797C1600031DB82 /* MonsterH5.cpp */,
+				9394A72C2797C15F0031DB82 /* MonsterH5.h */,
+				9394A7262797C15F0031DB82 /* OriginTraj.cpp */,
+				9394A73A2797C1600031DB82 /* OriginTraj.h */,
+				9394A73D2797C1600031DB82 /* pub.h */,
+				9394A7352797C1600031DB82 /* publicMotion.cpp */,
+				9394A73F2797C1600031DB82 /* publicMotion.h */,
+				9394A7382797C1600031DB82 /* RuinsExplore.cpp */,
+				9394A7342797C1600031DB82 /* RuinsExplore.h */,
+				9394A72F2797C1600031DB82 /* RunGame.cpp */,
+				9394A7242797C15F0031DB82 /* RunGame.h */,
+				9394A7292797C15F0031DB82 /* SingleFootAction.cpp */,
+				9394A72B2797C15F0031DB82 /* SingleFootAction.h */,
+				9394A73B2797C1600031DB82 /* testGame.cpp */,
+				9394A72E2797C1600031DB82 /* testGame.h */,
+				9394A72A2797C15F0031DB82 /* Tricycle.cpp */,
+				9394A7332797C1600031DB82 /* Tricycle.h */,
+				9338AE7C279BB54600D74E1B /* H5.cpp */,
+				9338AE7B279BB54500D74E1B /* H5.h */,
+			);
+			path = shoe_sdk_c;
+			sourceTree = "<group>";
+		};
 		93AFCE3C278FCE1D00BF6965 /* AvoidCrash */ = {
 			isa = PBXGroup;
 			children = (
@@ -1234,13 +1279,13 @@
 		93E62CA2276C86E9006975D1 /* SDK */ = {
 			isa = PBXGroup;
 			children = (
+				9394A7202797C14E0031DB82 /* shoe_sdk_c */,
 				93E62CBE276C86E9006975D1 /* BLE */,
 				93E62CC6276C86E9006975D1 /* Entity   */,
 				93E62CCE276C86E9006975D1 /* HTTP */,
 				93E62CFF276C86E9006975D1 /* IOSPlatformSDK.h */,
 				93E62CCD276C86E9006975D1 /* IOSPlatformSDK.mm */,
 				93E62D00276C86E9006975D1 /* resources   */,
-				93E62CE0276C86E9006975D1 /* shoes_sdk */,
 				93E62CC9276C86E9006975D1 /* ThirdClass */,
 				93E62D31276C86EA006975D1 /* Tool */,
 				93E62CA3276C86E9006975D1 /* UI */,
@@ -1264,20 +1309,20 @@
 		93E62CA4276C86E9006975D1 /* CarouselView */ = {
 			isa = PBXGroup;
 			children = (
-				93E62CA5276C86E9006975D1 /* TXCarouselCollectionViewCell.xib */,
-				93E62CA6276C86E9006975D1 /* TXCarouselViewLayout.h */,
 				93E62CA7276C86E9006975D1 /* ShoesCarouselView.h */,
-				93E62CA8276C86E9006975D1 /* TXCarouselCellModel.m */,
-				93E62CA9276C86E9006975D1 /* TXCarouselCollectionViewCell.h */,
-				93E62CAA276C86E9006975D1 /* ShoesCollectionCell.m */,
-				93E62CAB276C86E9006975D1 /* ShoesCollectionCell.xib */,
-				93E62CAC276C86E9006975D1 /* TXCarouselView.h */,
 				93E62CAD276C86E9006975D1 /* ShoesCarouselView.m */,
-				93E62CAE276C86E9006975D1 /* TXCarouselViewLayout.m */,
 				93E62CAF276C86E9006975D1 /* ShoesCollectionCell.h */,
-				93E62CB0276C86E9006975D1 /* TXCarouselCollectionViewCell.m */,
+				93E62CAA276C86E9006975D1 /* ShoesCollectionCell.m */,
+				93E62CAB276C86E9006975D1 /* ShoesCollectionCell.xib */,
 				93E62CB1276C86E9006975D1 /* TXCarouselCellModel.h */,
+				93E62CA8276C86E9006975D1 /* TXCarouselCellModel.m */,
+				93E62CA9276C86E9006975D1 /* TXCarouselCollectionViewCell.h */,
+				93E62CB0276C86E9006975D1 /* TXCarouselCollectionViewCell.m */,
+				93E62CA5276C86E9006975D1 /* TXCarouselCollectionViewCell.xib */,
+				93E62CAC276C86E9006975D1 /* TXCarouselView.h */,
 				93E62CB2276C86E9006975D1 /* TXCarouselView.m */,
+				93E62CA6276C86E9006975D1 /* TXCarouselViewLayout.h */,
+				93E62CAE276C86E9006975D1 /* TXCarouselViewLayout.m */,
 			);
 			path = CarouselView;
 			sourceTree = "<group>";
@@ -1381,46 +1426,6 @@
 			path = AFNetworking;
 			sourceTree = "<group>";
 		};
-		93E62CE0276C86E9006975D1 /* shoes_sdk */ = {
-			isa = PBXGroup;
-			children = (
-				93E73816278BD7520017A553 /* BigFoot.cpp */,
-				93E73827278BD7540017A553 /* BigFoot.h */,
-				93E7381C278BD7530017A553 /* DanceFoot.cpp */,
-				93E73825278BD7540017A553 /* DanceFoot.h */,
-				93E7382C278BD7540017A553 /* DanceGame.cpp */,
-				93E73830278BD7540017A553 /* DanceGame.h */,
-				93E7382E278BD7540017A553 /* FootStep.cpp */,
-				93E7381F278BD7530017A553 /* FootStep.h */,
-				93E7382F278BD7540017A553 /* Game.cpp */,
-				93E7381A278BD7530017A553 /* Game.h */,
-				93E7382B278BD7540017A553 /* InertialTrajProcess.cpp */,
-				93E73815278BD7520017A553 /* InertialTrajProcess.h */,
-				93E73826278BD7540017A553 /* Interaction.cpp */,
-				93E73829278BD7540017A553 /* Interaction.h */,
-				93E73820278BD7530017A553 /* jumpH5.cpp */,
-				93E73812278BD7520017A553 /* jumpH5.h */,
-				93E7381E278BD7530017A553 /* MonsterH5.cpp */,
-				93E73828278BD7540017A553 /* MonsterH5.h */,
-				93E73817278BD7530017A553 /* OriginTraj.cpp */,
-				93E7381D278BD7530017A553 /* OriginTraj.h */,
-				93E73822278BD7530017A553 /* pub.h */,
-				93E7382D278BD7540017A553 /* publicMotion.cpp */,
-				93E73831278BD7550017A553 /* publicMotion.h */,
-				93E73818278BD7530017A553 /* RuinsExplore.cpp */,
-				93E73821278BD7530017A553 /* RuinsExplore.h */,
-				93E7381B278BD7530017A553 /* RunGame.cpp */,
-				93E73832278BD7550017A553 /* RunGame.h */,
-				93E73824278BD7540017A553 /* SingleFootAction.cpp */,
-				93E73823278BD7540017A553 /* SingleFootAction.h */,
-				93E7382A278BD7540017A553 /* testGame.cpp */,
-				93E73819278BD7530017A553 /* testGame.h */,
-				93E73813278BD7520017A553 /* Tricycle.cpp */,
-				93E73814278BD7520017A553 /* Tricycle.h */,
-			);
-			path = shoes_sdk;
-			sourceTree = "<group>";
-		};
 		93E62D00276C86E9006975D1 /* resources   */ = {
 			isa = PBXGroup;
 			children = (
@@ -1933,12 +1938,11 @@
 				D82DCFC30E8000A5005D6AD8 /* main.mm in Sources */,
 				93BB27B32785A1820019B85C /* SocketRocketUtility.m in Sources */,
 				8A793A081ED43EE100B44EF1 /* UnityViewControllerBase+iOS.mm in Sources */,
-				93E73842278BD7550017A553 /* Game.cpp in Sources */,
 				93E62D46276C86EA006975D1 /* NoDeviceTip.m in Sources */,
 				D8A1C7280E80637F000160D3 /* RegisterMonoModules.cpp in Sources */,
 				8AA568AE1827DD79004969C7 /* WWWConnection.mm in Sources */,
+				9394A74F2797C1600031DB82 /* testGame.cpp in Sources */,
 				56DBF99D15E3CDC9007A4A8D /* iPhone_Sensors.mm in Sources */,
-				93E73839278BD7550017A553 /* MonsterH5.cpp in Sources */,
 				8A3EDDC81615B7C1001839E9 /* SplashScreen.mm in Sources */,
 				8AC71EC419E7FBA90027502F /* OrientationSupport.mm in Sources */,
 				8A7939FD1ED2F53200B44EF1 /* UnityViewControllerBase.mm in Sources */,
@@ -1969,18 +1973,19 @@
 				8AC74A9519B47FEF00019D38 /* AVCapture.mm in Sources */,
 				8A793A091ED43EE100B44EF1 /* UnityViewControllerBase+tvOS.mm in Sources */,
 				8A6720A519EEB905006C92E0 /* InternalProfiler.cpp in Sources */,
+				9394A7452797C1600031DB82 /* SingleFootAction.cpp in Sources */,
 				8A793A061ED43EE100B44EF1 /* UnityView+iOS.mm in Sources */,
 				8ADCE38B19C87177006F04F6 /* CameraCapture.mm in Sources */,
 				8A4815C117A28E7F003FBFD5 /* UnityAppController+ViewHandling.mm in Sources */,
 				8A25E6D218D767E20006A227 /* Filesystem.mm in Sources */,
 				999475201A7BC3AE00178130 /* UnityAdsUnityWrapper.mm in Sources */,
+				9338AE7D279BB54600D74E1B /* H5.cpp in Sources */,
 				8AF7755D1799329100341121 /* LifeCycleListener.mm in Sources */,
 				8A5C1492174E662D0006EB36 /* RenderPluginDelegate.mm in Sources */,
 				8AF7756017997D2700341121 /* AppDelegateListener.mm in Sources */,
 				FC0B20A21B7A4F0B00FDFC55 /* OnDemandResources.mm in Sources */,
 				AAC3E38D1A68945900F6174A /* RegisterFeatures.cpp in Sources */,
 				84DC28F61C5137FE00BC67D7 /* UnityReplayKit.mm in Sources */,
-				93E73840278BD7550017A553 /* publicMotion.cpp in Sources */,
 				8ACB801C177081D4005D0019 /* DeviceSettings.mm in Sources */,
 				03F528631B447098000F4FB8 /* Il2CppOptions.cpp in Sources */,
 				169C410B819896B35706FD80 /* Bulk_Assembly-CSharp_0.cpp in Sources */,
@@ -1991,6 +1996,7 @@
 				637848CD9E4BD64B7AC1C78A /* Bulk_Assembly-CSharp_13.cpp in Sources */,
 				6DFD4700A579076D5CB6022C /* Bulk_Assembly-CSharp_14.cpp in Sources */,
 				178C4596978EE888292D24D1 /* Bulk_Assembly-CSharp_15.cpp in Sources */,
+				9394A7472797C1600031DB82 /* RunGame.cpp in Sources */,
 				246546E39D1D2072A6FB18DF /* Bulk_Assembly-CSharp_16.cpp in Sources */,
 				540F46438D46FE7EBEE4E7FE /* Bulk_Assembly-CSharp_17.cpp in Sources */,
 				E6774B9F81AF8AD2F0596F13 /* Bulk_Assembly-CSharp_18.cpp in Sources */,
@@ -1998,11 +2004,13 @@
 				EA454EC6BBBC1B265E498648 /* Bulk_Assembly-CSharp_19.cpp in Sources */,
 				583D4276AB51CDBBF4E488E6 /* Bulk_Assembly-CSharp_2.cpp in Sources */,
 				1B484123ACC0F9FE24ABB7F5 /* Bulk_Assembly-CSharp_20.cpp in Sources */,
+				9394A7442797C1600031DB82 /* DanceFoot.cpp in Sources */,
 				93E62D42276C86EA006975D1 /* TXCarouselCollectionViewCell.m in Sources */,
 				400E43C18BDCFB5DE7B5724E /* Bulk_Assembly-CSharp_21.cpp in Sources */,
 				E1E1425B97D830E5B9448F29 /* Bulk_Assembly-CSharp_22.cpp in Sources */,
 				B91F4EFD96B23D35E42EADCD /* Bulk_Assembly-CSharp_23.cpp in Sources */,
 				96814DD9AC44F43A6AB35D10 /* Bulk_Assembly-CSharp_24.cpp in Sources */,
+				9394A74D2797C1600031DB82 /* RuinsExplore.cpp in Sources */,
 				4C7A49A295AA3DED074B0A55 /* Bulk_Assembly-CSharp_25.cpp in Sources */,
 				172B45A2B0C52DBE8F0BB1F5 /* Bulk_Assembly-CSharp_26.cpp in Sources */,
 				F15F48EF858EB1475CABEF98 /* Bulk_Assembly-CSharp_27.cpp in Sources */,
@@ -2010,7 +2018,6 @@
 				AD4D455099260BDF99C8CC64 /* Bulk_Assembly-CSharp_29.cpp in Sources */,
 				3CF14C29850A3CADEA797798 /* Bulk_Assembly-CSharp_3.cpp in Sources */,
 				A8DB4058BE9E9866E2EDE434 /* Bulk_Assembly-CSharp_30.cpp in Sources */,
-				93E73837278BD7550017A553 /* RunGame.cpp in Sources */,
 				E8514F76B39185056DFB8CED /* Bulk_Assembly-CSharp_31.cpp in Sources */,
 				35A6444A86ED9647935C23E7 /* Bulk_Assembly-CSharp_32.cpp in Sources */,
 				770B453D969823D47BB15C81 /* Bulk_Assembly-CSharp_33.cpp in Sources */,
@@ -2039,26 +2046,23 @@
 				B3CD4F94BF4442AD074ECE9F /* Bulk_Generics_4.cpp in Sources */,
 				495748EC983281593F517794 /* Bulk_Generics_5.cpp in Sources */,
 				F72B4B10A6578992F78BA72E /* Bulk_Generics_6.cpp in Sources */,
-				93E7383D278BD7550017A553 /* testGame.cpp in Sources */,
 				EF584120851EDABACAF8D9E8 /* Bulk_Generics_7.cpp in Sources */,
 				9A1E470CACE03E0FA9B45072 /* Bulk_Generics_8.cpp in Sources */,
 				380D459AACB96E761B2AEDFA /* Bulk_Generics_9.cpp in Sources */,
 				14A94AB68B0FEEE0EFA6580E /* Bulk_ICSharpCode.SharpZipLib_0.cpp in Sources */,
 				F78E4329A5C74ADC5B6971E9 /* Bulk_Mono.Security_0.cpp in Sources */,
-				93E7383F278BD7550017A553 /* DanceGame.cpp in Sources */,
 				27614425928C859433F29E60 /* Bulk_Mono.Security_1.cpp in Sources */,
 				93E62D4C276C86EA006975D1 /* MBProgressHUD.m in Sources */,
 				66FB4080A01F5F7296EC11B7 /* Bulk_System.Configuration_0.cpp in Sources */,
+				9394A7512797C1600031DB82 /* InertialTrajProcess.cpp in Sources */,
 				7D6942E587F2C255A47BE0A1 /* Bulk_System.Core_0.cpp in Sources */,
 				E3EF4D2B9B00DD652E93835A /* Bulk_System.Xml_0.cpp in Sources */,
-				93E73838278BD7550017A553 /* DanceFoot.cpp in Sources */,
 				E9D9473697BC1686F2B90939 /* Bulk_System.Xml_1.cpp in Sources */,
 				6EED446484F9D65060508AFD /* Bulk_System.Xml_2.cpp in Sources */,
 				2B4347589D611F4E1C536704 /* Bulk_System.Xml_3.cpp in Sources */,
 				195A4D34A02272D271A01FDD /* Bulk_System.Xml_4.cpp in Sources */,
 				E5F447B2A14FBF5A80441044 /* Bulk_System.Xml_5.cpp in Sources */,
 				BF9E45B98E13B472FBE8F29B /* Bulk_System.Xml_6.cpp in Sources */,
-				93E73834278BD7550017A553 /* BigFoot.cpp in Sources */,
 				13ED4282B2B2FE71284E8906 /* Bulk_System_0.cpp in Sources */,
 				93E62D50276C86EA006975D1 /* AFHTTPSessionManager.m in Sources */,
 				BA1D43F3930E8B6B3CCE9E89 /* Bulk_System_1.cpp in Sources */,
@@ -2068,17 +2072,20 @@
 				692F41D9AE0AA74A87B43325 /* Bulk_System_3.cpp in Sources */,
 				0D7A41128505A699CCACC46A /* Bulk_System_4.cpp in Sources */,
 				275F49A7BF401242E993C0D3 /* Bulk_UnityEngine.AIModule_0.cpp in Sources */,
+				9394A7502797C1600031DB82 /* DanceGame.cpp in Sources */,
 				6AA04FE8891F889658820795 /* Bulk_UnityEngine.AnimationModule_0.cpp in Sources */,
 				CCB04BFBB65509BDDDC12D91 /* Bulk_UnityEngine.AudioModule_0.cpp in Sources */,
 				9CE04E808C64BF4170209B90 /* Bulk_UnityEngine.CoreModule_0.cpp in Sources */,
 				93E62D97276C86EA006975D1 /* UIView+ST.m in Sources */,
 				343E410894CFEBFD3CD348E7 /* Bulk_UnityEngine.CoreModule_1.cpp in Sources */,
 				044644B68C5D373550131AB8 /* Bulk_UnityEngine.DirectorModule_0.cpp in Sources */,
+				9394A74B2797C1600031DB82 /* FootStep.cpp in Sources */,
 				93AFCE5A278FCE1E00BF6965 /* NSMutableArray+AvoidCrash.m in Sources */,
 				93E62D4D276C86EA006975D1 /* IOSPlatformSDK.mm in Sources */,
 				D82940C49EC5173E6CF8082B /* Bulk_UnityEngine.GameCenterModule_0.cpp in Sources */,
 				93E62D48276C86EA006975D1 /* CBPeripheral+ADName.m in Sources */,
 				04E2410F8EA9029A6097BD51 /* Bulk_UnityEngine.GridModule_0.cpp in Sources */,
+				9394A74E2797C1600031DB82 /* BigFoot.cpp in Sources */,
 				B6424F0D95236DBE30A6FD40 /* Bulk_UnityEngine.IMGUIModule_0.cpp in Sources */,
 				B69B411C9BC4C73FF946EBC9 /* Bulk_UnityEngine.ImageConversionModule_0.cpp in Sources */,
 				404D46399EFF7943904206BC /* Bulk_UnityEngine.InputModule_0.cpp in Sources */,
@@ -2091,7 +2098,6 @@
 				8B42419BB7F487494E366C64 /* Bulk_UnityEngine.ScreenCaptureModule_0.cpp in Sources */,
 				827E4A5492F67BC5EFAA0F81 /* Bulk_UnityEngine.SharedInternalsModule_0.cpp in Sources */,
 				93E62D4B276C86EA006975D1 /* UserFriendsModel.m in Sources */,
-				93E7383C278BD7550017A553 /* Interaction.cpp in Sources */,
 				30294FE0B90F66FB77A550D8 /* Bulk_UnityEngine.TerrainModule_0.cpp in Sources */,
 				E26F4903AF7E80A14835352C /* Bulk_UnityEngine.TextRenderingModule_0.cpp in Sources */,
 				E0984461AEE955AD1EC4A06A /* Bulk_UnityEngine.TilemapModule_0.cpp in Sources */,
@@ -2103,7 +2109,6 @@
 				0C72474F817EA3F2211EA45E /* Bulk_UnityEngine.UnityWebRequestWWWModule_0.cpp in Sources */,
 				07FE445DB074A34243450DBF /* Bulk_UnityEngine.VRModule_0.cpp in Sources */,
 				93E62D45276C86EA006975D1 /* SearchDeviceViewController.m in Sources */,
-				93E73836278BD7550017A553 /* RuinsExplore.cpp in Sources */,
 				11C44273A281EF373A8C21D3 /* Bulk_UnityEngine.VideoModule_0.cpp in Sources */,
 				F4704B3CB17E8AF955F09FD9 /* Bulk_UnityEngine_0.cpp in Sources */,
 				04B24C4CA345E2E1A149BEAA /* Bulk_UnityScript.Lang_0.cpp in Sources */,
@@ -2118,15 +2123,12 @@
 				B99045998C728022F3DC6224 /* Bulk_mscorlib_3.cpp in Sources */,
 				25DE4B40997AB1A380D883C8 /* Bulk_mscorlib_4.cpp in Sources */,
 				93AFCE5B278FCE1E00BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */,
-				93E7383E278BD7550017A553 /* InertialTrajProcess.cpp in Sources */,
 				C3B3441AA2C159513394E23C /* Bulk_mscorlib_5.cpp in Sources */,
 				A9584B99BE22FFFCB8EAA952 /* Bulk_mscorlib_6.cpp in Sources */,
-				93E73833278BD7550017A553 /* Tricycle.cpp in Sources */,
 				93E62D40276C86EA006975D1 /* ShoesCarouselView.m in Sources */,
 				A41F4792B0DCF15A985E1D7D /* Bulk_mscorlib_7.cpp in Sources */,
 				11824BF290A3C07A47C935D0 /* Bulk_mscorlib_8.cpp in Sources */,
 				769F4648B1838D4083F4F8F3 /* Bulk_mscorlib_9.cpp in Sources */,
-				93E7383B278BD7550017A553 /* SingleFootAction.cpp in Sources */,
 				138B4D25AECD91543A86C013 /* GenericMethods0.cpp in Sources */,
 				545449EC93130AD51C57AEAF /* GenericMethods1.cpp in Sources */,
 				02E843FFBD60651D81A74E31 /* GenericMethods2.cpp in Sources */,
@@ -2141,9 +2143,9 @@
 				843143928B15F71D5750F9A1 /* Il2CppCompilerCalculateTypeValues_11Table.cpp in Sources */,
 				8AB34266810042E8563E4EF3 /* Il2CppCompilerCalculateTypeValues_12Table.cpp in Sources */,
 				93E62D53276C86EA006975D1 /* AFNetworkReachabilityManager.m in Sources */,
+				9394A7462797C1600031DB82 /* Tricycle.cpp in Sources */,
 				9F1F4359AA28FABBFC51B415 /* Il2CppCompilerCalculateTypeValues_13Table.cpp in Sources */,
 				275C4051BEF6CE0362A310B7 /* Il2CppCompilerCalculateTypeValues_14Table.cpp in Sources */,
-				93E73841278BD7550017A553 /* FootStep.cpp in Sources */,
 				AD9D46C9B285A5ABC3708AC3 /* Il2CppCompilerCalculateTypeValues_15Table.cpp in Sources */,
 				FA8D41FCBBB52B8D5540BDB7 /* Il2CppCompilerCalculateTypeValues_16Table.cpp in Sources */,
 				1BA2482D908726733F0A3042 /* Il2CppCompilerCalculateTypeValues_17Table.cpp in Sources */,
@@ -2164,6 +2166,7 @@
 				93E62D51276C86EA006975D1 /* AFURLSessionManager.m in Sources */,
 				9AE94E5EBB09B623B3FE7127 /* Il2CppCompilerCalculateTypeValues_28Table.cpp in Sources */,
 				4ECE4765AD2491E1B8CA0EC4 /* Il2CppCompilerCalculateTypeValues_29Table.cpp in Sources */,
+				9394A7422797C1600031DB82 /* Interaction.cpp in Sources */,
 				93E62D96276C86EA006975D1 /* MYFactoryManager.m in Sources */,
 				B0544123B81278619BD4BF3A /* Il2CppCompilerCalculateTypeValues_2Table.cpp in Sources */,
 				97A1472D83DADF208255A122 /* Il2CppCompilerCalculateTypeValues_30Table.cpp in Sources */,
@@ -2181,11 +2184,14 @@
 				26294CEE84F73A3A011C5730 /* Il2CppCompilerCalculateTypeValues_40Table.cpp in Sources */,
 				00A941B4A4F2F93F11E33DCF /* Il2CppCompilerCalculateTypeValues_41Table.cpp in Sources */,
 				615E4A3C8DF032F43E0BE6C1 /* Il2CppCompilerCalculateTypeValues_42Table.cpp in Sources */,
+				9394A74C2797C1600031DB82 /* Game.cpp in Sources */,
 				F89849318340C288EEF838EF /* Il2CppCompilerCalculateTypeValues_43Table.cpp in Sources */,
 				4EA748D1856FE573CF496DDF /* Il2CppCompilerCalculateTypeValues_44Table.cpp in Sources */,
+				9394A7482797C1600031DB82 /* jumpH5.cpp in Sources */,
 				DCBA4796AD63539BBF39FEAE /* Il2CppCompilerCalculateTypeValues_45Table.cpp in Sources */,
 				FF9D45E2A2145AF6EFCBC4B2 /* Il2CppCompilerCalculateTypeValues_46Table.cpp in Sources */,
 				5E944127A8E60011852B795A /* Il2CppCompilerCalculateTypeValues_47Table.cpp in Sources */,
+				9394A74A2797C1600031DB82 /* publicMotion.cpp in Sources */,
 				5D8E44FB8EAC10A3E7D0017A /* Il2CppCompilerCalculateTypeValues_48Table.cpp in Sources */,
 				93E62D44276C86EA006975D1 /* PopupView.m in Sources */,
 				ABC04CABB40A109C2AAC0FFF /* Il2CppCompilerCalculateTypeValues_49Table.cpp in Sources */,
@@ -2199,7 +2205,7 @@
 				BB0543AAB7F743460A340525 /* Il2CppCompilerCalculateTypeValues_7Table.cpp in Sources */,
 				3B6A42728BBA820CA7662220 /* Il2CppCompilerCalculateTypeValues_8Table.cpp in Sources */,
 				1181422791D23E5B1A13298A /* Il2CppCompilerCalculateTypeValues_9Table.cpp in Sources */,
-				93E7383A278BD7550017A553 /* jumpH5.cpp in Sources */,
+				9394A7432797C1600031DB82 /* OriginTraj.cpp in Sources */,
 				93AFCE5E278FCE1E00BF6965 /* AvoidCrashStubProxy.m in Sources */,
 				6A394CCBA3BD2AAE54EE16A5 /* Il2CppGenericClassTable.cpp in Sources */,
 				194B4FD28A0F1AE3078322FE /* Il2CppGenericComDefinitions0.cpp in Sources */,
@@ -2215,13 +2221,13 @@
 				8CBD47E49638FD0CF890B3BC /* Il2CppMetadataUsage.cpp in Sources */,
 				EA3A4B1F90828D7E1D058556 /* Il2CppMethodPointerTable.cpp in Sources */,
 				93AFCE5C278FCE1E00BF6965 /* NSAttributedString+AvoidCrash.m in Sources */,
-				93E73835278BD7550017A553 /* OriginTraj.cpp in Sources */,
 				E18A461783D85B8951E85F9F /* Il2CppReversePInvokeWrapperTable.cpp in Sources */,
 				8B534B3E836CF26E0EE4099D /* Il2CppTypeDefinitions.cpp in Sources */,
 				93E62D95276C86EA006975D1 /* GameObjc.mm in Sources */,
 				7EF34FE299E16AD0C01E9F17 /* UnityClassRegistration.cpp in Sources */,
 				D4E94F9E82AE7A8D9C09F7D9 /* UnityICallRegistration.cpp in Sources */,
 				6AD14049B96E36922DD1A7CF /* UnresolvedVirtualCallStubs.cpp in Sources */,
+				9394A7492797C1600031DB82 /* MonsterH5.cpp in Sources */,
 				93E62D52276C86EA006975D1 /* AFURLRequestSerialization.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

BIN
DanceGame/Unity-iPhone.xcodeproj/project.xcworkspace/xcuserdata/duowan123.xcuserdatad/UserInterfaceState.xcuserstate


BIN
RunGame/.DS_Store


BIN
RunGame/SDK/.DS_Store


+ 14 - 0
RunGame/SDK/BLE/BTDataAnalysis.h

@@ -0,0 +1,14 @@
+//
+//  BTDataAnalysis.h
+//  Unity-iPhone
+//
+//  Created by duowan123 on 2022/1/26.
+//
+
+#import <Foundation/Foundation.h>
+#import "MYFactoryManager.h"
+
+@interface BTDataAnalysis : NSObject
+-(void)verifyData:(CBCharacteristic*)characteristic deviceType:(DEVICE_TYPE)deviceType;
+@end
+

+ 143 - 0
RunGame/SDK/BLE/BTDataAnalysis.mm

@@ -0,0 +1,143 @@
+//
+//  BTDataAnalysis.m
+//  Unity-iPhone
+//
+//  Created by duowan123 on 2022/1/26.
+//
+
+#import "BTDataAnalysis.h"
+#import "IOSPlatformSDK.h"
+@implementation BTDataAnalysis
+
+#pragma mark ===============================================>> 校验 & 报文数据解析
+-(void)verifyData:(CBCharacteristic*)characteristic deviceType:(DEVICE_TYPE)deviceType{
+    
+     if (characteristic.value.length>3){
+         
+         //带cmd位的有效数据  计算校验位
+         if ([AlgorithmTool verificationRusult:characteristic.value]==YES){
+             [self analysisCharacteristic:characteristic.value deviceType:deviceType];
+         }
+     }else{
+         NSLog(@"无效报文");
+     }
+     
+}
+
+-(void)analysisCharacteristic:(NSData*)characteristic deviceType:(DEVICE_TYPE)deviceType{
+        
+//    NSLog(@"接收到的数据data = %@",characteristic);
+    int frameHead = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(0, 1)]];//帧头数据aa
+    int messageLength = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(1, 1)]];//报文长度
+    int messageLengthNegation = ~messageLength;//报文长度取反
+    int dataType = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(3, 1)]];//cmd类型
+    
+      if (dataType == 4){//获取主动推过来的数据
+            //右脚坐标数据
+           int right_X = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(4, 4)];
+           int right_Y = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(8, 4)];
+           int right_Z = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(12, 4)];
+           int  right_pos[3] = {right_X,right_Y,right_Z};
+          //左脚坐标数据
+           int left_X = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(16, 4)];
+           int left_Y = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(20, 4)];
+           int left_Z = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(24, 4)];
+           int  left_pos[3] = {left_X,left_Y,left_Z};
+           //右脚姿势数据
+           short righrPosture_X = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(28, 2)];
+           short righrPosture_Y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(30, 2)];
+           short righrPosture_Z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(32, 2)];
+           int  right_att[3] = {righrPosture_X,righrPosture_Y,righrPosture_Z};
+           //左脚姿势数据
+           short leftPosture_X = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(34, 2)];
+           short leftPosture_Y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(36, 2)];
+           short leftPosture_Z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(38, 2)];
+           int  left_att[3] = {leftPosture_X,leftPosture_Y,leftPosture_Z};
+           //右脚三维数据
+           short righrAcc_x = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(40, 2)];
+           short righrAcc_Y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(42, 2)];
+           short righrAcc_z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(44, 2)];
+           int  righr_acc[3] = {righrAcc_x,righrAcc_Y,righrAcc_z};
+           //左脚三维数据
+           short leftAcc_x = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(46, 2)];
+           short leftAcc_y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(48, 2)];
+           short leftAcc_z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(50, 2)];
+           int  left_acc[3] = {leftAcc_x,leftAcc_y,leftAcc_z};
+           //左脚、右脚、蹲 、跳四个动作信息数据
+           int actionInformation =  [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(52, 1)]];;//0c 16进制字符串
+                       int girlShoes  = actionInformation & 16;
+                       if (girlShoes!=0){
+                           girlShoes=1;
+                       }else{
+                           girlShoes=0;
+                       }
+                       int rightZupt  = actionInformation & 8;
+                       if (rightZupt!=0){
+                           rightZupt=1;
+                       }else{
+                           rightZupt=0;
+                       }
+                       int leftZupt = actionInformation & 4;
+                       if (leftZupt!=0){
+                            leftZupt=1;
+                        }else{
+                            leftZupt=0;
+                        }
+                       int down  = actionInformation & 2;
+                       if (down!=0){
+                            down=1;
+                        }else{
+                            down=0;
+                        }
+                       int jump  = actionInformation & 1;
+                       if (jump!=0){
+                            jump=1;
+                        }else{
+                            jump=0;
+                        }
+          
+            int rssi = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(53, 1)]];//rssi 信号强度
+            int ts = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(54, 1)]];;//ts 时间戳
+            int right_press = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(55, 2)]];//3 29新增 右鞋压力
+            int left_press = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(57, 2)]];//3 29新增 左鞋压力
+            int frameCheck =  [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(59, 1)]];//校验位
+        
+              if (deviceType==DEVICETYPE_MAIN){//主设备
+    //                   NSLog(@"主设备 接收到 鞋子动作数据 data = %@",characteristic);
+                  //调取鞋子SDK
+    //                   [self shoseSDKRight_pos:right_pos Right_att:right_att Right_acc:righr_acc LeftPos:left_pos Left_att:left_att Left_acc:left_acc ts:ts rightZupt:rightZupt leftZupt:leftZupt jump:jump down:down rssi:rssi girlShoes:girlShoes right_press:right_press left_press:left_press characteristic:characteristic];
+                  
+              }else if (deviceType==DEVICETYPE_VICE){//副设备动作数据
+                  //调取鞋子SDK
+    //                   [self viceShoseSDKRight_pos:right_pos Right_att:right_att Right_acc:righr_acc LeftPos:left_pos Left_att:left_att Left_acc:left_acc ts:ts rightZupt:rightZupt leftZupt:leftZupt jump:jump down:down rssi:rssi girlShoes:girlShoes right_press:right_press left_press:left_press characteristic:characteristic];
+              }
+                  
+        }else if (dataType == -95 && characteristic.length == 26){//获取的是查询的数据 char-->int a1 = -95
+           //A1+1 >> 1: 设备数据(左鞋,右鞋)  aa 14 eb a1 01 64 00 1a 0000981d 64 00 17 00000000 f9
+                int leftElectricity = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(5, 1)]];
+                int rightElectricity = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(15, 1)]];//龙哥新协议
+                
+                if (deviceType==DEVICETYPE_MAIN && LEManager.peripheral!=nil){//主设备
+//                    NSLog(@"主设备 接收到 鞋子硬件数据 data 26 = %@  电量 %d %d %@ %@",characteristic,leftElectricity,rightElectricity,LEManager.peripheral.name,LEManager.peripheral.identifier.UUIDString);
+                    //主 设备定时器 60秒调一次   /******************ios call unity*****************/
+                     [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_MAIN
+                                                 name:LEManager.peripheral.name
+                                              address:LEManager.peripheral.identifier.UUIDString
+                                               status:CONNECT_ED
+                                          electricity:leftElectricity<=rightElectricity?leftElectricity:rightElectricity];
+             
+                }else if (deviceType==DEVICETYPE_VICE && LEManager.vicePeripheral!=nil){//副设备
+//                    NSLog(@"副设备 接收到 鞋子硬件数据 26 = %@  电量 %d %d",characteristic,leftElectricity,rightElectricity);
+                    //副 设备定时器 60秒调一次   /******************ios call unity*****************/
+                     [[IOSPlatformSDK sharedInstance] bridgingDeviceAction:DEVICETYPE_VICE
+                                                 name:LEManager.vicePeripheral.name
+                                              address:LEManager.vicePeripheral.identifier.UUIDString
+                                               status:CONNECT_ED
+                                          electricity:leftElectricity<=rightElectricity?leftElectricity:rightElectricity];
+                    
+                }
+        }
+}
+
+
+@end

+ 20 - 149
RunGame/SDK/BLE/BTDataProcess.mm

@@ -151,11 +151,16 @@ static BTDataProcess* instance = nil;
         [DebugViewInstance inittestLabel];
     });
     
+    //jb
+    [DebugViewInstance clearCacheWithFilePath];
+    
 }
 
 //每结束一局游戏
 -(void)gameEndInitData{
     self.gameModel = NO;
+    //jb
+//    [DebugViewInstance uploadpPlistFile];
 }
 
 //监听通知震动
@@ -204,6 +209,7 @@ static BTDataProcess* instance = nil;
     NSLog(@"leon UIApplicationDidEnterBackgroundNotification");
     instance.isBackGround = YES;
 }
+
 -(void)willEnterForeground{
     NSLog(@"leon UIApplicationWillEnterForegroundNotification");
     instance.isBackGround = NO;
@@ -448,8 +454,17 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
     LEManager.readValueForCharacteristicBlock = ^(CBPeripheral * _Nonnull peripheral, CBCharacteristic * _Nonnull characteristic, NSData * _Nonnull value, NSError * _Nonnull error, DEVICE_TYPE type){
         if ([characteristic.UUID.UUIDString isEqualToString:@"6E400003-B5A3-F393-E0A9-E50E24DCCA9E"]){//判断是不是我们设备的特征值
 //            NSLog(@"characteristic.UUID.UUIDString = %@",characteristic.UUID.UUIDString);
-                [self verifyData:characteristic deviceType:type];
-                [peripheral readRSSI];
+            
+            //算法计算轨迹
+            [self shoseSDKcharacteristic:characteristic.value];
+            
+            //回调蓝牙状态给unity
+            BTDataAnalysis * anly = [BTDataAnalysis new];
+            [anly verifyData:characteristic deviceType:type];
+            
+            //每收到数据包读取一次
+            [peripheral readRSSI];
+            
          }
     };
 
@@ -532,153 +547,9 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
 
 }
 
-#pragma mark ===============================================>> 校验 & 报文数据解析
--(void)verifyData:(CBCharacteristic*)characteristic deviceType:(DEVICE_TYPE)deviceType{
-    
-     if (characteristic.value.length>3){
-         
-         //带cmd位的有效数据  计算校验位
-         if ([AlgorithmTool verificationRusult:characteristic.value]==YES){
-             [self analysisCharacteristic:characteristic.value deviceType:deviceType];
-         }
-     }else{
-         NSLog(@"无效报文");
-     }
-     
-}
-
--(void)analysisCharacteristic:(NSData*)characteristic deviceType:(DEVICE_TYPE)deviceType{
-        
-//    NSLog(@"接收到的数据data = %@",characteristic);
-    int frameHead = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(0, 1)]];//帧头数据aa
-    int messageLength = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(1, 1)]];//报文长度
-    int messageLengthNegation = ~messageLength;//报文长度取反
-    int dataType = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(3, 1)]];//cmd类型
-    
-      if (dataType == 4){//获取主动推过来的数据
-            //右脚坐标数据
-           int right_X = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(4, 4)];
-           int right_Y = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(8, 4)];
-           int right_Z = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(12, 4)];
-           int  right_pos[3] = {right_X,right_Y,right_Z};
-          //左脚坐标数据
-           int left_X = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(16, 4)];
-           int left_Y = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(20, 4)];
-           int left_Z = [AlgorithmTool dataToSwapBigIntToHost:characteristic andRange:NSMakeRange(24, 4)];
-           int  left_pos[3] = {left_X,left_Y,left_Z};
-           //右脚姿势数据
-           short righrPosture_X = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(28, 2)];
-           short righrPosture_Y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(30, 2)];
-           short righrPosture_Z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(32, 2)];
-           int  right_att[3] = {righrPosture_X,righrPosture_Y,righrPosture_Z};
-           //左脚姿势数据
-           short leftPosture_X = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(34, 2)];
-           short leftPosture_Y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(36, 2)];
-           short leftPosture_Z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(38, 2)];
-           int  left_att[3] = {leftPosture_X,leftPosture_Y,leftPosture_Z};
-           //右脚三维数据
-           short righrAcc_x = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(40, 2)];
-           short righrAcc_Y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(42, 2)];
-           short righrAcc_z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(44, 2)];
-           int  righr_acc[3] = {righrAcc_x,righrAcc_Y,righrAcc_z};
-           //左脚三维数据
-           short leftAcc_x = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(46, 2)];
-           short leftAcc_y = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(48, 2)];
-           short leftAcc_z = [AlgorithmTool dataToSwapBigShortToHost:characteristic andRange:NSMakeRange(50, 2)];
-           int  left_acc[3] = {leftAcc_x,leftAcc_y,leftAcc_z};
-           //左脚、右脚、蹲 、跳四个动作信息数据
-           int actionInformation =  [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(52, 1)]];;//0c 16进制字符串
-                       int girlShoes  = actionInformation & 16;
-                       if (girlShoes!=0){
-                           girlShoes=1;
-                       }else{
-                           girlShoes=0;
-                       }
-                       int rightZupt  = actionInformation & 8;
-                       if (rightZupt!=0){
-                           rightZupt=1;
-                       }else{
-                           rightZupt=0;
-                       }
-                       int leftZupt = actionInformation & 4;
-                       if (leftZupt!=0){
-                            leftZupt=1;
-                        }else{
-                            leftZupt=0;
-                        }
-                       int down  = actionInformation & 2;
-                       if (down!=0){
-                            down=1;
-                        }else{
-                            down=0;
-                        }
-                       int jump  = actionInformation & 1;
-                       if (jump!=0){
-                            jump=1;
-                        }else{
-                            jump=0;
-                        }
-          
-            int rssi = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(53, 1)]];//rssi 信号强度
-            int ts = [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(54, 1)]];;//ts 时间戳
-            int right_press = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(55, 2)]];//3 29新增 右鞋压力
-            int left_press = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(57, 2)]];//3 29新增 左鞋压力
-            int frameCheck =  [AlgorithmTool dataToChar:[characteristic subdataWithRange:NSMakeRange(59, 1)]];//校验位
-        
-               if (deviceType==DEVICETYPE_MAIN){//主设备
-//                   NSLog(@"主设备 接收到 鞋子动作数据 data = %@",characteristic);
-                   //调取鞋子SDK
-                   [self shoseSDKRight_pos:right_pos Right_att:right_att Right_acc:righr_acc LeftPos:left_pos Left_att:left_att Left_acc:left_acc ts:ts rightZupt:rightZupt leftZupt:leftZupt jump:jump down:down rssi:rssi girlShoes:girlShoes right_press:right_press left_press:left_press characteristic:characteristic];
-                   
-               }else if (deviceType==DEVICETYPE_VICE){//副设备动作数据
-                   //调取鞋子SDK
-//                   [self viceShoseSDKRight_pos:right_pos Right_att:right_att Right_acc:righr_acc LeftPos:left_pos Left_att:left_att Left_acc:left_acc ts:ts rightZupt:rightZupt leftZupt:leftZupt jump:jump down:down rssi:rssi girlShoes:girlShoes right_press:right_press left_press:left_press characteristic:characteristic];
-               }
-              
-        }else if (dataType == -95 && characteristic.length == 26){//获取的是查询的数据 char-->int a1 = -95
-           //A1+1 >> 1: 设备数据(左鞋,右鞋)  aa 14 eb a1 01 64 00 1a 0000981d 64 00 17 00000000 f9
-                int leftElectricity = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(5, 1)]];
-                int rightElectricity = [AlgorithmTool dataToInt:[characteristic subdataWithRange:NSMakeRange(15, 1)]];//龙哥新协议
-                
-                if (deviceType==DEVICETYPE_MAIN && LEManager.peripheral!=nil){//主设备
-//                    NSLog(@"主设备 接收到 鞋子硬件数据 data 26 = %@  电量 %d %d %@ %@",characteristic,leftElectricity,rightElectricity,LEManager.peripheral.name,LEManager.peripheral.identifier.UUIDString);
-                    //主 设备定时器 60秒调一次   /******************ios call unity*****************/
-                     [self.sdk bridgingDeviceAction:DEVICETYPE_MAIN
-                                                 name:LEManager.peripheral.name
-                                              address:LEManager.peripheral.identifier.UUIDString
-                                               status:CONNECT_ED
-                                          electricity:leftElectricity<=rightElectricity?leftElectricity:rightElectricity];
-             
-                }else if (deviceType==DEVICETYPE_VICE && LEManager.vicePeripheral!=nil){//副设备
-//                    NSLog(@"副设备 接收到 鞋子硬件数据 26 = %@  电量 %d %d",characteristic,leftElectricity,rightElectricity);
-                    //副 设备定时器 60秒调一次   /******************ios call unity*****************/
-                     [self.sdk bridgingDeviceAction:DEVICETYPE_VICE
-                                                 name:LEManager.vicePeripheral.name
-                                              address:LEManager.vicePeripheral.identifier.UUIDString
-                                               status:CONNECT_ED
-                                          electricity:leftElectricity<=rightElectricity?leftElectricity:rightElectricity];
-                    
-                }
-        }
-}
 
 #pragma mark ===============================================>> 主设备 报文数据解析后 -- 调用蓝牙鞋子SDK装换数据 -- ios call unity 更新游戏动作
--(void)shoseSDKRight_pos:(int[3])right_pos
-               Right_att:(int[3])right_att
-               Right_acc:(int[3])right_acc
-                 LeftPos:(int[3])left_pos
-                Left_att:(int[3])left_att
-                Left_acc:(int[3])left_acc
-                      ts:(int)ts
-               rightZupt:(int)rightZupt
-                leftZupt:(int)leftZupt
-                    jump:(int)jump
-                    down:(int)down
-                    rssi:(int)rssi
-               girlShoes:(int)girlShoes
-             right_press:(int)right_press
-              left_press:(int)left_press
-          characteristic:(NSData*)characteristic{
+-(void)shoseSDKcharacteristic:(NSData*)characteristic{
     
     /********************初始化 运动轨迹算法 SDK *****************/
     //游戏数据
@@ -723,7 +594,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
     int rightStepFreq =  game->getStepFreq(RIGHT_FOOT);
     int rightStepCount =  game->getStepCount(RIGHT_FOOT);
     
-    /******************玩家当前朝向*****************/
+    /******************玩家当前朝向 用户赛车*****************/
     int attLength = 3;
     int left[attLength];
     int right[attLength];
@@ -798,7 +669,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
 //    NSLog(@"aArray == %@",aArray);
 //    dispatch_async(dispatch_get_main_queue(), ^{
         if (DebugViewInstance.testLabel!=nil){
-            DebugViewInstance.testLabel.text = [NSString stringWithFormat:@"right:[%d,%d,%d] [%d,%d,%d] [%d,%d,%d] \nleft:[%d,%d,%d] [%d,%d,%d] [%d,%d,%d] \nZupt:[%d,%d]  press:[%d,%d] \nj&d[%d %d]  rssi:[%@ %@] ts:%@ \n脚步: %@ %@\n步频: %d %d ",right_pos[0],right_pos[1],right_pos[2],right_att[0],right_att[1],right_att[2],right_acc[0],right_acc[1],right_acc[2],left_pos[0],left_pos[1],left_pos[2],left_att[0],left_att[1],left_att[2],left_acc[0],left_acc[1],left_acc[2],rightZupt,leftZupt,right_press,left_press,jump,down,DebugViewInstance.RSSI,aArray[26],aArray[27],aArray[28],aArray[29],rightStepFreq,leftStepFreq];
+            DebugViewInstance.testLabel.text = [NSString stringWithFormat:@"right:[%@,%@,%@] [%@,%@,%@] [%@,%@,%@] [%@,%@,%@] \nleft:[%@,%@,%@] [%@,%@,%@] [%@,%@,%@] [%@,%@,%@]  \nrssi:[%@ %@] ts:%@ \n脚步:[%@ %@] \n步频:[%d %d] ",aArray[0],aArray[1],aArray[2],aArray[3],aArray[4],aArray[5],aArray[6],aArray[7],aArray[8],aArray[9],aArray[10],aArray[11],aArray[12],aArray[13],aArray[14],aArray[15],aArray[16],aArray[17],aArray[18],aArray[19],aArray[20],aArray[21],aArray[22],aArray[23],DebugViewInstance.RSSI,aArray[26],aArray[27],aArray[28],aArray[29],rightStepFreq,leftStepFreq];
         }
 //    });
     

+ 7 - 2
RunGame/SDK/BLE/DebugView.h

@@ -9,8 +9,7 @@
 #import "MYFactoryManager.h"
 
 #define DebugViewInstance [DebugView sharedInstance]
-#define Game_Type @"run"
-#define JBSDKLog @"runLog.txt"
+#define JBSDKLog @"testLog.txt"
 
 @interface DebugView : UIView
 /*****测试*******/
@@ -28,8 +27,14 @@
 #pragma mark ===============================================>> DEBUG
 -(void)inittestLabel;
 
+//清理缓存
+- (void)clearCacheWithFilePath;
+
 //数据写入沙河
 -(void)writeFileToplist;
+
+//上传
+-(void)uploadpPlistFile;
     
 @end
 

+ 9 - 2
RunGame/SDK/BLE/DebugView.m

@@ -34,7 +34,6 @@ static DebugView* instance = nil;
     return instance;
 }
 
-
 #pragma mark ===============================================>> DEBUG
 -(void)inittestLabel{
 
@@ -75,6 +74,7 @@ static DebugView* instance = nil;
     self.testLabel.textAlignment = NSTextAlignmentLeft;
     self.testLabel.numberOfLines = 0;
 
+    //
     if ([UIApplication sharedApplication].keyWindow != nil){
         [[UIApplication sharedApplication].keyWindow addSubview:self.uploadButton];
         [[UIApplication sharedApplication].keyWindow addSubview:self.clearnButton];
@@ -170,11 +170,18 @@ static DebugView* instance = nil;
     manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/html",@"application/json",@"text/javascript",@"image/jpeg",@"image/png",@"application/octet-stream",@"application/x-www-form-urlencoded", nil];
     //    NSLog(@"请求URL ===================>> %@",urlString);
     NSLog(@"******************* 请求头参数 = %@ ***************************",manager.requestSerializer.HTTPRequestHeaders);
+    NSString * gameType;
+    NSString * bundleIdentifier = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
+    if ([bundleIdentifier isEqualToString:@"com.Oujia.Run"]){
+        gameType = @"run";
+    }else if ([bundleIdentifier isEqualToString:@"com.Oujia.Dance"]){
+        gameType = @"Dance";
+    }
     
     AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithBaseURL:nil];
     [sessionManager POST:@"http://172.16.14.127:8080/upload" parameters:nil headers:nil constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData){
 
-        [formData  appendPartWithFileData:upData name:@"file" fileName:[NSString stringWithFormat:@"ios_%@_%@.txt",Game_Type,[self getNowTimeTimestamp]] mimeType:@"text/plain"];
+        [formData  appendPartWithFileData:upData name:@"file" fileName:[NSString stringWithFormat:@"ios_%@_%@.txt",gameType,[self getNowTimeTimestamp]] mimeType:@"text/plain"];
 
         }progress:^(NSProgress * _Nonnull uploadProgress){
             NSLog(@"上传进度 = %@",uploadProgress);

+ 1 - 1
RunGame/SDK/HTTP/socket/SocketRocketUtility.m

@@ -118,7 +118,7 @@ static SocketRocketUtility* instance = nil;
     self.socket = [[SRWebSocket alloc] initWithURLRequest:
                    [NSURLRequest requestWithURL:[NSURL URLWithString:@"ws://172.16.14.127/examples/websocket/chat"]]];//这里填写你服务器的地址
     
-    NSLog(@"请求的websocket地址:%@",self.socket.url.absoluteString);
+//    NSLog(@"请求的websocket地址:%@",self.socket.url.absoluteString);
     self.socket.delegate = self;   //实现这个 SRWebSocketDelegate 协议
     [self.socket open];     //open 就是直接连接了
 }

+ 19 - 0
RunGame/SDK/IOSPlatformSDK.mm

@@ -8,6 +8,7 @@
 
 #import "IOSPlatformSDK.h"
 #import "AvoidCrash.h"
+//#import <Bugly/Bugly.h>
 
 #pragma mark ============================>> ios call unity (定义名字参数和C#类一样的方法)
 //大概流程就是先将C#的函数指针存入OC内存,在OC需要回调unity的时候就可以使用不同的指针来回调不同的unity方法
@@ -101,17 +102,35 @@ static IOSPlatformSDK * instance;
     dispatch_once(&onceToken, ^{
         instance = [super init];
         [BTDataProcess sharedInstance];
+//        [Bugly startWithAppId:@"36a0c05291"];
         //防奔溃
         [AvoidCrash makeAllEffective];
+//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil];
     });
     return instance;
 }
 
+//- (void)dealwithCrashMessage:(NSNotification *)note{
+//
+// NSDictionary *info = note.userInfo;
+//  NSString *errorReason = [NSString stringWithFormat:@"【ErrorReason】%@========【ErrorPlace】%@========【DefaultToDo】%@========【ErrorName】%@", info[@"errorReason"], info[@"errorPlace"], info[@"defaultToDo"], info[@"errorName"]];
+//  NSLog(@"errorReason = %@",errorReason);
+//  NSArray *callStack = info[@"callStackSymbols"];
+//  [self reportErrorName:@"Bugly_ErrorName_AvoidCrash" errorReason:errorReason callStack:callStack extraInfo:nil];
+//
+//}
+//
+///** 上报错误信息 */
+//- (void)reportErrorName:(NSString *)errorName errorReason:(NSString *)errorReason callStack:(NSArray *)aStackArray extraInfo:(NSDictionary *)info{
+//    [Bugly reportExceptionWithCategory:3 name:errorName reason:errorReason callStack:aStackArray extraInfo:info terminateApp:NO];
+//}
+
 #pragma mark ============================>> public method app 跳转直链
 -(void)startWithUrl:(NSURL*)url{
     [BTDataInstance startWithUrl:url];
 }
 
+//
 #pragma mark ============================>> private
 //是否已经缓存到用户信息
 -(BOOL)existUserInfo{

BIN
RunGame/SDK/ThirdClass/.DS_Store


BIN
RunGame/SDK/ThirdClass/AvoidCrash-master/.DS_Store


BIN
RunGame/SDK/ThirdClass/AvoidCrash-master/AvoidCrashDemo/.DS_Store


+ 0 - 116
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.h

@@ -1,116 +0,0 @@
-//
-//  AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-//===================================================
-//   使用方法和注意事项:
-//   https://www.jianshu.com/p/2b90aa96c0a0
-//===================================================
-
-#import <Foundation/Foundation.h>
-#import <objc/runtime.h>
-
-//category
-#import "NSObject+AvoidCrash.h"
-
-#import "NSArray+AvoidCrash.h"
-#import "NSMutableArray+AvoidCrash.h"
-
-#import "NSDictionary+AvoidCrash.h"
-#import "NSMutableDictionary+AvoidCrash.h"
-
-#import "NSString+AvoidCrash.h"
-#import "NSMutableString+AvoidCrash.h"
-
-#import "NSAttributedString+AvoidCrash.h"
-#import "NSMutableAttributedString+AvoidCrash.h"
-
-//define
-#import "AvoidCrashStubProxy.h"
-
-
-
-
-
-@interface AvoidCrash : NSObject
-
-//===================================================
-//   使用方法和注意事项:
-//   https://www.jianshu.com/p/2b90aa96c0a0
-//===================================================
-
-
-
-/**
- *  
- *  开始生效.你可以在AppDelegate的didFinishLaunchingWithOptions方法中调用becomeEffective方法
- *  【默认不开启  对”unrecognized selector sent to instance”防止崩溃的处理】
- *
- *  这是全局生效,若你只需要部分生效,你可以单个进行处理,比如:
- *  [NSArray avoidCrashExchangeMethod];
- *  [NSMutableArray avoidCrashExchangeMethod];
- *  .................
- *  .................
- *
- */
-+ (void)becomeEffective;
-
-
-/** 
- *  相比于becomeEffective,增加
- *  对”unrecognized selector sent to instance”防止崩溃的处理
- *
- *  但是必须配合:
- *            setupClassStringsArr:和
- *            setupNoneSelClassStringPrefixsArr
- *            这两个方法可以同时使用
- */
-+ (void)makeAllEffective;
-
-
-
-/** 
- *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名数组
- *  ⚠️不可将@"NSObject"加入classStrings数组中
- *  ⚠️不可将UI前缀的字符串加入classStrings数组中
- */
-+ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
-
-
-/**
- *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
- *  ⚠️不可将UI前缀的字符串(包括@"UI")加入classStringPrefixs数组中
- *  ⚠️不可将NS前缀的字符串(包括@"NS")加入classStringPrefixs数组中
- */
-+ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-//您可以忽略以下方法
-
-+ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
-
-+ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
-
-+ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo;
-
-
-@end

+ 0 - 219
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.m

@@ -1,219 +0,0 @@
-//
-//  AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "AvoidCrash.h"
-
-
-
-
-#define key_errorName        @"errorName"
-#define key_errorReason      @"errorReason"
-#define key_errorPlace       @"errorPlace"
-#define key_defaultToDo      @"defaultToDo"
-#define key_callStackSymbols @"callStackSymbols"
-#define key_exception        @"exception"
-
-
-@implementation AvoidCrash
-
-
-+ (void)becomeEffective {
-    [self effectiveIfDealWithNoneSel:NO];
-    
-}
-
-+ (void)makeAllEffective {
-    [self effectiveIfDealWithNoneSel:YES];
-}
-
-+ (void)effectiveIfDealWithNoneSel:(BOOL)dealWithNoneSel {
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        [NSObject avoidCrashExchangeMethodIfDealWithNoneSel:dealWithNoneSel];
-        
-        [NSArray avoidCrashExchangeMethod];
-        [NSMutableArray avoidCrashExchangeMethod];
-        
-        [NSDictionary avoidCrashExchangeMethod];
-        [NSMutableDictionary avoidCrashExchangeMethod];
-        
-        [NSString avoidCrashExchangeMethod];
-        [NSMutableString avoidCrashExchangeMethod];
-        
-        [NSAttributedString avoidCrashExchangeMethod];
-        [NSMutableAttributedString avoidCrashExchangeMethod];
-    });
-}
-
-+ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings {
-    [NSObject setupNoneSelClassStringsArr:classStrings];
-}
-
-/**
- *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
- */
-+ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs {
-    [NSObject setupNoneSelClassStringPrefixsArr:classStringPrefixs];
-}
-
-
-/**
- *  类方法的交换
- *
- *  @param anClass    哪个类
- *  @param method1Sel 方法1
- *  @param method2Sel 方法2
- */
-+ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
-    Method method1 = class_getClassMethod(anClass, method1Sel);
-    Method method2 = class_getClassMethod(anClass, method2Sel);
-    method_exchangeImplementations(method1, method2);
-}
-
-
-/**
- *  对象方法的交换
- *
- *  @param anClass    哪个类
- *  @param method1Sel 方法1(原本的方法)
- *  @param method2Sel 方法2(要替换成的方法)
- */
-+ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
-    
-    
-    Method originalMethod = class_getInstanceMethod(anClass, method1Sel);
-    Method swizzledMethod = class_getInstanceMethod(anClass, method2Sel);
-    
-    BOOL didAddMethod =
-    class_addMethod(anClass,
-                    method1Sel,
-                    method_getImplementation(swizzledMethod),
-                    method_getTypeEncoding(swizzledMethod));
-    
-    if (didAddMethod) {
-        class_replaceMethod(anClass,
-                            method2Sel,
-                            method_getImplementation(originalMethod),
-                            method_getTypeEncoding(originalMethod));
-    }
-    
-    else {
-        method_exchangeImplementations(originalMethod, swizzledMethod);
-    }
-    
-}
-
-
-
-/**
- *  获取堆栈主要崩溃精简化的信息<根据正则表达式匹配出来>
- *
- *  @param callStackSymbols 堆栈主要崩溃信息
- *
- *  @return 堆栈主要崩溃精简化的信息
- */
-
-+ (NSString *)getMainCallStackSymbolMessageWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
-    
-    //mainCallStackSymbolMsg的格式为   +[类名 方法名]  或者 -[类名 方法名]
-    __block NSString *mainCallStackSymbolMsg = nil;
-    
-    //匹配出来的格式为 +[类名 方法名]  或者 -[类名 方法名]
-    NSString *regularExpStr = @"[-\\+]\\[.+\\]";
-    
-    
-    NSRegularExpression *regularExp = [[NSRegularExpression alloc] initWithPattern:regularExpStr options:NSRegularExpressionCaseInsensitive error:nil];
-    
-    
-    for (int index = 2; index < callStackSymbols.count; index++) {
-        NSString *callStackSymbol = callStackSymbols[index];
-        
-        [regularExp enumerateMatchesInString:callStackSymbol options:NSMatchingReportProgress range:NSMakeRange(0, callStackSymbol.length) usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL * _Nonnull stop) {
-            if (result) {
-                NSString* tempCallStackSymbolMsg = [callStackSymbol substringWithRange:result.range];
-                
-                //get className
-                NSString *className = [tempCallStackSymbolMsg componentsSeparatedByString:@" "].firstObject;
-                className = [className componentsSeparatedByString:@"["].lastObject;
-                
-                NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(className)];
-                
-                //filter category and system class
-                if (![className hasSuffix:@")"] && bundle == [NSBundle mainBundle]) {
-                    mainCallStackSymbolMsg = tempCallStackSymbolMsg;
-                    
-                }
-                *stop = YES;
-            }
-        }];
-        
-        if (mainCallStackSymbolMsg.length) {
-            break;
-        }
-    }
-    
-    return mainCallStackSymbolMsg;
-}
-
-
-/**
- *  提示崩溃的信息(控制台输出、通知)
- *
- *  @param exception   捕获到的异常
- *  @param defaultToDo 这个框架里默认的做法
- */
-+ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo {
-
-    //堆栈数据
-    NSArray *callStackSymbolsArr = [NSThread callStackSymbols];
-    
-    //获取在哪个类的哪个方法中实例化的数组  字符串格式 -[类名 方法名]  或者 +[类名 方法名]
-    NSString *mainCallStackSymbolMsg = [AvoidCrash getMainCallStackSymbolMessageWithCallStackSymbols:callStackSymbolsArr];
-    
-    if (mainCallStackSymbolMsg == nil) {
-        
-        mainCallStackSymbolMsg = @"崩溃方法定位失败,请您查看函数调用栈来排查错误原因";
-        
-    }
-    
-    NSString *errorName = exception.name;
-    NSString *errorReason = exception.reason;
-    //errorReason 可能为 -[__NSCFConstantString avoidCrashCharacterAtIndex:]: Range or index out of bounds
-    //将avoidCrash去掉
-    errorReason = [errorReason stringByReplacingOccurrencesOfString:@"avoidCrash" withString:@""];
-    
-    NSString *errorPlace = [NSString stringWithFormat:@"Error Place:%@",mainCallStackSymbolMsg];
-    
-    NSString *logErrorMessage = [NSString stringWithFormat:@"\n\n%@\n\n%@\n%@\n%@\n%@",AvoidCrashSeparatorWithFlag, errorName, errorReason, errorPlace, defaultToDo];
-    
-    logErrorMessage = [NSString stringWithFormat:@"%@\n\n%@\n\n",logErrorMessage,AvoidCrashSeparator];
-    AvoidCrashLog(@"%@",logErrorMessage);
-    
-    
-    //请忽略下面的赋值,目的只是为了能顺利上传到cocoapods
-    logErrorMessage = logErrorMessage;
-    
-    NSDictionary *errorInfoDic = @{
-                                   key_errorName        : errorName,
-                                   key_errorReason      : errorReason,
-                                   key_errorPlace       : errorPlace,
-                                   key_defaultToDo      : defaultToDo,
-                                   key_exception        : exception,
-                                   key_callStackSymbols : callStackSymbolsArr
-                                   };
-    
-    //将错误信息放在字典里,用通知的形式发送出去
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [[NSNotificationCenter defaultCenter] postNotificationName:AvoidCrashNotification object:nil userInfo:errorInfoDic];
-    });
-}
-
-
-
-@end

+ 0 - 17
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashProtocol.h

@@ -1,17 +0,0 @@
-//
-//  AvoidCrashProtocol.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by chenfanfang on 2017/7/22.
-//  Copyright © 2017年 chenfanfang. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-
-@protocol AvoidCrashProtocol <NSObject>
-
-@required
-+ (void)avoidCrashExchangeMethod;
-
-@end

+ 0 - 37
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.h

@@ -1,37 +0,0 @@
-//
-//  AvoidCrashStubProxy.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by chenfanfang on 2017/7/25.
-//  Copyright © 2017年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-
-#define AvoidCrashNotification @"AvoidCrashNotification"
-#define AvoidCrashIsiOS(version) ([[UIDevice currentDevice].systemVersion floatValue] >= version)
-
-
-//user can ignore below define
-#define AvoidCrashDefaultReturnNil  @"AvoidCrash default is to return nil to avoid crash."
-#define AvoidCrashDefaultIgnore     @"AvoidCrash default is to ignore this operation to avoid crash."
-
-#define AvoidCrashSeparator         @"================================================================"
-#define AvoidCrashSeparatorWithFlag @"========================AvoidCrash Log=========================="
-
-
-#ifdef DEBUG
-
-#define  AvoidCrashLog(...) NSLog(@"%@",[NSString stringWithFormat:__VA_ARGS__])
-
-#else
-
-#define AvoidCrashLog(...)
-#endif
-
-@interface AvoidCrashStubProxy : NSObject
-
-- (void)proxyMethod;
-
-@end

+ 0 - 18
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.m

@@ -1,18 +0,0 @@
-//
-//  AvoidCrashStubProxy.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by chenfanfang on 2017/7/25.
-//  Copyright © 2017年 chenfanfang. All rights reserved.
-//
-
-#import "AvoidCrashStubProxy.h"
-
-
-@implementation AvoidCrashStubProxy
-
-- (void)proxyMethod {
-    
-}
-
-@end

+ 0 - 25
RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.h

@@ -1,25 +0,0 @@
-//
-//  NSArray+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSArray (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1. NSArray的快速创建方式 NSArray *array = @[@"chenfanfang", @"AvoidCrash"];  //这种创建方式其实调用的是2中的方法
- *  2. +(instancetype)arrayWithObjects:(const id  _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt
- *  3. - (id)objectAtIndex:(NSUInteger)index
- *  4. - (void)getObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range
- */    

+ 0 - 258
RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.m

@@ -1,258 +0,0 @@
-//
-//  NSArray+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSArray+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSArray (AvoidCrash)
-
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        //=================
-        //   class method
-        //=================
-        
-        //instance array method exchange
-        [AvoidCrash exchangeClassMethod:[self class] method1Sel:@selector(arrayWithObjects:count:) method2Sel:@selector(AvoidCrashArrayWithObjects:count:)];
-        
-        
-        
-        //====================
-        //   instance method
-        //====================
-        
-        Class __NSArray = NSClassFromString(@"NSArray");
-        Class __NSArrayI = NSClassFromString(@"__NSArrayI");
-        Class __NSSingleObjectArrayI = NSClassFromString(@"__NSSingleObjectArrayI");
-        Class __NSArray0 = NSClassFromString(@"__NSArray0");
-        
-        
-        //objectsAtIndexes:
-        [AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(objectsAtIndexes:) method2Sel:@selector(avoidCrashObjectsAtIndexes:)];
-        
-        
-        //objectAtIndex:
-        
-        [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndex:)];
-        
-        [AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashObjectAtIndex:)];
-        
-        [AvoidCrash exchangeInstanceMethod:__NSArray0 method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArray0AvoidCrashObjectAtIndex:)];
-        
-        //objectAtIndexedSubscript:
-        if (AvoidCrashIsiOS(11.0)) {
-            [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndexedSubscript:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndexedSubscript:)];
-        }
-        
-        
-        //getObjects:range:
-        [AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(getObjects:range:) method2Sel:@selector(NSArrayAvoidCrashGetObjects:range:)];
-        
-        [AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashGetObjects:range:)];
-        
-        [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSArrayIAvoidCrashGetObjects:range:)];
-    });
-    
-    
-}
-
-
-//=================================================================
-//                        instance array
-//=================================================================
-#pragma mark - instance array
-
-
-+ (instancetype)AvoidCrashArrayWithObjects:(const id  _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt {
-    
-    id instance = nil;
-    
-    @try {
-        instance = [self AvoidCrashArrayWithObjects:objects count:cnt];
-    }
-    @catch (NSException *exception) {
-        
-        NSString *defaultToDo = @"AvoidCrash default is to remove nil object and instance a array.";
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-        //以下是对错误数据的处理,把为nil的数据去掉,然后初始化数组
-        NSInteger newObjsIndex = 0;
-        id  _Nonnull __unsafe_unretained newObjects[cnt];
-        
-        for (int i = 0; i < cnt; i++) {
-            if (objects[i] != nil) {
-                newObjects[newObjsIndex] = objects[i];
-                newObjsIndex++;
-            }
-        }
-        instance = [self AvoidCrashArrayWithObjects:newObjects count:newObjsIndex];
-    }
-    @finally {
-        return instance;
-    }
-}
-
-
-
-//=================================================================
-//                     objectAtIndexedSubscript:
-//=================================================================
-#pragma mark - objectAtIndexedSubscript:
-- (id)__NSArrayIAvoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
-    id object = nil;
-    
-    @try {
-        object = [self __NSArrayIAvoidCrashObjectAtIndexedSubscript:idx];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-
-}
-
-
-//=================================================================
-//                       objectsAtIndexes:
-//=================================================================
-#pragma mark - objectsAtIndexes:
-
-- (NSArray *)avoidCrashObjectsAtIndexes:(NSIndexSet *)indexes {
-    
-    NSArray *returnArray = nil;
-    @try {
-        returnArray = [self avoidCrashObjectsAtIndexes:indexes];
-    } @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-    } @finally {
-        return returnArray;
-    }
-}
-
-
-//=================================================================
-//                         objectAtIndex:
-//=================================================================
-#pragma mark - objectAtIndex:
-
-//__NSArrayI  objectAtIndex:
-- (id)__NSArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
-    id object = nil;
-    
-    @try {
-        object = [self __NSArrayIAvoidCrashObjectAtIndex:index];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-
-
-//__NSSingleObjectArrayI objectAtIndex:
-- (id)__NSSingleObjectArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
-    id object = nil;
-    
-    @try {
-        object = [self __NSSingleObjectArrayIAvoidCrashObjectAtIndex:index];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-//__NSArray0 objectAtIndex:
-- (id)__NSArray0AvoidCrashObjectAtIndex:(NSUInteger)index {
-    id object = nil;
-    
-    @try {
-        object = [self __NSArray0AvoidCrashObjectAtIndex:index];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-
-//=================================================================
-//                           getObjects:range:
-//=================================================================
-#pragma mark - getObjects:range:
-
-//NSArray getObjects:range:
-- (void)NSArrayAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
-    
-    @try {
-        [self NSArrayAvoidCrashGetObjects:objects range:range];
-    } @catch (NSException *exception) {
-        
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-    } @finally {
-        
-    }
-}
-
-
-//__NSSingleObjectArrayI  getObjects:range:
-- (void)__NSSingleObjectArrayIAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
-    
-    @try {
-        [self __NSSingleObjectArrayIAvoidCrashGetObjects:objects range:range];
-    } @catch (NSException *exception) {
-        
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-    } @finally {
-        
-    }
-}
-
-
-//__NSArrayI  getObjects:range:
-- (void)__NSArrayIAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
-    
-    @try {
-        [self __NSArrayIAvoidCrashGetObjects:objects range:range];
-    } @catch (NSException *exception) {
-        
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-    } @finally {
-        
-    }
-}
-
-
-
-
-@end

+ 0 - 25
RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.h

@@ -1,25 +0,0 @@
-//
-//  NSAttributedString+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/15.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSAttributedString (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-/**
- *  Can avoid crash method
- *
- *  1.- (instancetype)initWithString:(NSString *)str
- *  2.- (instancetype)initWithAttributedString:(NSAttributedString *)attrStr
- *  3.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
- *
- *
- */

+ 0 - 96
RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.m

@@ -1,96 +0,0 @@
-//
-//  NSAttributedString+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/15.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSAttributedString+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSAttributedString (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        Class NSConcreteAttributedString = NSClassFromString(@"NSConcreteAttributedString");
-        
-        //initWithString:
-        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
-        
-        //initWithAttributedString
-        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithAttributedString:) method2Sel:@selector(avoidCrashInitWithAttributedString:)];
-        
-        //initWithString:attributes:
-        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
-    });
-
-}
-
-//=================================================================
-//                           initWithString:
-//=================================================================
-#pragma mark - initWithString:
-
-- (instancetype)avoidCrashInitWithString:(NSString *)str {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashInitWithString:str];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-
-//=================================================================
-//                          initWithAttributedString
-//=================================================================
-#pragma mark - initWithAttributedString
-
-- (instancetype)avoidCrashInitWithAttributedString:(NSAttributedString *)attrStr {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashInitWithAttributedString:attrStr];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-
-//=================================================================
-//                      initWithString:attributes:
-//=================================================================
-#pragma mark - initWithString:attributes:
-
-- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashInitWithString:str attributes:attrs];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-@end

+ 0 - 24
RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.h

@@ -1,24 +0,0 @@
-//
-//  NSDictionary+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSDictionary (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1. NSDictionary的快速创建方式 NSDictionary *dict = @{@"frameWork" : @"AvoidCrash"}; //这种创建方式其实调用的是2中的方法
- *  2. +(instancetype)dictionaryWithObjects:(const id  _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying>  _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt
- *
- */

+ 0 - 56
RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.m

@@ -1,56 +0,0 @@
-//
-//  NSDictionary+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSDictionary+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSDictionary (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        [AvoidCrash exchangeClassMethod:self method1Sel:@selector(dictionaryWithObjects:forKeys:count:) method2Sel:@selector(avoidCrashDictionaryWithObjects:forKeys:count:)];
-    });
-}
-
-
-+ (instancetype)avoidCrashDictionaryWithObjects:(const id  _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying>  _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt {
-    
-    id instance = nil;
-    
-    @try {
-        instance = [self avoidCrashDictionaryWithObjects:objects forKeys:keys count:cnt];
-    }
-    @catch (NSException *exception) {
-        
-        NSString *defaultToDo = @"AvoidCrash default is to remove nil key-values and instance a dictionary.";
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-        //处理错误的数据,然后重新初始化一个字典
-        NSUInteger index = 0;
-        id  _Nonnull __unsafe_unretained newObjects[cnt];
-        id  _Nonnull __unsafe_unretained newkeys[cnt];
-        
-        for (int i = 0; i < cnt; i++) {
-            if (objects[i] && keys[i]) {
-                newObjects[index] = objects[i];
-                newkeys[index] = keys[i];
-                index++;
-            }
-        }
-        instance = [self avoidCrashDictionaryWithObjects:newObjects forKeys:newkeys count:index];
-    }
-    @finally {
-        return instance;
-    }
-}
-
-@end

+ 0 - 26
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.h

@@ -1,26 +0,0 @@
-//
-//  NSMutableArray+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSMutableArray (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1. - (id)objectAtIndex:(NSUInteger)index
- *  2. - (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx
- *  3. - (void)removeObjectAtIndex:(NSUInteger)index
- *  4. - (void)insertObject:(id)anObject atIndex:(NSUInteger)index
- *  5. - (void)getObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range
- */

+ 0 - 169
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.m

@@ -1,169 +0,0 @@
-//
-//  NSMutableArray+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/21.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSMutableArray+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSMutableArray (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        Class arrayMClass = NSClassFromString(@"__NSArrayM");
-        
-        
-        //objectAtIndex:
-        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndex:) method2Sel:@selector(avoidCrashObjectAtIndex:)];
-        
-        //objectAtIndexedSubscript
-        if (AvoidCrashIsiOS(11.0)) {
-            [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndexedSubscript:) method2Sel:@selector(avoidCrashObjectAtIndexedSubscript:)];
-        }
-        
-        
-        //setObject:atIndexedSubscript:
-        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(setObject:atIndexedSubscript:) method2Sel:@selector(avoidCrashSetObject:atIndexedSubscript:)];
-        
-        
-        //removeObjectAtIndex:
-        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(removeObjectAtIndex:) method2Sel:@selector(avoidCrashRemoveObjectAtIndex:)];
-        
-        //insertObject:atIndex:
-        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(insertObject:atIndex:) method2Sel:@selector(avoidCrashInsertObject:atIndex:)];
-        
-        //getObjects:range:
-        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(getObjects:range:) method2Sel:@selector(avoidCrashGetObjects:range:)];
-    });
-    
-    
-    
-}
-
-
-//=================================================================
-//                    array set object at index
-//=================================================================
-#pragma mark - get object from array
-
-
-- (void)avoidCrashSetObject:(id)obj atIndexedSubscript:(NSUInteger)idx {
-    
-    @try {
-        [self avoidCrashSetObject:obj atIndexedSubscript:idx];
-    }
-    @catch (NSException *exception) {
-        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
-    }
-    @finally {
-        
-    }
-}
-
-
-//=================================================================
-//                    removeObjectAtIndex:
-//=================================================================
-#pragma mark - removeObjectAtIndex:
-
-- (void)avoidCrashRemoveObjectAtIndex:(NSUInteger)index {
-    @try {
-        [self avoidCrashRemoveObjectAtIndex:index];
-    }
-    @catch (NSException *exception) {
-        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
-    }
-    @finally {
-        
-    }
-}
-
-
-//=================================================================
-//                    insertObject:atIndex:
-//=================================================================
-#pragma mark - set方法
-- (void)avoidCrashInsertObject:(id)anObject atIndex:(NSUInteger)index {
-    @try {
-        [self avoidCrashInsertObject:anObject atIndex:index];
-    }
-    @catch (NSException *exception) {
-        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
-    }
-    @finally {
-        
-    }
-}
-
-
-//=================================================================
-//                           objectAtIndex:
-//=================================================================
-#pragma mark - objectAtIndex:
-
-- (id)avoidCrashObjectAtIndex:(NSUInteger)index {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashObjectAtIndex:index];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-//=================================================================
-//                     objectAtIndexedSubscript:
-//=================================================================
-#pragma mark - objectAtIndexedSubscript:
-- (id)avoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashObjectAtIndexedSubscript:idx];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-    
-}
-
-
-//=================================================================
-//                         getObjects:range:
-//=================================================================
-#pragma mark - getObjects:range:
-
-- (void)avoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
-    
-    @try {
-        [self avoidCrashGetObjects:objects range:range];
-    } @catch (NSException *exception) {
-        
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-    } @finally {
-        
-    }
-}
-
-
-
-
-@end

+ 0 - 23
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.h

@@ -1,23 +0,0 @@
-//
-//  NSMutableAttributedString+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/15.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSMutableAttributedString (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1.- (instancetype)initWithString:(NSString *)str
- *  2.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
- */

+ 0 - 74
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.m

@@ -1,74 +0,0 @@
-//
-//  NSMutableAttributedString+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/15.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSMutableAttributedString+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSMutableAttributedString (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        Class NSConcreteMutableAttributedString = NSClassFromString(@"NSConcreteMutableAttributedString");
-        
-        //initWithString:
-        [AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
-        
-        //initWithString:attributes:
-        [AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
-    });
-}
-
-//=================================================================
-//                          initWithString:
-//=================================================================
-#pragma mark - initWithString:
-
-
-- (instancetype)avoidCrashInitWithString:(NSString *)str {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashInitWithString:str];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-
-//=================================================================
-//                     initWithString:attributes:
-//=================================================================
-#pragma mark - initWithString:attributes:
-
-
-- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
-    id object = nil;
-    
-    @try {
-        object = [self avoidCrashInitWithString:str attributes:attrs];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return object;
-    }
-}
-
-
-@end

+ 0 - 24
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.h

@@ -1,24 +0,0 @@
-//
-//  NSMutableDictionary+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/22.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSMutableDictionary (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1. - (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey
- *  2. - (void)removeObjectForKey:(id)aKey
- *
- */

+ 0 - 95
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.m

@@ -1,95 +0,0 @@
-//
-//  NSMutableDictionary+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/9/22.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSMutableDictionary+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSMutableDictionary (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        Class dictionaryM = NSClassFromString(@"__NSDictionaryM");
-        
-        //setObject:forKey:
-        [AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKey:) method2Sel:@selector(avoidCrashSetObject:forKey:)];
-        
-        //setObject:forKeyedSubscript:
-        if (AvoidCrashIsiOS(11.0)) {
-            [AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKeyedSubscript:) method2Sel:@selector(avoidCrashSetObject:forKeyedSubscript:)];
-        }
-        
-        
-        
-        //removeObjectForKey:
-        Method removeObjectForKey = class_getInstanceMethod(dictionaryM, @selector(removeObjectForKey:));
-        Method avoidCrashRemoveObjectForKey = class_getInstanceMethod(dictionaryM, @selector(avoidCrashRemoveObjectForKey:));
-        method_exchangeImplementations(removeObjectForKey, avoidCrashRemoveObjectForKey);
-    });
-}
-
-
-//=================================================================
-//                       setObject:forKey:
-//=================================================================
-#pragma mark - setObject:forKey:
-
-- (void)avoidCrashSetObject:(id)anObject forKey:(id<NSCopying>)aKey {
-    
-    @try {
-        [self avoidCrashSetObject:anObject forKey:aKey];
-    }
-    @catch (NSException *exception) {
-        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
-    }
-    @finally {
-        
-    }
-}
-
-//=================================================================
-//                  setObject:forKeyedSubscript:
-//=================================================================
-#pragma mark - setObject:forKeyedSubscript:
-- (void)avoidCrashSetObject:(id)obj forKeyedSubscript:(id<NSCopying>)key {
-    @try {
-        [self avoidCrashSetObject:obj forKeyedSubscript:key];
-    }
-    @catch (NSException *exception) {
-        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
-    }
-    @finally {
-        
-    }
-}
-
-
-//=================================================================
-//                       removeObjectForKey:
-//=================================================================
-#pragma mark - removeObjectForKey:
-
-- (void)avoidCrashRemoveObjectForKey:(id)aKey {
-    
-    @try {
-        [self avoidCrashRemoveObjectForKey:aKey];
-    }
-    @catch (NSException *exception) {
-        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
-    }
-    @finally {
-        
-    }
-}
-
-
-
-
-@end

+ 0 - 29
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.h

@@ -1,29 +0,0 @@
-//
-//  NSMutableString+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/6.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSMutableString (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1. 由于NSMutableString是继承于NSString,所以这里和NSString有些同样的方法就不重复写了
- *  2. - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString
- *  3. - (void)insertString:(NSString *)aString atIndex:(NSUInteger)loc
- *  4. - (void)deleteCharactersInRange:(NSRange)range
- *
- */
-
-
-

+ 0 - 97
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.m

@@ -1,97 +0,0 @@
-//
-//  NSMutableString+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/6.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSMutableString+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSMutableString (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        Class stringClass = NSClassFromString(@"__NSCFString");
-        
-        //replaceCharactersInRange
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(replaceCharactersInRange:withString:) method2Sel:@selector(avoidCrashReplaceCharactersInRange:withString:)];
-        
-        //insertString:atIndex:
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(insertString:atIndex:) method2Sel:@selector(avoidCrashInsertString:atIndex:)];
-        
-        //deleteCharactersInRange
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(deleteCharactersInRange:) method2Sel:@selector(avoidCrashDeleteCharactersInRange:)];
-    });
-}
-
-//=================================================================
-//                     replaceCharactersInRange
-//=================================================================
-#pragma mark - replaceCharactersInRange
-
-- (void)avoidCrashReplaceCharactersInRange:(NSRange)range withString:(NSString *)aString {
-    
-    @try {
-        [self avoidCrashReplaceCharactersInRange:range withString:aString];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-//=================================================================
-//                     insertString:atIndex:
-//=================================================================
-#pragma mark - insertString:atIndex:
-
-- (void)avoidCrashInsertString:(NSString *)aString atIndex:(NSUInteger)loc {
-    
-    @try {
-        [self avoidCrashInsertString:aString atIndex:loc];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-//=================================================================
-//                   deleteCharactersInRange
-//=================================================================
-#pragma mark - deleteCharactersInRange
-
-- (void)avoidCrashDeleteCharactersInRange:(NSRange)range {
-    
-    @try {
-        [self avoidCrashDeleteCharactersInRange:range];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-
-
-
-
-
-
-
-@end

+ 0 - 34
RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.h

@@ -1,34 +0,0 @@
-//
-//  NSObject+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/11.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-
-@interface NSObject (AvoidCrash)
-
-/** 
- *  ifDealWithNoneSel : 是否开启"unrecognized selector sent to instance"异常的捕获
- */
-+ (void)avoidCrashExchangeMethodIfDealWithNoneSel:(BOOL)ifDealWithNoneSel;
-
-
-+ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
-
-+ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
-
-@end
-
-/**
- *  Can avoid crash method
- *
- *  1.- (void)setValue:(id)value forKey:(NSString *)key
- *  2.- (void)setValue:(id)value forKeyPath:(NSString *)keyPath
- *  3.- (void)setValue:(id)value forUndefinedKey:(NSString *)key //这个方法一般用来重写,不会主动调用
- *  4.- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues
- *  5. unrecognized selector sent to instance
- */

+ 0 - 221
RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.m

@@ -1,221 +0,0 @@
-//
-//  NSObject+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/11.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSObject+AvoidCrash.h"
-#import "AvoidCrash.h"
-#import "AvoidCrashStubProxy.h"
-
-@implementation NSObject (AvoidCrash)
-
-
-+ (void)avoidCrashExchangeMethodIfDealWithNoneSel:(BOOL)ifDealWithNoneSel {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        //setValue:forKey:
-        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKey:) method2Sel:@selector(avoidCrashSetValue:forKey:)];
-        
-        //setValue:forKeyPath:
-        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKeyPath:) method2Sel:@selector(avoidCrashSetValue:forKeyPath:)];
-        
-        //setValue:forUndefinedKey:
-        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forUndefinedKey:) method2Sel:@selector(avoidCrashSetValue:forUndefinedKey:)];
-        
-        //setValuesForKeysWithDictionary:
-        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValuesForKeysWithDictionary:) method2Sel:@selector(avoidCrashSetValuesForKeysWithDictionary:)];
-        
-        
-        //unrecognized selector sent to instance
-        if (ifDealWithNoneSel) {
-            [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(methodSignatureForSelector:) method2Sel:@selector(avoidCrashMethodSignatureForSelector:)];
-            [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(forwardInvocation:) method2Sel:@selector(avoidCrashForwardInvocation:)];
-        }
-    });
-}
-
-
-//=================================================================
-//              unrecognized selector sent to instance
-//=================================================================
-#pragma mark - unrecognized selector sent to instance
-
-
-static NSMutableArray *noneSelClassStrings;
-static NSMutableArray *noneSelClassStringPrefixs;
-
-+ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings {
-    
-    if (noneSelClassStrings) {
-        
-        NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n调用一此即可,多次调用会自动忽略后面的调用\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
-        AvoidCrashLog(@"%@",warningMsg);
-    }
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        noneSelClassStrings = [NSMutableArray array];
-        for (NSString *className in classStrings) {
-            if ([className hasPrefix:@"UI"] == NO &&
-                [className isEqualToString:NSStringFromClass([NSObject class])] == NO) {
-                [noneSelClassStrings addObject:className];
-                
-            } else {
-                NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n会忽略UI开头的类和NSObject类(请使用NSObject的子类)\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
-                AvoidCrashLog(@"%@",warningMsg);
-            }
-        }
-    });
-}
-
-/**
- *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
- */
-+ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs {
-    if (noneSelClassStringPrefixs) {
-        
-        NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringPrefixsArr:];\n调用一此即可,多次调用会自动忽略后面的调用\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
-        AvoidCrashLog(@"%@",warningMsg);
-    }
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        
-        noneSelClassStringPrefixs = [NSMutableArray array];
-        for (NSString *classNamePrefix in classStringPrefixs) {
-            if ([classNamePrefix hasPrefix:@"UI"] == NO &&
-                [classNamePrefix hasPrefix:@"NS"] == NO) {
-                [noneSelClassStringPrefixs addObject:classNamePrefix];
-                
-            } else {
-                NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n会忽略UI开头的类和NS开头的类\n若需要对NS开头的类防止”unrecognized selector sent to instance”(比如NSArray),请使用setupNoneSelClassStringsArr:\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
-                AvoidCrashLog(@"%@",warningMsg);
-            }
-        }
-    });
-}
-
-- (NSMethodSignature *)avoidCrashMethodSignatureForSelector:(SEL)aSelector {
-    
-    NSMethodSignature *ms = [self avoidCrashMethodSignatureForSelector:aSelector];
-    
-    BOOL flag = NO;
-    if (ms == nil) {
-        for (NSString *classStr in noneSelClassStrings) {
-            if ([self isKindOfClass:NSClassFromString(classStr)]) {
-                ms = [AvoidCrashStubProxy instanceMethodSignatureForSelector:@selector(proxyMethod)];
-                flag = YES;
-                break;
-            }
-        }
-    }
-    if (flag == NO) {
-        NSString *selfClass = NSStringFromClass([self class]);
-        for (NSString *classStrPrefix in noneSelClassStringPrefixs) {
-            if ([selfClass hasPrefix:classStrPrefix]) {
-                ms = [AvoidCrashStubProxy instanceMethodSignatureForSelector:@selector(proxyMethod)];
-            }
-        }
-    }
-    return ms;
-}
-
-- (void)avoidCrashForwardInvocation:(NSInvocation *)anInvocation {
-    
-    @try {
-        [self avoidCrashForwardInvocation:anInvocation];
-        
-    } @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        
-    } @finally {
-        
-    }
-    
-}
-
-
-//=================================================================
-//                         setValue:forKey:
-//=================================================================
-#pragma mark - setValue:forKey:
-
-- (void)avoidCrashSetValue:(id)value forKey:(NSString *)key {
-    @try {
-        [self avoidCrashSetValue:value forKey:key];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-
-//=================================================================
-//                     setValue:forKeyPath:
-//=================================================================
-#pragma mark - setValue:forKeyPath:
-
-- (void)avoidCrashSetValue:(id)value forKeyPath:(NSString *)keyPath {
-    @try {
-        [self avoidCrashSetValue:value forKeyPath:keyPath];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-
-
-//=================================================================
-//                     setValue:forUndefinedKey:
-//=================================================================
-#pragma mark - setValue:forUndefinedKey:
-
-- (void)avoidCrashSetValue:(id)value forUndefinedKey:(NSString *)key {
-    @try {
-        [self avoidCrashSetValue:value forUndefinedKey:key];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-
-//=================================================================
-//                  setValuesForKeysWithDictionary:
-//=================================================================
-#pragma mark - setValuesForKeysWithDictionary:
-
-- (void)avoidCrashSetValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
-    @try {
-        [self avoidCrashSetValuesForKeysWithDictionary:keyedValues];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultIgnore;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        
-    }
-}
-
-
-
-@end

+ 0 - 29
RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.h

@@ -1,29 +0,0 @@
-//
-//  NSString+AvoidCrash.h
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/5.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "AvoidCrashProtocol.h"
-
-@interface NSString (AvoidCrash)<AvoidCrashProtocol>
-
-
-@end
-
-
-/**
- *  Can avoid crash method
- *
- *  1. - (unichar)characterAtIndex:(NSUInteger)index
- *  2. - (NSString *)substringFromIndex:(NSUInteger)from
- *  3. - (NSString *)substringToIndex:(NSUInteger)to {
- *  4. - (NSString *)substringWithRange:(NSRange)range {
- *  5. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement
- *  6. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange
- *  7. - (NSString *)stringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement
- *
- */

+ 0 - 204
RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m

@@ -1,204 +0,0 @@
-//
-//  NSString+AvoidCrash.m
-//  https://github.com/chenfanfang/AvoidCrash
-//
-//  Created by mac on 16/10/5.
-//  Copyright © 2016年 chenfanfang. All rights reserved.
-//
-
-#import "NSString+AvoidCrash.h"
-
-#import "AvoidCrash.h"
-
-@implementation NSString (AvoidCrash)
-
-+ (void)avoidCrashExchangeMethod {
-    
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        Class stringClass = NSClassFromString(@"__NSCFConstantString");
-        
-        //characterAtIndex
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(characterAtIndex:) method2Sel:@selector(avoidCrashCharacterAtIndex:)];
-        
-        //substringFromIndex
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringFromIndex:) method2Sel:@selector(avoidCrashSubstringFromIndex:)];
-        
-        //substringToIndex
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringToIndex:) method2Sel:@selector(avoidCrashSubstringToIndex:)];
-        
-        //substringWithRange:
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringWithRange:) method2Sel:@selector(avoidCrashSubstringWithRange:)];
-        
-        //stringByReplacingOccurrencesOfString:
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:)];
-        
-        //stringByReplacingOccurrencesOfString:withString:options:range:
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:options:range:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:options:range:)];
-        
-        //stringByReplacingCharactersInRange:withString:
-        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingCharactersInRange:withString:) method2Sel:@selector(avoidCrashStringByReplacingCharactersInRange:withString:)];
-    });
-    
-}
-
-
-//=================================================================
-//                           characterAtIndex:
-//=================================================================
-#pragma mark - characterAtIndex:
-
-- (unichar)avoidCrashCharacterAtIndex:(NSUInteger)index {
-    
-    unichar characteristic;
-    @try {
-        characteristic = [self avoidCrashCharacterAtIndex:index];
-    }
-    @catch (NSException *exception) {
-        
-        NSString *defaultToDo = @"AvoidCrash default is to return a without assign unichar.";
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-    }
-    @finally {
-        return characteristic;
-    }
-}
-
-//=================================================================
-//                           substringFromIndex:
-//=================================================================
-#pragma mark - substringFromIndex:
-
-- (NSString *)avoidCrashSubstringFromIndex:(NSUInteger)from {
-    
-    NSString *subString = nil;
-    
-    @try {
-        subString = [self avoidCrashSubstringFromIndex:from];
-    }
-    @catch (NSException *exception) {
-        
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        subString = nil;
-    }
-    @finally {
-        return subString;
-    }
-}
-
-//=================================================================
-//                           substringToIndex
-//=================================================================
-#pragma mark - substringToIndex
-
-- (NSString *)avoidCrashSubstringToIndex:(NSUInteger)to {
-    
-    NSString *subString = nil;
-    
-    @try {
-        subString = [self avoidCrashSubstringToIndex:to];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        subString = nil;
-    }
-    @finally {
-        return subString;
-    }
-}
-
-
-//=================================================================
-//                           substringWithRange:
-//=================================================================
-#pragma mark - substringWithRange:
-
-- (NSString *)avoidCrashSubstringWithRange:(NSRange)range {
-    
-    NSString *subString = nil;
-    
-    @try {
-        subString = [self avoidCrashSubstringWithRange:range];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        subString = nil;
-    }
-    @finally {
-        return subString;
-    }
-}
-
-//=================================================================
-//                stringByReplacingOccurrencesOfString:
-//=================================================================
-#pragma mark - stringByReplacingOccurrencesOfString:
-
-- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement {
-    
-    NSString *newStr = nil;
-    
-    @try {
-        newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        newStr = nil;
-    }
-    @finally {
-        return newStr;
-    }
-}
-
-//=================================================================
-//  stringByReplacingOccurrencesOfString:withString:options:range:
-//=================================================================
-#pragma mark - stringByReplacingOccurrencesOfString:withString:options:range:
-
-- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange {
-    
-    NSString *newStr = nil;
-    
-    @try {
-        newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement options:options range:searchRange];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        newStr = nil;
-    }
-    @finally {
-        return newStr;
-    }
-}
-
-
-//=================================================================
-//       stringByReplacingCharactersInRange:withString:
-//=================================================================
-#pragma mark - stringByReplacingCharactersInRange:withString:
-
-- (NSString *)avoidCrashStringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement {
-
-    
-    NSString *newStr = nil;
-    
-    @try {
-        newStr = [self avoidCrashStringByReplacingCharactersInRange:range withString:replacement];
-    }
-    @catch (NSException *exception) {
-        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
-        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
-        newStr = nil;
-    }
-    @finally {
-        return newStr;
-    }
-}
-
-
-@end

BIN
RunGame/SDK/shoes_sdk/.DS_Store → RunGame/SDK/ThirdClass/Bugly-2.5.9/.DS_Store


BIN
RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Bugly


+ 163 - 0
RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Headers/Bugly.h

@@ -0,0 +1,163 @@
+//
+//  Bugly.h
+//
+//  Version: 2.5(9)
+//
+//  Copyright (c) 2017年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "BuglyConfig.h"
+#import "BuglyLog.h"
+
+BLY_START_NONNULL
+
+@interface Bugly : NSObject
+
+/**
+ *  初始化Bugly,使用默认BuglyConfigs
+ *
+ *  @param appId 注册Bugly分配的应用唯一标识
+ */
++ (void)startWithAppId:(NSString * BLY_NULLABLE)appId;
+
+/**
+ *  使用指定配置初始化Bugly
+ *
+ *  @param appId 注册Bugly分配的应用唯一标识
+ *  @param config 传入配置的 BuglyConfig
+ */
++ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
+                config:(BuglyConfig * BLY_NULLABLE)config;
+
+/**
+ *  使用指定配置初始化Bugly
+ *
+ *  @param appId 注册Bugly分配的应用唯一标识
+ *  @param development 是否开发设备
+ *  @param config 传入配置的 BuglyConfig
+ */
++ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
+     developmentDevice:(BOOL)development
+                config:(BuglyConfig * BLY_NULLABLE)config;
+
+/**
+ *  设置用户标识
+ *
+ *  @param userId 用户标识
+ */
++ (void)setUserIdentifier:(NSString *)userId;
+
+/**
+ *  更新版本信息
+ *
+ *  @param version 应用版本信息
+ */
++ (void)updateAppVersion:(NSString *)version;
+
+/**
+ *  设置关键数据,随崩溃信息上报
+ *
+ *  @param value KEY
+ *  @param key VALUE
+ */
++ (void)setUserValue:(NSString *)value
+              forKey:(NSString *)key;
+
+/**
+ *  获取USER ID
+ *
+ *  @return USER ID
+ */
++ (NSString *)buglyUserIdentifier;
+
+/**
+ *  获取关键数据
+ *
+ *  @return 关键数据
+ */
++ (NSDictionary * BLY_NULLABLE)allUserValues;
+
+/**
+ *  设置标签
+ *
+ *  @param tag 标签ID,可在网站生成
+ */
++ (void)setTag:(NSUInteger)tag;
+
+/**
+ *  获取当前设置标签
+ *
+ *  @return 当前标签ID
+ */
++ (NSUInteger)currentTag;
+
+/**
+ *  获取设备ID
+ *
+ *  @return 设备ID
+ */
++ (NSString *)buglyDeviceId;
+
+/**
+ *  上报自定义Objective-C异常
+ *
+ *  @param exception 异常信息
+ */
++ (void)reportException:(NSException *)exception;
+
+/**
+ *  上报错误
+ *
+ *  @param error 错误信息
+ */
++ (void)reportError:(NSError *)error;
+
+/**
+ *    @brief 上报自定义错误
+ *
+ *    @param category    类型(Cocoa=3,CSharp=4,JS=5,Lua=6)
+ *    @param aName       名称
+ *    @param aReason     错误原因
+ *    @param aStackArray 堆栈
+ *    @param info        附加数据
+ *    @param terminate   上报后是否退出应用进程
+ */
++ (void)reportExceptionWithCategory:(NSUInteger)category
+                               name:(NSString *)aName
+                             reason:(NSString *)aReason
+                          callStack:(NSArray *)aStackArray
+                          extraInfo:(NSDictionary *)info
+                       terminateApp:(BOOL)terminate;
+
+/**
+ *  SDK 版本信息
+ *
+ *  @return SDK版本号
+ */
++ (NSString *)sdkVersion;
+
+/**
+ *  APP 版本信息
+ *
+ *  @return SDK版本号
+ */
++ (NSString *)appVersion;
+
+/**
+ *  App 是否发生了连续闪退
+ *  如果 启动SDK 且 5秒内 闪退,且次数达到 3次 则判定为连续闪退
+ *
+ *  @return 是否连续闪退
+ */
++ (BOOL)isAppCrashedOnStartUpExceedTheLimit;
+
+/**
+ *  关闭bugly监控
+ */
++ (void)closeCrashReport;
+
+BLY_END_NONNULL
+
+@end

+ 141 - 0
RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Headers/BuglyConfig.h

@@ -0,0 +1,141 @@
+//
+//  BuglyConfig.h
+//  Bugly
+//
+//  Copyright (c) 2016年 Tencent. All rights reserved.
+//
+
+#pragma once
+
+#define BLY_UNAVAILABLE(x) __attribute__((unavailable(x)))
+
+#if __has_feature(nullability)
+#define BLY_NONNULL __nonnull
+#define BLY_NULLABLE __nullable
+#define BLY_START_NONNULL _Pragma("clang assume_nonnull begin")
+#define BLY_END_NONNULL _Pragma("clang assume_nonnull end")
+#else
+#define BLY_NONNULL
+#define BLY_NULLABLE
+#define BLY_START_NONNULL
+#define BLY_END_NONNULL
+#endif
+
+#import <Foundation/Foundation.h>
+
+#import "BuglyLog.h"
+
+BLY_START_NONNULL
+
+@protocol BuglyDelegate <NSObject>
+
+@optional
+/**
+ *  发生异常时回调
+ *
+ *  @param exception 异常信息
+ *
+ *  @return 返回需上报记录,随异常上报一起上报
+ */
+- (NSString * BLY_NULLABLE)attachmentForException:(NSException * BLY_NULLABLE)exception;
+
+
+/**
+ *  策略激活时回调
+ *
+ *  @param tacticInfo
+ *
+ *  @return app是否弹框展示
+ */
+- (BOOL) h5AlertForTactic:(NSDictionary *)tacticInfo;
+
+@end
+
+@interface BuglyConfig : NSObject
+
+/**
+ *  SDK Debug信息开关, 默认关闭
+ */
+@property (nonatomic, assign) BOOL debugMode;
+
+/**
+ *  设置自定义渠道标识
+ */
+@property (nonatomic, copy) NSString *channel;
+
+/**
+ *  设置自定义版本号
+ */
+@property (nonatomic, copy) NSString *version;
+
+/**
+ *  设置自定义设备唯一标识
+ */
+@property (nonatomic, copy) NSString *deviceIdentifier;
+
+/**
+ *  卡顿监控开关,默认关闭
+ */
+@property (nonatomic) BOOL blockMonitorEnable;
+
+/**
+ *  卡顿监控判断间隔,单位为秒
+ */
+@property (nonatomic) NSTimeInterval blockMonitorTimeout;
+
+/**
+ *  设置 App Groups Id (如有使用 Bugly iOS Extension SDK,请设置该值)
+ */
+@property (nonatomic, copy) NSString *applicationGroupIdentifier;
+
+/**
+ *  进程内还原开关,默认开启
+ */
+@property (nonatomic) BOOL symbolicateInProcessEnable;
+
+/**
+ *  非正常退出事件记录开关,默认关闭
+ */
+@property (nonatomic) BOOL unexpectedTerminatingDetectionEnable;
+
+/**
+ *  页面信息记录开关,默认开启
+ */
+@property (nonatomic) BOOL viewControllerTrackingEnable;
+
+/**
+ *  Bugly Delegate
+ */
+@property (nonatomic, assign) id<BuglyDelegate> delegate;
+
+/**
+ * 控制自定义日志上报,默认值为BuglyLogLevelSilent,即关闭日志记录功能。
+ * 如果设置为BuglyLogLevelWarn,则在崩溃时会上报Warn、Error接口打印的日志
+ */
+@property (nonatomic, assign) BuglyLogLevel reportLogLevel;
+
+/**
+ *  崩溃数据过滤器,如果崩溃堆栈的模块名包含过滤器中设置的关键字,则崩溃数据不会进行上报
+ *  例如,过滤崩溃堆栈中包含搜狗输入法的数据,可以添加过滤器关键字SogouInputIPhone.dylib等
+ */
+@property (nonatomic, copy) NSArray *excludeModuleFilter;
+
+/**
+ * 控制台日志上报开关,默认开启
+ */
+@property (nonatomic, assign) BOOL consolelogEnable;
+
+/**
+ * 崩溃退出超时,如果监听到崩溃后,App一直没有退出,则到达超时时间后会自动abort进程退出
+ * 默认值 5s, 单位 秒
+ * 当赋值为0时,则不会自动abort进程退出
+ */
+@property (nonatomic, assign) NSUInteger crashAbortTimeout;
+
+/**
+ *  设置自定义联网、crash上报域名
+ */
+@property (nonatomic, copy) NSString *crashServerUrl;
+
+@end
+BLY_END_NONNULL

+ 78 - 0
RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Headers/BuglyLog.h

@@ -0,0 +1,78 @@
+//
+//  BuglyLog.h
+//  Bugly
+//
+//  Copyright (c) 2017年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+// Log level for Bugly Log
+typedef NS_ENUM(NSUInteger, BuglyLogLevel) {
+    BuglyLogLevelSilent  = 0,
+    BuglyLogLevelError   = 1,
+    BuglyLogLevelWarn    = 2,
+    BuglyLogLevelInfo    = 3,
+    BuglyLogLevelDebug   = 4,
+    BuglyLogLevelVerbose = 5,
+};
+#pragma mark -
+
+OBJC_EXTERN void BLYLog(BuglyLogLevel level, NSString *format, ...) NS_FORMAT_FUNCTION(2, 3);
+
+OBJC_EXTERN void BLYLogv(BuglyLogLevel level, NSString *format, va_list args) NS_FORMAT_FUNCTION(2, 0);
+
+#pragma mark -
+#define BUGLY_LOG_MACRO(_level, fmt, ...) [BuglyLog level:_level tag:nil log:fmt, ##__VA_ARGS__]
+
+#define BLYLogError(fmt, ...)   BUGLY_LOG_MACRO(BuglyLogLevelError, fmt, ##__VA_ARGS__)
+#define BLYLogWarn(fmt, ...)    BUGLY_LOG_MACRO(BuglyLogLevelWarn,  fmt, ##__VA_ARGS__)
+#define BLYLogInfo(fmt, ...)    BUGLY_LOG_MACRO(BuglyLogLevelInfo, fmt, ##__VA_ARGS__)
+#define BLYLogDebug(fmt, ...)   BUGLY_LOG_MACRO(BuglyLogLevelDebug, fmt, ##__VA_ARGS__)
+#define BLYLogVerbose(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelVerbose, fmt, ##__VA_ARGS__)
+
+#pragma mark - Interface
+@interface BuglyLog : NSObject
+
+/**
+ *    @brief  初始化日志模块
+ *
+ *    @param level 设置默认日志级别,默认BLYLogLevelSilent
+ *
+ *    @param printConsole 是否打印到控制台,默认NO
+ */
++ (void)initLogger:(BuglyLogLevel) level consolePrint:(BOOL)printConsole;
+
+/**
+ *    @brief 打印BLYLogLevelInfo日志
+ *
+ *    @param format   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)log:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+
+/**
+ *    @brief  打印日志
+ *
+ *    @param level 日志级别
+ *    @param message   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)level:(BuglyLogLevel) level logs:(NSString *)message;
+
+/**
+ *    @brief  打印日志
+ *
+ *    @param level 日志级别
+ *    @param format   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)level:(BuglyLogLevel) level log:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+
+/**
+ *    @brief  打印日志
+ *
+ *    @param level  日志级别
+ *    @param tag    日志模块分类
+ *    @param format   日志内容 总日志大小限制为:字符串长度30k,条数200
+ */
++ (void)level:(BuglyLogLevel) level tag:(NSString *) tag log:(NSString *)format, ... NS_FORMAT_FUNCTION(3, 4);
+
+@end

+ 12 - 0
RunGame/SDK/ThirdClass/Bugly-2.5.9/Bugly.framework/Modules/module.modulemap

@@ -0,0 +1,12 @@
+framework module Bugly {
+	umbrella header "Bugly.h"
+	
+	export *
+	module * { export * }
+	
+	link framework "Foundation"
+	link framework "Security"
+	link framework "SystemConfiguration"
+	link "c++"
+	link "z"
+}

+ 0 - 16
RunGame/SDK/ThirdClass/BuglyManager.h

@@ -1,16 +0,0 @@
-////
-////  BuglyManager.h
-////  Unity-iPhone
-////
-////  Created by duowan123 on 2022/1/13.
-////
-//
-//#import <UnityFramework/UnityFramework.h>
-//
-//NS_ASSUME_NONNULL_BEGIN
-//
-//@interface BuglyManager : UnityAppController
-//- (void)startBuglyManager;
-//@end
-//
-//NS_ASSUME_NONNULL_END

+ 0 - 40
RunGame/SDK/ThirdClass/BuglyManager.m

@@ -1,40 +0,0 @@
-////
-////  BuglyManager.m
-////  Unity-iPhone
-////
-////  Created by duowan123 on 2022/1/13.
-////
-//
-//#import "BuglyManager.h"
-//#import "AvoidCrash.h"
-//#import "AvoidCrashStubProxy.h"
-////#import <Bugly/Bugly.h>
-//
-//@implementation BuglyManager
-//
-//- (void)startBuglyManager{
-//
-////        [Bugly startWithAppId:@"36a0c05291"];
-//        //防奔溃
-//        [AvoidCrash makeAllEffective];
-//    
-//        //监听通知:AvoidCrashNotification, 获取AvoidCrash捕获的崩溃日志的详细信息
-//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil];
-//}
-//
-//- (void)dealwithCrashMessage:(NSNotification *)note{
-//
-//     NSDictionary *info = note.userInfo;
-//      NSString *errorReason = [NSString stringWithFormat:@"【ErrorReason】%@========【ErrorPlace】%@========【DefaultToDo】%@========【ErrorName】%@", info[@"errorReason"], info[@"errorPlace"], info[@"defaultToDo"], info[@"errorName"]];
-//      NSArray *callStack = info[@"callStackSymbols"];
-//      [self reportErrorName:@"Bugly_ErrorName_AvoidCrash" errorReason:errorReason callStack:callStack extraInfo:nil];
-//
-//}
-//
-///** 上报错误信息 */
-//- (void)reportErrorName:(NSString *)errorName errorReason:(NSString *)errorReason callStack:(NSArray *)aStackArray extraInfo:(NSDictionary *)info{
-////    [Bugly reportExceptionWithCategory:3 name:errorName reason:errorReason callStack:aStackArray extraInfo:info terminateApp:NO];
-//
-//}
-//
-//@end

BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/shoes_sdk/.DS_Store → RunGame/SDK/ThirdClass/Bugly_2.5.0/.DS_Store


+ 1 - 0
RunGame/SDK/Tool/MYFactoryManager.h

@@ -25,6 +25,7 @@
 //蓝牙框架封装
 #import "LEONBLManager.h"
 #import "BTDataSend.h"
+#import "BTDataAnalysis.h"
 #import "CBPeripheral+ADName.h"
 #define BTDataInstance [BTDataProcess sharedInstance]
 #define LEManager [LEONBLManager sharedInstance]

+ 1 - 1
RunGame/SDK/UI/CarouselView/ShoesCarouselView.m

@@ -365,7 +365,7 @@ UIScrollViewDelegate
 -(TXCarouselViewLayout *)carouselViewLayout{
     
     if (!_carouselViewLayout){
-        CGFloat itemsHeight = self.carouselSize.height*itemHight;
+        CGFloat itemsHeight = _carouselSize.height*itemHight;
         _carouselViewLayout = [[TXCarouselViewLayout alloc] init];
         _carouselViewLayout.itemSize = CGSizeMake(itemsHeight, itemsHeight);
         _carouselViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;

+ 1 - 1
RunGame/SDK/UI/CarouselView/TXCarouselView.m

@@ -300,7 +300,7 @@ UIScrollViewDelegate
 -(TXCarouselViewLayout *)carouselViewLayout{
     
     if (!_carouselViewLayout){
-        CGFloat itemsHeight = self.carouselSize.height*itemHight;
+        CGFloat itemsHeight = _carouselSize.height*itemHight;
         _carouselViewLayout = [[TXCarouselViewLayout alloc] init];
         _carouselViewLayout.itemSize = CGSizeMake(itemsHeight, itemsHeight);
         _carouselViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;

+ 0 - 122
RunGame/SDK/shoes_sdk/BigFoot.cpp

@@ -1,122 +0,0 @@
-#include "pub.h"
-
-#include "BigFoot.h"
-
-
-BigFoot::BigFoot()
-{
-	memset(result, 0, 4 * sizeof(int));
-
-	memset(left_min_acc, 0, 3 * sizeof(int));
-
-	memset(left_max_acc, 0, 3 * sizeof(int));
-
-	memset(right_min_acc, 0, 3 * sizeof(int));
-
-	memset(right_max_acc, 0, 3 * sizeof(int));
-
-	last_left_zupt = 1;
-
-	last_right_zupt = 1;
-}
-
-int BigFoot::station_acc(int* max_acc, int* min_acc)
-{
-	for (int i = 0; i < 3; i++)
-	{
-		if (max_acc[i] - min_acc[i] > 1024)
-		{
-			return 0;
-		}
-	}
-
-	return 1;
-}
-
-void BigFoot::getResult(int* matrix)
-{
-	memcpy(matrix, result, 4 * sizeof(int));
-}
-
-void BigFoot::Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int girl_shoes)
-{
-
-
-	//需要用加速度过滤伪触地,如果期间是小于0.5g的则视为伪触地,过滤掉
-	//station_acc 判断方法
-
-	if (left_zupt && last_left_zupt == 0 && !station_acc(left_max_acc, left_min_acc))
-	//if (left_zupt && last_left_zupt == 0 )
-	{
-		result[0] = 1;
-		std::cout << "左脚踩了" << std::endl;
-	}
-	else
-	{
-		result[0] = 0;
-	}
-
-	if (right_zupt && last_right_zupt == 0 && !station_acc(right_max_acc, right_min_acc))
-	{
-		result[1] = 1;
-		std::cout << "右脚踩了" << std::endl;
-	}
-	else
-	{
-		result[1] = 0;
-	}
-	
-
-	last_left_zupt = left_zupt;
-
-	last_right_zupt = right_zupt;
-
-
-	if (left_zupt)
-	{
-		memcpy(left_min_acc, left_acc, 3 * sizeof(int));
-
-		memcpy(left_max_acc, left_acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (left_min_acc[i] > left_acc[i])
-			{
-				left_min_acc[i] = left_acc[i];
-			}
-
-			if (left_max_acc[i] < left_acc[i])
-			{
-				left_max_acc[i] = left_acc[i];
-			}
-		}
-	}
-
-	if (right_zupt)
-	{
-		memcpy(right_min_acc, right_acc, 3 * sizeof(int));
-
-		memcpy(right_max_acc, right_acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (right_min_acc[i] > right_acc[i])
-			{
-				right_min_acc[i] = right_acc[i];
-			}
-
-			if (right_max_acc[i] < right_acc[i])
-			{
-				right_max_acc[i] = right_acc[i];
-			}
-		}
-	}
-
-
-}

+ 0 - 39
RunGame/SDK/shoes_sdk/BigFoot.h

@@ -1,39 +0,0 @@
-#pragma once
-#ifndef _BigFoot_H_
-#define _BigFoot_H_
-
-class BigFoot {
-public:
-
-	BigFoot();
-
-	void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-		int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-		int jump, int down, int girl_shoes);
-
-
-	void getResult(int* dec);
-
-	int station_acc(int* max_acc, int* min_acc);
-
-
-private:
-
-	int result[4];
-
-	int left_min_acc[3];
-
-	int left_max_acc[3];
-	
-	int right_min_acc[3];
-
-	int right_max_acc[3];
-
-	int last_left_zupt;
-
-	int last_right_zupt;
-
-};
-
-
-#endif

+ 0 - 811
RunGame/SDK/shoes_sdk/DanceFoot.cpp

@@ -1,811 +0,0 @@
-#include "DanceFoot.h"
-
-/*
-* 初始化脚步的数据
-*/
-DanceFoot::DanceFoot(int LEFT_OR_RIGHT)
-{
-	left_or_right = LEFT_OR_RIGHT;
-
-	foot_rssi = 0;
-	foot_zupt = 1;
-
-	rssi_zupt = 1;
-	
-	max_rssi = 0;
-	min_rssi = 100;
-
-	memset(attitude, 0, 3 * sizeof(float));
-	memset(globalPos, 0, 3 * sizeof(float));
-	memset(offsetPos, 0, 3 * sizeof(float));
-	memset(last_pos_g, 0, 2 * sizeof(float));
-	memset(pos, 0, 2 * sizeof(float));
-
-	last_pos[0] = 0;  last_pos[1] = 0;
-
-	last_zupt = 1;
-
-	danceTraj[0] = 0; danceTraj[1] = 0;
-
-	rotate_err = 0;
-
-	rotateCor[0] = 1.0; rotateCor[1] = 0.0; rotateCor[2] = 0.0; rotateCor[3] = 1.0;
-
-	zupt_count = 1;
-
-	pos_index = -1;
-}
-
-/*
-* 设置脚的姿态,当前位置,鞋子上来的位置偏移量, rssi, zupt变量
-*/
-
-int DanceFoot::setAttitude(float  att[3])
-{
-	memcpy(attitude, att, 3 * sizeof(float));
-
-	return 0;
-}
-
-int DanceFoot::setPosGlobal(float pos[3])
-{
-	memcpy(globalPos, pos, 3 * sizeof(float));
-
-	return 0;
-}
-
-int DanceFoot::setPosOffset(float pos[3])
-{
-	memcpy(offsetPos, pos, 3 * sizeof(float));
-
-	return 0;
-}
-
-int DanceFoot::setFootZupt(int zupt)
-{
-	foot_zupt = zupt;
-
-	return 0;
-}
-
-int DanceFoot::setFootRssi(int rssi)
-{
-	foot_rssi = rssi;
-	
-	return 0;
-}
-
-int DanceFoot::setMaxRssi(int rssi)
-{
-	max_rssi = rssi;
-
-	return 0;
-}
-
-int DanceFoot::setMinRssi(int rssi)
-{
-	min_rssi = rssi;
-	
-	return 0;
-}
-
-/*
-*  通过判断rssi的变化范围来确定是否没有位移,
-*  原地踏步返回0 ,有明显变化的返回1
-*/
-int DanceFoot::isMoveRssi(int rssi, int zupt)
-{
-	int result = 1;
-
-	if (zupt == 0)
-	{
-		if (rssi > max_rssi)
-		{
-			setMaxRssi(rssi);
-		}
-
-		if (rssi < min_rssi)
-		{
-			setMinRssi(rssi);
-		}
-	}
-	else
-	{
-		if (rssi_zupt == 0)
-		{
-			if (max_rssi - min_rssi < 3)
-			{
-				result = 0;
-			}
-		}
-
-		setMaxRssi(0);
-		setMinRssi(100);
-	}
-	
-	rssi_zupt = zupt;
-
-	return result;
-}
-/*
-* 处理全局位置的边界问题,全局位置应为40cmX40cm区域
-*/
-int DanceFoot::posBoundary(float pos[3])
-{
-	float posLength = sqrt(pos[0] * pos[0] + pos[1] * pos[1]);
-
-	if (posLength > 0.25)
-	{
-		pos[0] = pos[0] / posLength * 0.25;
-		pos[1] = pos[1] / posLength * 0.25;
-	}
-
-	return 0;
-}
-
-/*
-* 通过角度来判断跳舞毯的方向
-* 
-*/
-int DanceFoot::getGameDiretion(float *pos)
-{
-	float x = pos[0] ;
-	float y = pos[1] ;
-
-	if (left_or_right == LEFT_FOOT)
-	{
-		std::cout << "left_foot ";
-	}
-	else
-	{
-		std::cout << "right_foot ";
-	}
-
-	if((left_or_right == LEFT_FOOT&& sqrt((x+0.15) * (x+0.15) + y * y) < 0.1)
-		|| (left_or_right == RIGHT_FOOT && sqrt((x - 0.15) * (x - 0.15) + y * y) < 0.1))
-	{
-		if (left_or_right == LEFT_FOOT)
-		{
-			pos[0] = -0.5f;
-		}
-		else
-		{
-			pos[0] = 0.5f;
-		}
-		pos[1] = 0.0f;
-
-		std::cout << "danceGame result: zeros point. " << std::endl;
-		return MOTION_STEP;
-	}
-
-	float angle = atan2(y, x);
-
-
-	if (angle > 0.0f)
-	{
-		if (angle < 1.5708)
-		{
-			std::cout << "danceGame result: right up. " << std::endl;
-			return MOTION_RIGHT_UP;
-		}
-		else
-		{
-			std::cout << "danceGame result: left up. " << std::endl;
-			return MOTION_LEFT_UP;
-		}
-	}
-	else
-	{
-		if (angle > -1.5708)
-		{
-			std::cout << "danceGame result: right down. " << std::endl;
-			return MOTION_RIGHT_DOWN;
-		}
-		else
-		{
-			std::cout << "danceGame result: left down. " << std::endl;
-			return MOTION_LEFT_DOWN;
-		}
-	}
-
-	return MOTION_STEP;
-}
-
-
-
-
-/*
-* 计算鞋子的全局位置
-*/
-
-int DanceFoot::calGlobalPos(float pos_g[3], int rssi, int zupt, int press, int* acc)
-{
-
-
-	float pos_zero[2] = { 0, 0 };
-
-	float pos_offset[2] = {0, 0};
-
-	float pos_g_offset[2] = { 0,0 };
-
-	pos_g_offset[0] = pos_g[0] - last_pos_g[0];
-	pos_g_offset[1] = pos_g[1] - last_pos_g[1];
-
-	if (zupt == 1)
-	{
-		if (last_zupt == 1)
-		{
-			pos_g_offset[0] = 0;
-			pos_g_offset[1] = 0;
-		}
-	}//略去惯导的补偿项,这样是避免补偿过大,导致跳舞的轨迹有拖尾情况
-
-	last_pos_g[0] = pos_g[0];
-	last_pos_g[1] = pos_g[1];
-
-	pos[0] += pos_g_offset[0];
-	pos[1] += pos_g_offset[1]; 
-
-
-	pos_offset[0] = pos[0] - last_pos[0];
-	pos_offset[1] = pos[1] - last_pos[1];
-
-	/*
-	if (fabsf(pos_offset[0]) > 10 || fabsf(pos_offset[1]) > 10)
-	{
-		std::cout << "dancegame receive unnormal pos_offset: " << pos_offset[0] << " " << pos_offset[1] << std::endl;
-		pos_offset[0] = 0; pos_offset[1] = 0;
-	}
-	*/
-
-	if (last_zupt == 1 && zupt == 1)
-	{
-		data.clear();
-		
-	}
-	if (zupt == 0 || (zupt == 1 && last_zupt == 0))
-	{
-		posData pos_data;
-		pos_data.pos_x = rotateCor[0] * (danceTraj[0] + pos_offset[0]) + rotateCor[1] * (danceTraj[1] + pos_offset[1]);
-		pos_data.pos_y = rotateCor[2] * (danceTraj[0] + pos_offset[0]) + rotateCor[3] * (danceTraj[1] + pos_offset[1]);
-
-		pos_data.rssi = rssi;
-
-		data.push_back(pos_data);
-	}
-
-	if (zupt == 1 && rssi < DANCEGAME_MIN_RSSI)
-	{
-		setLastPos(pos);
-
-		setDanceTraj(pos_zero);
-	}
-
-
-
-	if (zupt == 1 && last_zupt == 0)
-	{
-		/*
-		* 检测rssi的信号变化,为直线特征做准备
-		*/
-		int rssi_min = data[0].rssi;
-		int rssi_max = data[0].rssi;
-
-		int rssi_min_index = 0;
-		int rssi_max_index = 0;
-
-		float pos_x_min = data[0].pos_x;
-		float pos_x_max = data[0].pos_x;
-
-		float pos_y_min = data[0].pos_y;
-		float pos_y_max = data[0].pos_y;
-
-		int len = data.size();
-
-		for (int i = 0; i < data.size(); i++)
-		{
-			if (data[i].rssi < rssi_min)
-			{
-				rssi_min = data[i].rssi;
-				rssi_min_index = i;
-			}
-
-			if (data[i].rssi >= rssi_max)
-			{
-				rssi_max = data[i].rssi;
-
-				rssi_max_index = i;
-			}
-
-			if (data[i].pos_x > pos_x_max)
-			{
-				pos_x_max = data[i].pos_x;
-			}
-
-			if (data[i].pos_x < pos_x_min)
-			{
-				pos_x_min = data[i].pos_x;
-			}
-
-			if (data[i].pos_y > pos_y_max)
-			{
-				pos_y_max = data[i].pos_y;
-			}
-
-			if (data[i].pos_y < pos_y_min)
-			{
-				pos_y_min = data[i].pos_y;
-			}
-		}
-
-		if (data.size() > 5)
-		{
-			int rssiSignal = rssiFeature(data);
-
-			switch(rssiSignal)
-			{
-				case 1:
-
-					break;
-				case 2://回到原点
-					if(left_or_right == LEFT_FOOT)
-						danceTraj[0] = -0.15; 
-					else
-						danceTraj[0] = 0.15;
-
-					danceTraj[1] = 0.0;
-
-					pos_offset[0] = 0.0; pos_offset[1] = 0.0;
-					break;
-
-				case 0:
-
-					if (fabsf(data[0].pos_y - data[len - 1].pos_y) > 0.3&& fabsf(pos_x_max - pos_x_min) < 0.2)
-					{
-						/////////////////检测到有跨越象限的情况,左脚当然会经过y = 0的时候, 而x = 0.1则为一个经验值
-
-						std::cout << "detect pass special point" << std::endl;
-
-						float special_offset[2] = { 0, 0 };
-
-						float mid_x = 0.5 * (data[0].pos_x + data[len - 1].pos_x);
-
-						float mid_y = 0.5 * (data[0].pos_y + data[len - 1].pos_y);
-
-
-						if (pos_x_max - pos_x_min < 0.2)
-						{
-							if (left_or_right == LEFT_FOOT)
-							{
-								special_offset[0] = -0.2 - mid_x;
-							}
-							else
-							{
-								special_offset[0] = 0.2 - mid_x;
-							}
-
-						}
-
-						special_offset[1] = -mid_y;
-
-
-						pos_offset[0] = pos_offset[0] + special_offset[0];
-
-						pos_offset[1] = pos_offset[1] + special_offset[1];
-
-					}
-					/**/
-					//检测到横移的情况
-					else if (fabs(data[0].pos_x - data[len - 1].pos_x) > 0.3)
-					{
-						std::cout << "detected horizontal line by pos_x" << std::endl;
-
-						float special_offset[2] = { 0,0 };
-
-						float mid_x = 0.5 * (data[0].pos_x + data[len - 1].pos_x);
-
-						float mid_y = 0.5 * (data[0].pos_y + data[len - 1].pos_y);
-
-						if (pos_y_max - pos_y_min < 0.15)
-						{
-							if (left_or_right == LEFT_FOOT)
-							{
-								special_offset[0] = -0.15 - mid_x;
-
-							}
-							else
-							{
-								special_offset[0] = 0.15 - mid_x;
-							}
-
-							if (data[0].pos_y > 0)
-							{
-								special_offset[1] = 0.2 - mid_y;
-							}
-							else
-							{
-								special_offset[1] = -0.2 - mid_y;
-							}
-
-							std::cout << "debug :" << special_offset[0] << " " << special_offset[1] << std::endl;
-							pos_offset[0] = pos_offset[0] + special_offset[0];
-
-							pos_offset[1] = pos_offset[1] + special_offset[1];
-						}
-						/*
-						else
-						{
-							special_offset[0] = -mid_x;
-
-							if (rssi_min <= 35 && data[0].rssi - rssi_min > 10 && data[len - 1].rssi - rssi_min > 10)
-							{
-								special_offset[1] = -mid_y;
-							}
-
-							pos_offset[0] = pos_offset[0] + special_offset[0];
-
-							pos_offset[1] = pos_offset[1] + special_offset[1];
-
-							std::cout << "debug2 :" << special_offset[0] << " " << special_offset[1] << std::endl;
-
-						}
-						*/
-
-					}
-
-
-					break;
-				default:
-						break;
-		
-	
-			}
-
-		}
-		
-		if ((sqrt(pos_offset[0] * pos_offset[0] + pos_offset[1] * pos_offset[1]) < 0.1))
-		{
-			pos_offset[0] = 0; pos_offset[1] = 0;
-
-			if (acc_status == 0) 
-			{
-				std::cout << "appear error command on zero_vel status (dance__foot) " << endl;
-			}
-		}
-
-		danceTraj[0] = danceTraj[0] + pos_offset[0];
-		danceTraj[1] = danceTraj[1] + pos_offset[1];
-
-		
-		if (rssi < DANCEGAME_MIN_RSSI)
-		{
-			setDanceTraj(pos_zero);
-		}
-
-		setLastPos(pos);
-
-		pos_offset[0] = 0.0; pos_offset[1] = 0.0;
-
-		float dancePos[2];
-
-		dancePos[0] = rotateCor[0] * danceTraj[0] + rotateCor[1] * danceTraj[1];
-		dancePos[1] = rotateCor[2] * danceTraj[0] + rotateCor[3] * danceTraj[1];
-
-		pos_index = getGameDiretion(dancePos);
-	}
-
-	float dancePos[2];
-
-	dancePos[0] = rotateCor[0] * (danceTraj[0] + pos_offset[0]) + rotateCor[1] * (danceTraj[1] + pos_offset[1]);
-	dancePos[1] = rotateCor[2] * (danceTraj[0] + pos_offset[0]) + rotateCor[3] * (danceTraj[1] + pos_offset[1]);
-
-
-	setLastZupt(zupt);
-
-	gamePos[0] = dancePos[0];
-	gamePos[1] = dancePos[1];
-	gamePos[2] = pos_g[2];
-
-	if (zupt == 1)
-	{
-		zupt_count = 3;
-	}
-	else
-	{
-		zupt_count--;
-	}
-
-	if (zupt_count <= 0)
-	{
-		pos_index = -1;
-	}
-
-	acc_status = getAccStatus(zupt, acc, acc_max, acc_min);
-
-	return pos_index;
-
-}
-
-/*
-* 打印pos和RSSI的
-*/
-
-void DanceFoot::printPosData(vector<posData> data)
-{
-	for (int i = 0; i < data.size(); i++)
-	{
-		std::cout << data[i].pos_x << " " <<data[i].pos_y << " "<< data[i].rssi << std::endl;
-	}
-}
-
-/*
-* 通过位移以及RSSI来判断是否为原地踏步
-*/
-
-int DanceFoot::isMove(vector<posData> data)
-{
-	int n = data.size();
-
-	if (n <= 1)
-	{
-		return 0;
-	}
-
-	int rssi_left = data[0].rssi;
-	int rssi_right = data[(n-1)].rssi;
-
-	float x = data[0].pos_x - data[(n-1)].pos_x;
-	float y = data[0].pos_y - data[(n-1)].pos_y;
-
-	int rssi_min = rssi_left;
-
-	for (int i = 0; i < n; i++)
-	{
-		if (rssi_min > data[i].rssi)
-			rssi_min = data[i].rssi;
-	}
-		
-	if (abs(rssi_right - rssi_left) > 10 && rssi_min > 40
-		&& fabsf(x) > 0.1 )
-	{
-		std::cout << "检测到左右横移" << std::endl;
-
-		if (x < 0)
-			return -1;
-		else
-			return 1;
-	}
-
-	return 0;
-}
-
-/*
-* 设置上一次的last_pos
-*/
-void DanceFoot::setLastPos(float* lastPos)
-{
-	last_pos[0] = lastPos[0];
-	last_pos[1] = lastPos[1];
-}
-
-
-/*
-* 设置上一次的zupt
-*/
-
-void DanceFoot::setLastZupt(int lastZupt)
-{
-	last_zupt = lastZupt;
-}
-
-/*
-* 设置跳舞轨迹
-*/
-
-void DanceFoot::setDanceTraj(float* traj)
-{
-	if(left_or_right == LEFT_FOOT)
-		danceTraj[0] = traj[0] - 0.15;
-	else
-		danceTraj[0] = traj[0] + 0.15;
-
-	danceTraj[1] = traj[1];
-}
-
-/*
-* 计算斜率
-*/
-
-float DanceFoot::calSlope(vector<posData> data)
-{
-	int i = 0;
-	int len = data.size();
-
-	float x2_sum = 0, x_sum = 0, xy_sum = 0, y_sum = 0;
-
-	float slope = 0.0f;
-
-	for (i = 0; i < len; i++)
-	{
-		x2_sum += (data[i].pos_x * data[i].pos_x);
-
-		x_sum += (data[i].pos_x);
-		
-		y_sum += (data[i].pos_y);
-
-		xy_sum += (data[i].pos_x * data[i].pos_y);
-	}
-
-	//b = (x2_sum * y_sum - x_sum * xy_sum) / ((len * x2_sum) - x_sum * x_sum);
-
-	slope = (len * xy_sum - x_sum * y_sum) / (len * x2_sum - x_sum * x_sum);
-
-	std::cout << len << " " << x2_sum << " " << x_sum << " " << y_sum << " " << xy_sum << " " << atan(slope) << std::endl;
-
-	return slope;
-
-}
-
-float DanceFoot::calCor(vector<posData> data)
-{
-	//printPosData(data);
-
-	float start_x = data[0].pos_x;
-	float start_y = data[0].pos_y;
-
-	int len = data.size();
-
-	float end_x = data[len - 1].pos_x;
-	float end_y = data[len - 1].pos_y;
-
-	float a = start_y - end_y;
-	float b = -(start_x - end_x);
-
-	float c = start_x * end_y - start_y * end_x;
-
-	float d = 1 / sqrt(a * a + b * b);
-
-	float  distance = 0;
-	
-	for (int i = 0; i < len - 1; i++)
-	{
-		float diatance_tmp = (a * data[i].pos_x + b * data[i].pos_y + c) * d;
-
-		if (fabsf(diatance_tmp) > fabsf(distance))
-		{
-			distance = diatance_tmp;
-		}
-	}
-
-	return distance;
-}
-
-
-float DanceFoot::getGamePos(int index)
-{
-	if (index < 0 || index > 2)
-		return -1;
-	return gamePos[index];
-}
-
-int DanceFoot::rssiFeature(vector<posData> data)
-{
-	//printPosData(data);
-
-	int startRssi = data[0].rssi;
-	int dataLength = data.size();
-
-	int endRssi = data[dataLength - 1].rssi;
-
-	int minDistance = 99;
-
-	int minIndex = 0;//默认为从原点触发
-
-	int i = 0;
-
-	int min_rssi = data[0].rssi;
-
-	while (i < dataLength)
-	{
-		if (min_rssi > data[i].rssi)
-		{
-			min_rssi = data[i].rssi;
-
-			minIndex = i;
-		}
-
-		i++;
-	}
-
-	i = 0;
-
-	int maybeStraight = 0;
-
-	if (min_rssi < 25)
-	{
-		min_rssi = min_rssi + 2;
-	}
-
-	while (i < dataLength)
-	{
-		if (min_rssi >= data[i].rssi)
-		{
-			if (fabs(data[dataLength - 1].pos_y - data[i].pos_y) > 0.1 && fabs(data[0].pos_y - data[i].pos_y) > 0.1)
-			{
-				maybeStraight = 1;
-				break;
-			}
-		}
-		i++;
-	}
-
-	float length_tmp = sqrt((data[0].pos_y - data[dataLength - 1].pos_y) * (data[0].pos_y - data[dataLength - 1].pos_y)
-		+ (data[0].pos_x - data[dataLength - 1].pos_x) * (data[0].pos_x - data[dataLength - 1].pos_x));
-
-	if (endRssi < 28)
-	{
-		return 2;
-	}
-
-	if ((maybeStraight)|| (fabsf(data[0].pos_y - data[dataLength - 1].pos_y)>0.4 && fabsf(data[0].pos_x - data[dataLength - 1].pos_x) < 0.1))
-	{
-		std::cout << "Maybe straight line" << std::endl;
-		return 0;
-	}
-
-	if (startRssi < 28 && endRssi - startRssi > 10 && length_tmp > 0.08)
-	{
-		std::cout << "function debug: zero start!!!!!" << std::endl;
-		return 1; //标志为从原点出发
-	}
-
-	if ( endRssi < 28 && startRssi - endRssi > 10 && length_tmp > 0.08)
-	{
-		std::cout << "function debug: zero end!!!!!" << std::endl;
-		return 2; //标志回到原点
-	}
-
-
-	std::cout << "startRssi: " << startRssi << " endRssi: " << endRssi << " min_rssi: " << min_rssi << " length_tmp: " << length_tmp <<std::endl;
-	return 0; //则是标志为其他的特征
-}
-
-int DanceFoot::getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc)
-{
-	/*
-	* 在游戏测试的时候发现有左右乱飞的情况,现在以及乱跳的情况,现在用加速度过滤这一个情况
-	* 尽量不在嵌入式上修改
-	*/
-	if (zupt)
-	{
-		memcpy(max_acc, acc, 3 * sizeof(int));
-		memcpy(min_acc, acc, 3 * sizeof(int));
-	}
-	else
-	{
-		for (int i = 0; i < 3; i++)
-		{
-			if (max_acc[i] < acc[i])
-			{
-				max_acc[i] = acc[i];
-			}
-
-			if (min_acc[i] > acc[i])
-			{
-				min_acc[i] = acc[i];
-			}
-		}
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		if (max_acc[i] - min_acc[i] > 1024)
-		{
-			return 1;
-		}
-	}
-
-	return 0;
-}
-
-

+ 0 - 107
RunGame/SDK/shoes_sdk/DanceFoot.h

@@ -1,107 +0,0 @@
-
-#ifndef __dance_foot_h__
-#define __dance_foot_h__
-
-
-#include "pub.h"
-
-class DanceFoot
-{
-	public:
-		DanceFoot(int LEFT_OR_RIGHT);
-		DanceFoot() {};//Ìí¼ÓÒ»¸öȱʡ¹¹Ô캯Êý
-
-		int setPosOffset(float Pos[3]);
-		int setPosGlobal(float Pos[3]);
-		int setAttitude(float att[3]);
-
-		int setFootZupt(int zupt);
-		int setFootRssi(int rssi);
-
-		int setMaxRssi(int rssi);
-		int setMinRssi(int rssi);
-
-		int isMoveRssi(int rssi, int zupt);
-
-		int calGlobalPos(float pos[3], int rssi, int zupt, int press);
-
-		int posBoundary(float pos[3]);
-
-		int isGlobalZero(float pos[3], float pos_offset[3], int rssi);
-
-		int getDirection(float pos[3], float pos_offset[3], int rssi);
-
-		int getDirectionCorner(float pos[3], float pos_offset[3]);
-
-		int getDirectionLine(float pos[3], float pos_offset[3]);
-
-		int getGameDiretion(float pos[3]);
-
-		void printPosData(vector<posData> data);
-
-		int isMove(vector<posData> data);
-
-		void setLastPos(float* lastPos);
-
-		void setLastZupt(int lastZupt);
-
-		void setDanceTraj(float* traj);
-
-		float calSlope(vector<posData> data);
-
-		float getGamePos(int index);
-
-		float calCor(vector<posData> data);
-
-		int rssiFeature(vector<posData> data);
-
-		int calGlobalPos(float pos_g[3], int rssi, int zupt, int press, int* acc);
-
-		int getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc);
-
-	private:
-
-
-		float gamePos[3];
-
-		float last_pos[2];
-
-		int last_zupt;
-
-		float danceTraj[2];
-
-		float rotate_err;
-
-		float rotateCor[4];
-
-		float last_pos_g[2] = { 0, 0 };
-
-		float pos[2] = { 0, 0 };
-
-		vector<posData> data;
-
-		int left_or_right;
-
-		int foot_rssi;
-		int foot_zupt;
-
-		int rssi_zupt;
-
-		int max_rssi;
-		int min_rssi;
-
-		float attitude[3];
-		float globalPos[3];
-		float offsetPos[3];
-
-		int pos_index;
-		int zupt_count;
-
-		int acc_status;
-
-		int acc_max[3];
-
-		int acc_min[3];
-};
-
-#endif

+ 0 - 265
RunGame/SDK/shoes_sdk/DanceGame.cpp

@@ -1,265 +0,0 @@
-
-#include "DanceGame.h"
-
-/*
-* 初始化DanceGame对象,分左右脚来判断
-*/
-
-DanceGame::DanceGame()
-{
-	leftFoot = DanceFoot(LEFT_FOOT);
-
-	rightFoot = DanceFoot(RIGHT_FOOT);
-
-	memset(result, -1, 4 * sizeof(int));
-
-	left_result = -1;
-	right_result = -1;
-
-	for (int i = 0; i < 3; i++)
-		for(int j = 0; j < 15; j++)
-	{
-			left_acc_buff[i][j] = 0;
-			right_acc_buff[i][j] = 0;
-	}
-
-}
-
-/*
-* DanceGame主接口,承接Game类的主要调用
-*/
-
-void  DanceGame::Process(int* right_pos, int* right_att, int *right_acc,int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int rssi)
-{
-	static int left_zupt_count = 0;
-	static int right_zupt_count = 0;
-	static float leftRotate[4] = { 1.0, 0.0, 0.0, 1.0 };
-	static float rightRotate[4] = { 1.0, 0.0, 0.0, 1.0 };
-
-	float left_acc_f[3], right_acc_f[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		left_acc_f[i] = left_acc[i] / 2048.f;
-		right_acc_f[i] = right_acc[i] / 2048.f;
-
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		for (int j = 0; j < 14; j++)
-		{
-			left_acc_buff[i][j] = left_acc_buff[i][j + 1];
-			right_acc_buff[i][j] = right_acc_buff[i][j + 1];
-		}
-	}
-
-	for (int i = 0; i < 3; i++)
-	{
-		left_acc_buff[i][14] = left_acc_f[i];
-		right_acc_buff[i][14] = right_acc_f[i];
-	}
-
-	int left_zupt_acc =  isBalance(left_acc_buff);
-	int right_zupt_acc = isBalance(right_acc_buff);
-
-
-	if (left_zupt_acc && rssi < DANCEGAME_MIN_RSSI)
-	{
-		left_zupt = 1;
-	}
-
-	if (right_zupt_acc && rssi < DANCEGAME_MIN_RSSI)
-	{
-		right_zupt = 1;
-	}
-
-
-	if ((left_zupt || left_zupt_acc) && rssi < DANCEGAME_MIN_RSSI)
-	{
-		left_zupt_count++;
-	}
-	else
-	{
-		left_zupt_count = 0;
-	}
-
-	if ((right_zupt || right_zupt_acc) && rssi < DANCEGAME_MIN_RSSI)
-	{
-		//rotateTrajRight.ResetHeading(right_att[0]);
-		right_zupt_count++;
-	}
-	else
-	{
-		right_zupt_count = 0;
-	}
-
-	if (rssi > DANCEGAME_MIN_RSSI)
-	{
-		left_zupt_count = 0;
-		right_zupt_count = 0;
-	}
-
-	if (left_zupt_count > 100 && right_zupt_count > 100)
-	{
-		float leftTheta = float(left_att[0]) * 0.0001f;
-		float rightTheta = float(right_att[0]) * 0.0001f;
-
-		leftRotate[0] = cos(leftTheta); leftRotate[1] = sin(leftTheta);
-		leftRotate[2] = -sin(leftTheta); leftRotate[3] = cos(leftTheta);
-
-		rightRotate[0] = cos(rightTheta);  rightRotate[1] = sin(rightTheta);
-		rightRotate[2] = -sin(rightTheta); rightRotate[3] = cos(rightTheta);
-
-		std::cout << "matrix has inited!" << std::endl;
-
-		left_zupt_count = 0;
-		right_zupt_count = 0;
-
-
-	}
-
-	float left_pos_g[3];
-
-	float pos_tmp[2];
-
-	float right_pos_g[3];
-
-	pos_tmp[0] = leftRotate[0] * left_pos[0] * 0.01 + leftRotate[1] * left_pos[1] * 0.01;
-	pos_tmp[1] = leftRotate[2] * left_pos[0] * 0.01 + leftRotate[3] * left_pos[1] * 0.01;
-	
-	left_pos_g[0] = 0.9848 * pos_tmp[0] - 0.1736 * pos_tmp[1];
-	left_pos_g[1] = 0.1736 * pos_tmp[0] + 0.9848 * pos_tmp[1];
-
-	left_pos_g[2] = left_pos[2] * 0.01;
-
-	pos_tmp[0] = rightRotate[0] * right_pos[0] * 0.01 + rightRotate[1] * right_pos[1] * 0.01f;
-	pos_tmp[1] = rightRotate[2] * right_pos[0] * 0.01 + rightRotate[3] * right_pos[1] * 0.01f;
-
-	right_pos_g[0] = 0.9848 * pos_tmp[0] + 0.1736 * pos_tmp[1];
-	right_pos_g[1] = -0.1736 * pos_tmp[0] + 0.9848 * pos_tmp[1];
-
-	right_pos_g[2] = right_pos[2] * 0.01;
-
-	
-
-	int left_result_tmp, right_result_tmp;
-
-	left_result_tmp = leftFoot.calGlobalPos(left_pos_g, rssi, left_zupt, left_press, left_acc);
-
-
-	right_result_tmp = rightFoot.calGlobalPos(right_pos_g, rssi, right_zupt, right_press, right_acc);
-
-
-
-	if (left_result != left_result_tmp && left_result_tmp != -1)
-	{
-		result[0] = left_result_tmp;
-	}
-	else
-	{
-		result[0] = -1;
-	}
-	
-	if(left_result != -1 && left_result_tmp == -1)
-	{
-		result[0] = left_result | MOTION_CANCEL;
-	}
-	
-	left_result = left_result_tmp;
-
-
-	if (right_result != right_result_tmp && right_result_tmp != -1)
-	{
-		result[1] = right_result_tmp;
-	}
-	else
-	{
-		result[1] = -1;
-	}
-	
-	if (right_result != -1 && right_result_tmp == -1)
-	{
-		result[1] = right_result | MOTION_CANCEL;
-	}
-	
-	right_result = right_result_tmp;
-
-
-	/*
-	result[0] = leftFoot.calGlobalPos(left_pos_g, rssi, left_zupt, left_press);
-	result[1] = rightFoot.calGlobalPos(right_pos_g, rssi, right_zupt, right_press);
-	*/
-	
-}
-
-/*
-* 通过三轴加速度判断是否稳定
-*/
-
-int DanceGame::isBalance(float acc_buff[3][15])
-{
-	float max_val[3];
-	float min_val[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		max_val[i] = acc_buff[i][0];
-		min_val[i] = acc_buff[i][0];
-	}
-	for (int i = 0; i < 3; i++)
-	{
-		for (int j = 0; j < 15; j++)
-		{
-			if (acc_buff[i][j] > max_val[i])
-			{
-				max_val[i] = acc_buff[i][j];
-			}
-
-			if (acc_buff[i][j] < min_val[i])
-			{
-				min_val[i] = acc_buff[i][j];
-			}
-		}
-	}
-
-	if (max_val[0] - min_val[0] < 0.05f && max_val[1] - min_val[1] < 0.05f && max_val[2] - min_val[2] < 0.05f)
-	{	
-		return 1;
-		/*
-		if (fabsf(min_val[0]) < 0.2f && fabsf(max_val[0]) < 0.2f
-			&& fabsf(min_val[1]) < 0.2f && fabsf(max_val[1]) < 0.2f
-			&& min_val[2] > 0.94f && max_val[2] < 1.6f)
-		{
-			std::cout << "test" << endl;
-			return 1;
-		}
-		*/
-	}
-
-	return 0;
-}
-
-/*
-* 获取跳舞游戏结果
-*/
-
-void DanceGame::getResult(int *matrix)
-{
-	memcpy(matrix, result, 4 * sizeof(int));
-}
-
-
-float DanceGame::getGamePos(int left_or_right, int index)
-{
-	if (index < 0 || index > 2)
-		return -1;
-
-	if (left_or_right == LEFT_FOOT)
-		return leftFoot.getGamePos(index);
-	else
-		return rightFoot.getGamePos(index);
-}
-

+ 0 - 39
RunGame/SDK/shoes_sdk/DanceGame.h

@@ -1,39 +0,0 @@
-#pragma once
-#ifndef __dance_game_h__
-#define __dance_game_h__
-
-#include "DanceFoot.h"
-
-class DanceGame {
-
-	public :
-		DanceGame();
-
-		//void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos, int* left_att, int left_zupt, int jump, int down, int rssi);
-		void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-			int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-			int jump, int down, int rssi);
-
-		void getResult(int *matrix);
-
-		float getGamePos(int left_or_right, int index);
-
-		int isBalance(float acc_buff[3][15]);
-
-	private:
-
-		DanceFoot leftFoot;
-		DanceFoot rightFoot;
-
-		int result[4];
-
-		int left_result;
-		int right_result;
-
-		float left_acc_buff[3][15];
-		float right_acc_buff[3][15];
-
-
-};
-
-#endif

+ 0 - 129
RunGame/SDK/shoes_sdk/FootStep.cpp

@@ -1,129 +0,0 @@
-#include "FootStep.h"
-
-FootStep::FootStep()
-{
-	/*
-		初始化均为0
-	*/
-	stepStatus = 0;
-	stepFreq = 0;
-	stepTag = 0;
-	zuptCount = 0;
-
-	lastZupt = 1;
-
-	leaveFloorTime1 = 0;
-	leaveFloorTime2 = 0;
-
-	leaveTimeStatus = 1;
-
-	catchFloorTime = 0;
-
-	localTime = 0;
-
-	last_time_stamp = 0;
-
-	stepCount = 0;
-
-	memset(last_pos, 0, 3 * sizeof(int));
-}
-
-void FootStep::stepCal(int timeStamp, int pos[3], int zupt, int girl_shoes)
-{
-	//计算累计的时间
-	static int stepFreqBuff[5];
-	static int buffIndex;
-
-	if (zupt)
-	{
-		memcpy(last_pos, pos, 3 * sizeof(int));
-	}
-
-	int pos_tmp[3];
-
-	for (int i = 0; i < 3; i++)
-	{
-		pos_tmp[i] = pos[i] - last_pos[i];
-	}
-
-	int timeDistance;
-	if (timeStamp - last_time_stamp < 0)
-	{
-		timeDistance = 256 + timeStamp - last_time_stamp;
-	}
-	else
-	{
-		timeDistance = timeStamp - last_time_stamp;
-	}
-
-	last_time_stamp = timeStamp;
-
-	localTime += timeDistance;
-
-
-	if (pos_tmp[0] * pos_tmp[0] + pos_tmp[1] * pos_tmp[1] + pos_tmp[2] * pos_tmp[2] > 0)
-	{
-		stepTag = 1;
-	}
-
-
-	if (lastZupt == 0 && zupt == 1 && stepTag == 1 )
-	{
-		
-		int walkTime = 8 * (localTime - leaveFloorTime1);
-
-		// 模块发过来的频率为40ms发一次,所以一秒能发25次,
-		//所以计算步频的话一分钟除以walkTime 再除以一个2
-
-		stepFreq = 60 * 1000 / walkTime;
-
-		if (girl_shoes)
-		{
-			stepFreq *= 2;
-		}
-		
-
-		leaveFloorTime1 = localTime;
-		
-		stepTag = 0;
-
-		stepCount++;
-	}
-
-	lastZupt = zupt;
-	
-	if (zupt == 1)
-		zuptCount++;
-	else
-		zuptCount = 0;
-
-	if (zuptCount > 50)
-	{
-		stepStatus = 0;
-		stepFreq = 0;
-		stepTag = 0;
-	}
-
-}
-
-int FootStep::getStepFreq()
-{
-	return stepFreq;
-}
-
-int FootStep::getStepStatus()
-{
-	if (stepFreq == 0)
-		return 0;
-
-	else if (stepFreq > 130)
-		return 2;
-
-	else
-		return 1;
-}
-
-int FootStep::getStepCount()
-{
-	return stepCount;
-}

+ 0 - 49
RunGame/SDK/shoes_sdk/FootStep.h

@@ -1,49 +0,0 @@
-#pragma once
-#ifndef _FootStep_H
-#define _FootStep_H
-
-#include <iostream>
-
-class FootStep
-{
-public:
-
-	FootStep();
-
-	//void stepCal(int timeStamp, int pos[3], int zupt);
-
-	void stepCal(int timeStamp, int pos[3], int zupt, int girl_shoes);
-
-	int getStepFreq();
-	int getStepStatus();
-
-	int getStepCount();
-
-private:
-
-	int stepStatus;//脚步状态 0 1 2
-	int stepFreq;	//脚步步频 分钟为单位
-	int stepTag;	//计算步数所用
-	int zuptCount;
-	
-	int localTime;
-	int last_time_stamp;
-
-	int leaveFloorTime;
-
-	int leaveFloorTime1;
-	int leaveFloorTime2;
-
-	int leaveTimeStatus;
-
-	int catchFloorTime;
-
-	int lastZupt;
-
-	int stepCount;
-
-	int last_pos[3];
-
-};
-
-#endif

+ 0 - 587
RunGame/SDK/shoes_sdk/Game.cpp

@@ -1,587 +0,0 @@
-#include "Game.h"
-
-Game::Game(int gametype)
-{
-	GameType = gametype;
-
-	rotateTrajLeft = InertialTrajProcess();
-	rotateTrajRight = InertialTrajProcess();
-
-	leftFootStep = FootStep();
-	rightFootStep = FootStep();
-
-	publicmotion = publicMotion();
-
-	rotateMatrix[0] = 1.0f;
-	rotateMatrix[1] = 0.0f;
-	rotateMatrix[2] = 0.0f;
-	rotateMatrix[3] = 1.0f;
-
-	leftStepRate = 0;
-	rightStepRate = 0;
-
-	leftRate = 0;
-	rightRate = 0;
-
-	last_down = 0;
-	last_jump = 0;
-
-	down_count = 0;
-	jump_count = 0;
-
-	last_left_step = 0;
-	last_right_step = 0;
-
-	down_wait = 0;
-	avoid_down_between_jump = 0;
-
-	interaction = Interaction();
-
-	InteractionCMD = -1;
-
-	shoes_down = 0;
-
-	if (GameType == RUNGAME)
-	{
-		rungame = RunGame();
-	}
-	else if (GameType == DANCEGAME)
-	{
-		dancegame = DanceGame();
-	}
-
-	else if (GameType == ORIGINTRAJ)
-	{
-		originTraj = OriginTraj();
-	}
-
-	else if (GameType == H5GAME)
-	{
-		jumpH5game = jumpH5();
-	}
-
-	else if (GameType == MONSTER)
-	{
-		monsterH5 = MonsterH5();
-	}
-
-	else if (GameType == RUINS)
-	{
-		ruinsExplore = RuinsExplore();
-	}
-	else if (GameType == CYCLE)
-	{
-		tricycle = Tricycle();
-	}
-
-	else if (GameType == BIGFOOT)
-	{
-		bigfoot = BigFoot();
-	}
-	
-	else if (GameType == TESTGAME)
-	{
-		testgame = testGame();
-	}
-	
-
-}
-
-int Game::getInteractionCMD()
-{
-	return InteractionCMD;
-}
-
-void Game::processCalorieData(int down, int jump)
-{
-
-	if (down)
-	{
-		down_wait = 20;
-	}
-
-	if (jump)
-	{
-		avoid_down_between_jump = 20;
-	}
-
-	if (avoid_down_between_jump > 0 && h_zupt == 0 && s_zupt == 0)
-	{
-		avoid_down_between_jump = 20;
-	}
-
-	if (avoid_down_between_jump > 0 && down == 1)
-	{
-		avoid_down_between_jump = 20;
-	}
-
-	if (avoid_down_between_jump > 0)
-	{
-		down_wait = 0;
-		down = 0;
-		last_down = 0;
-	}
-
-	if (down_wait > 0)
-	{
-		down = 1;
-
-		down_wait --;
-	}
-
-	if (avoid_down_between_jump)
-	{
-		avoid_down_between_jump--;
-	}
-	
-	if (down == 0 && last_down == 1)
-	{
-		down_count++;
-
-		std::cout << "蹲的次数 : " << down_count << endl;
-	}
-
-	if (last_jump == 0 && jump == 1)
-	{
-		jump_count++;
-		std::cout << "跳的次数 : " << jump_count << endl;
-
-	}
-
-	last_down = down;
-	last_jump = jump;
-}
-
-
-int Game::getGameDownCount()
-{
-	return down_count;
-}
-
-int Game::getGameJumpCount()
-{
-	return jump_count;
-}
-
-int Game::onlineDownEstimate()
-{
-	if (posTimeStamp % 8 != 0)
-	{
-		return 0;
-	}
-
-
-}
-
-void Game::GameProcess(int timeStamp, int* right_pos, int* right_att, int *right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press, 
-	int jump, int down, int rssi, int girl_shoes)
-{
-
-	leftFootStep.stepCal(timeStamp, left_pos, left_zupt, girl_shoes);
-
-	rightFootStep.stepCal(timeStamp, right_pos, right_zupt, girl_shoes);
-	
-	
-	interaction.Process(gameTime, right_pos, right_att, right_acc, right_zupt, right_press,
-		left_pos, left_att, left_acc, left_zupt, left_press,
-		jump, down, rssi);
-
-	InteractionCMD = interaction.get_motion_state();
-
-	processCalorieData(down, jump);
-	
-	
-	if (GameType == RUNGAME)
-	{
-		//跑酷游戏处理函数
-
-	
-		rungame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, rssi);
-
-		//跑酷游戏处理结果获取
-		rungame.getResult(resultMatrix);
-	}
-	else if (GameType == DANCEGAME)
-	{
-		dancegame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, rssi);
-
-		dancegame.getResult(resultMatrix);
-	}
-	else if (GameType == ORIGINTRAJ)
-	{
-		originTraj.Process(right_pos, right_att, right_zupt, left_pos, left_att, left_zupt);
-	}
-
-	else if (GameType == H5GAME)
-	{
-		if (left_zupt)
-		{
-			rotateTrajLeft.ResetHeading(left_att[0]);
-		}
-		rotateTrajLeft.TrajRotate(left_pos);
-
-		if (right_zupt)
-		{
-			rotateTrajRight.ResetHeading(right_att[0]);
-		}
-		rotateTrajRight.TrajRotate(right_pos);
-
-		jumpH5game.Process(right_pos, right_att, right_acc, right_press, right_zupt,
-			left_pos, left_att, left_acc, left_press, left_zupt, jump, timeStamp, rssi);
-		jumpH5game.getResult(resultMatrix);
-	}
-
-	else if (GameType == MONSTER)
-	{
-		monsterH5.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press,
-			jump, down, rssi);
-
-		monsterH5.getResult(resultMatrix);
-	}
-
-	else if (GameType == RUINS)
-	{
-
-		ruinsExplore.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		//跑酷游戏处理结果获取
-		ruinsExplore.getResult(resultMatrix);
-	}
-
-	else if (GameType == CYCLE)
-	{
-
-		if (left_zupt)
-		{
-			rotateTrajLeft.ResetHeading(left_att[0]);
-		}
-		rotateTrajLeft.TrajRotate(left_pos);
-
-
-		if (right_zupt)
-		{
-			rotateTrajRight.ResetHeading(right_att[0]);
-		}
-		rotateTrajRight.TrajRotate(right_pos);
-
-
-		tricycle.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		tricycle.getResult(resultMatrix);
-
-		left_att[0] = resultMatrix[0];
-		resultMatrix[0] = -1;
-		resultMatrix[1] = -1;
-	}
-
-	else if (GameType == BIGFOOT)
-	{
-
-		bigfoot.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		//跑酷游戏处理结果获取
-		bigfoot.getResult(resultMatrix);
-	}
-
-	else if (GameType == TESTGAME)
-	{
-		testgame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-			left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-
-		testgame.getResult(resultMatrix);
-	}
-	
-	/*
-	if (foot_data_file.is_open()&& GameType == DANCEGAME)
-	{
-		foot_data_file << timeStamp << " " << dancegame.getGamePos(LEFT_FOOT, 0) << " " << dancegame.getGamePos(LEFT_FOOT, 1) << " " << left_zupt <<
-			" " << dancegame.getGamePos(RIGHT_FOOT, 0) << " " << dancegame.getGamePos(RIGHT_FOOT, 1) << " " << right_zupt << " " << rssi
-			<< " " << bingo << std::endl;
-
-		bingo = 0;
-	}
-	*/
-	
-}
-
-void Game::RunGameProcess(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-	int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-	int jump, int down, int girl_shoes)
-{
-	rungame.Process(right_pos, right_att, right_acc, right_zupt, right_press,
-		left_pos, left_att, left_acc, left_zupt, left_press, jump, down, girl_shoes);
-}
-
-
-void Game::getGameResult(int* matrix)
-{
-	memcpy(matrix, resultMatrix, 4 * sizeof(int));
-}
-
-int Game::getStepStatus(int left_or_right)
-{
-	if (left_or_right == LEFT_FOOT)
-		return leftFootStep.getStepStatus();
-
-	else if (left_or_right == RIGHT_FOOT)
-		return rightFootStep.getStepStatus();
-
-	else
-		return -1;
-}
-
-int Game::getStepFreq( int left_or_right)
-{
-	if (left_or_right == LEFT_FOOT)
-		return leftFootStep.getStepFreq();
-
-	else if (left_or_right == RIGHT_FOOT)
-		return rightFootStep.getStepFreq();
-
-	else
-		return -1;
-}
-
-
-int Game::getStepCount(int left_or_right)
-{
-	if (left_or_right == LEFT_FOOT)
-		return leftFootStep.getStepCount();
-
-	else if (left_or_right == RIGHT_FOOT)
-		return rightFootStep.getStepCount();
-
-	else
-		return -1;
-}
-
-float Game::getGamePos(int left_or_right, int index)
-{
-	if (index < 0 || index >2)
-		return -1;
-
-	if (GameType == RUNGAME)
-	{
-		return rungame.getGamePos(left_or_right, index);
-	}
-	else if(GameType == DANCEGAME)
-	{
-		return dancegame.getGamePos(left_or_right, index);
-	}
-	else if (GameType == ORIGINTRAJ)
-	{
-		return originTraj.getGamePos(left_or_right, index);
-	}
-	else
-	{
-		return -1;
-	}
-}
-
-string Game::getVersion()
-{
-	return GAME_VERSION;
-}
-
-string Game::getGameDataStr()
-{
-	string data_str_temp = "";
-
-	//先记录右边
-
-	data_str_temp = data_str;
-
-	data_str = "";
-
-	return data_str_temp;
-
-}
-
-void Game::setGameDataStr()
-{
-	if (data_str.size() != 0)
-	{
-		data_str = "";
-	}
-	data_str += (to_string(right_pos_data[0]) + "," + to_string(right_pos_data[1]) + "," + to_string(right_pos_data[2]) + ",");
-	data_str += (to_string(right_att_data[0]) + "," + to_string(right_att_data[1]) + "," + to_string(right_att_data[2]) + ",");
-	data_str += (to_string(right_acc_data[0]) + "," + to_string(right_acc_data[1]) + "," + to_string(right_acc_data[2]) + ",");
-
-	data_str += (to_string(right_front_mag) + "," + to_string(right_back_mag) + "," + to_string(s_zupt) + ",");
-
-	data_str += (to_string(left_pos_data[0]) + "," + to_string(left_pos_data[1]) + "," + to_string(left_pos_data[2]) + ",");
-	data_str += (to_string(left_att_data[0]) + "," + to_string(left_att_data[1]) + "," + to_string(left_att_data[2]) + ",");
-	data_str += (to_string(left_acc_data[0]) + "," + to_string(left_acc_data[1]) + "," + to_string(left_acc_data[2]) + ",");
-
-	data_str += (to_string(left_front_mag) + "," + to_string(left_back_mag) + "," + to_string(h_zupt) + ",");
-
-	data_str += (to_string(shoes_down) + "," + to_string(jump) + "," + to_string(rssi) + "," + to_string(posTimeStamp) + ",");
-
-	data_str += (to_string(right_step) + "," + to_string(left_step) + "," + to_string(down));
-
-}
-
-void Game::getFootAtt(int* left_att, int* right_att)
-{
-	memcpy(right_att, right_att_data, 3 * sizeof(int));
-	memcpy(left_att, left_att_data, 3 * sizeof(int));
-	
-}
-
-
-//解析鞋子的数据
-void Game::GameProcessBuf(uint8_t* buf, int len){
-
-	static int last_game_time;
-
-	right_pos_data[0] = int32_t(buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3] << 0);
-	right_pos_data[1] = int32_t(buf[4] << 24 | buf[5] << 16 | buf[6] << 8 | buf[7] << 0);
-	right_pos_data[2] = int32_t(buf[8] << 24 | buf[9] << 16 | buf[10] << 8 | buf[11] << 0);
-
-	left_pos_data[0] = int32_t(buf[12] << 24 | buf[13] << 16 | buf[14] << 8 | buf[15] << 0);
-	left_pos_data[1] = int32_t(buf[16] << 24 | buf[17] << 16 | buf[18] << 8 | buf[19] << 0);
-	left_pos_data[2] = int32_t(buf[20] << 24 | buf[21] << 16 | buf[22] << 8 | buf[23] << 0);
-
-	right_att_data[0] = int16_t(buf[24] << 8 | buf[25] << 0);
-	right_att_data[1] = int16_t(buf[26] << 8 | buf[27] << 0);
-	right_att_data[2] = int16_t(buf[28] << 8 | buf[29] << 0);
-
-	left_att_data[0] = int16_t(buf[30] << 8 | buf[31] << 0);
-	left_att_data[1] = int16_t(buf[32] << 8 | buf[33] << 0);
-	left_att_data[2] = int16_t(buf[34] << 8 | buf[35] << 0);
-
-	right_acc_data[0] = int16_t(buf[36] << 8 | buf[37] << 0);
-	right_acc_data[1] = int16_t(buf[38] << 8 | buf[39] << 0);
-	right_acc_data[2] = int16_t(buf[40] << 8 | buf[41] << 0);
-
-	left_acc_data[0] = int16_t(buf[42] << 8 | buf[43] << 0);
-	left_acc_data[1] = int16_t(buf[44] << 8 | buf[45] << 0);
-	left_acc_data[2] = int16_t(buf[46] << 8 | buf[47] << 0);
-
-	girl_shoes = (buf[48] & 0x16) >> 4;
-
-	s_zupt = (buf[48] & 0x08) >> 3;
-
-	h_zupt = (buf[48] & 0x04) >> 2;
-
-	shoes_down = (buf[48] & 0x02) >> 1;
-
-	jump = (buf[48] & 0x01) >> 0;
-
-	rssi = (int) buf[49];
-
-	posTimeStamp = buf[50];
-
-	if (lastTimeStamp == -1)
-	{
-		lastTimeStamp = posTimeStamp;
-
-		return;
-
-	}
-
-	if (posTimeStamp - lastTimeStamp > - 100 && posTimeStamp - lastTimeStamp <=0)
-	{
-		std::cout << "receive old shoes package ( lastTimeStamp : " << lastTimeStamp << " posTimeStamp : " << posTimeStamp << " )" <<endl;
-		lastTimeStamp = posTimeStamp;
-		return;
-	}
-
-
-	gameTime += (posTimeStamp - lastTimeStamp < 0 ? posTimeStamp - lastTimeStamp + 256 : posTimeStamp - lastTimeStamp);
-
-	lastTimeStamp = posTimeStamp;
-
-	right_front_mag = uint16_t(buf[51] << 8 | buf[52] << 0);
-	right_back_mag = uint16_t(buf[53] << 8 | buf[54] << 0);
-
-	left_front_mag = uint16_t(buf[55] << 8 | buf[56] << 0);
-	left_back_mag = uint16_t(buf[57] << 8 | buf[58] << 0);
-
-	if (len > 59)
-	{
-		right_step = uint32_t(buf[59] << 24 | buf[60] << 16 | buf[61] << 8 | buf[62] << 0);
-		left_step = uint32_t(buf[63] << 24 | buf[64] << 16 | buf[65] << 8 | buf[66] << 0);
-	}
-	else
-	{
-		right_step = 0;
-		left_step = 0;
-	}
-
-	/*
-	* 利用步数来弥补丢失的触地信号,(PU鞋垫真几把垃圾)
-	*/
-
-	if (last_left_step != left_step)
-	{
-		h_zupt = 1;
-	}
-
-	if (last_right_step != right_step)
-	{
-		s_zupt = 1;
-	}
-
-	last_left_step = left_step;
-
-	last_right_step = right_step;
-
-	//SDK来判断蹲
-	if (publicmotion.getDownData(left_front_mag, right_front_mag, left_back_mag, right_back_mag))
-	{
-		down = 1;
-		//std::cout << "SDK down valic" << endl;
-	}
-	else
-	{
-		down = 0;
-	}
-	
-	GameProcess(gameTime,
-		right_pos_data, right_att_data, right_acc_data, s_zupt, (int)right_front_mag,
-		left_pos_data, left_att_data, left_acc_data, h_zupt, (int)left_front_mag,
-		jump, shoes_down, rssi, girl_shoes);
-	
-
-	setGameDataStr();
-
-}
-
-//游戏开始的时候触发的动作
-void Game::start(string path_root)
-{
-	string game_name;
-	
-	if (GameType == RUNGAME)
-	{
-		game_name = "rungame";
-	}
-	else if (GameType == DANCEGAME)
-	{
-		game_name = "dancegame";
-	}
-
-	stringstream ss;
-
-	ss << time(NULL);
-
-	foot_data_file.open(path_root + '/'+game_name + "_" + ss.str() + ".txt", fstream::out);
-}
-
-void Game::end()
-{
-	foot_data_file.close();
-}
-
-void Game::isBingo()
-{
-	bingo = 1;
-}

+ 0 - 180
RunGame/SDK/shoes_sdk/Game.h

@@ -1,180 +0,0 @@
-#pragma once
-#ifndef _Game_H_
-#define _Game_H_
-
-#include "pub.h"
-#include "RunGame.h"
-
-#include "InertialTrajProcess.h"
-#include "DanceGame.h"
-
-#include "FootStep.h"
-#include "Interaction.h"
-
-#include "jumpH5.h"
-#include "MonsterH5.h"
-
-#include "OriginTraj.h"
-
-#include "RuinsExplore.h"
-
-#include "Tricycle.h"
-
-#include "BigFoot.h"
-
-#include "publicMotion.h"
-
-#include "testGame.h"
-
-#include <fstream>
-#include <time.h>
-#include <sstream>
-
-class Game
-{
-		public:
-			Game(int gametype);
-
-			void GameProcess(int timeStamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-				int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-				int jump, int down, int rssi, int girl_shoes);
-
-			void GameProcessBuf(uint8_t* buf, int len);
-
-			void RunGameProcess(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
-				int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
-				int jump, int down, int girl_shoes);
-
-			void getGameResult(int* matrix);
-
-			void getFootAtt(int* left_att, int* right_att);
-
-			string getGameDataStr();
-
-			int getStepStatus(int left_or_right);
-			int getStepFreq(int left_or_right);
-			int getStepCount(int left_or_right);
-
-			float getGamePos(int left_or_right, int index);
-
-			string getVersion();
-
-			void start(string path_root);
-			void end();
-			void isBingo();
-
-			int getInteractionCMD();
-
-			void processCalorieData(int down, int jump);
-
-			int getGameDownCount();
-
-			int getGameJumpCount();
-
-			int onlineDownEstimate();
-
-			void setGameDataStr();
-
-		private:
-
-			int GameType;
-			RunGame rungame;
-			DanceGame dancegame;
-
-			InertialTrajProcess rotateTrajLeft;
-			InertialTrajProcess rotateTrajRight;
-
-			MonsterH5 monsterH5;
-
-			Interaction interaction;
-
-			FootStep leftFootStep;
-			FootStep rightFootStep;
-
-			OriginTraj originTraj;
-
-			jumpH5 jumpH5game;
-
-			RuinsExplore ruinsExplore;
-
-			Tricycle tricycle;
-
-			BigFoot bigfoot;
-
-			publicMotion publicmotion;
-
-			testGame testgame;
-
-			int leftStepRate;
-			int rightStepRate;
-			
-			int leftRate;
-			int rightRate;
-
-			int resultMatrix[4];
-
-			float rotateMatrix[4];
-
-			float leftRotate[4];
-			
-			float rightRotate[4];
-
-			fstream foot_data_file;
-
-			int bingo = 0;
-
-			int InteractionCMD;
-
-			int right_pos_data[3];
-			int right_att_data[3];
-
-			int left_pos_data[3];
-			int left_att_data[3];
-
-			int left_acc_data[3];
-			int right_acc_data[3];
-
-			int girl_shoes;
-
-			int s_zupt;
-			int h_zupt;
-
-			int down;
-			int jump;
-
-			int rssi;
-
-			int posTimeStamp;
-			int attTimeStamp;
-
-			uint32_t gameTime = 0;
-			int lastTimeStamp = -1;
-
-			uint16_t right_front_mag;
-			uint16_t right_back_mag;
-
-			uint16_t left_front_mag;
-			uint16_t left_back_mag;
-
-			uint32_t right_step;
-			uint32_t left_step;
-
-			int down_count;
-			int jump_count;
-			
-			int last_down;
-			int last_jump;
-
-			int down_wait;
-			int avoid_down_between_jump;
-
-			uint32_t last_left_step;
-			uint32_t last_right_step;
-
-			string data_str;
-
-			int shoes_down;
-
-};
-
-#endif

+ 0 - 68
RunGame/SDK/shoes_sdk/InertialTrajProcess.cpp

@@ -1,68 +0,0 @@
-
-#include "InertialTrajProcess.h"
-#include <math.h>
-
-void InertialTrajProcess::TrajRotate(int *pos, float rotateMatrix[4])
-{
-	/*
-		本函数为将地理坐标的航向转移到自定义的X方向(鞋子朝向)
-	*/
-	float pos_f[3];
-
-	pos_f[2] = float(pos[2]) * 0.01f;
-	pos_f[1] = float(pos[1]) * 0.01f;
-	pos_f[0] = float(pos[0]) * 0.01f;
-
-	float posTemp[3];
-
-	posTemp[2] = pos_f[2];
-
-	posTemp[0] = rotateMatrix[0] * float(pos_f[0]) + rotateMatrix[1] * float(pos_f[1]);
-	posTemp[1] = rotateMatrix[2] * float(pos_f[0]) + rotateMatrix[3] * float(pos_f[1]);
-
-
-	pos[0] = (int)(posTemp[0] * 100.0f);
-	pos[1] = (int)(posTemp[1] * 100.0f);
-	pos[2] = (int)(posTemp[2] * 100.0f);
-}
-void InertialTrajProcess::TrajRotate(int* pos)
-{
-	/*
-		本函数为将地理坐标的航向转移到硬件所指的X方向(鞋子朝向)
-	*/
-	float pos_f[3];
-
-	pos_f[2] = float(pos[2]) * 0.01f;
-	pos_f[1] = float(pos[1]) * 0.01f;
-	pos_f[0] = float(pos[0]) * 0.01f;
-
-	float posTemp[3];
-
-	posTemp[2] = pos_f[2];
-
-	posTemp[0] = cos(curheading) * float(pos_f[0]) + sin(curheading) * float(pos_f[1]);
-	posTemp[1] = -sin(curheading) * float(pos_f[0]) + cos(curheading) * float(pos_f[1]);
-
-	
-	pos[0] = (int)(posTemp[0] * 100.0f);
-	pos[1] = (int)(posTemp[1] * 100.0f);
-	pos[2] = (int)(posTemp[2] * 100.0f);
-
-	//std::cout << "DanceGame:Rotate : " << pos[0] << " " << pos[1] << " " << pos[2] << std::endl;
-}
-
-void InertialTrajProcess::ResetHeading(int heading)
-{
-	/*
-		重置朝向
-	*/
-	curheading = (float)(heading  * 0.0001f);
-}
-
-InertialTrajProcess::InertialTrajProcess()
-{
-	memset(shoesPos, 0, 3 * sizeof(int));
-	
-	curheading = 0.0f;
-}
-

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.