Browse Source

优化脚环实时内容

liang 1 year ago
parent
commit
708c746041

+ 2 - 0
footRing_sdk_1.0/include/SportFunction.h

@@ -118,4 +118,6 @@ private:
 	int jump_high;
 	int jump_high;
 	int jump_length;
 	int jump_length;
 
 
+	int last_jump = 0;
+
 };
 };

+ 1 - 1
footRing_sdk_1.0/include/pub.h

@@ -44,7 +44,7 @@ using namespace std;
 
 
 #define PRESS_MIN 41000
 #define PRESS_MIN 41000
 
 
-#define GAME_VERSION "0.6.15"
+#define GAME_VERSION "0.6.16"
 
 
 enum CMD_MOTION
 enum CMD_MOTION
 {
 {

+ 29 - 26
footRing_sdk_1.0/src/SportFunction.cpp

@@ -60,31 +60,31 @@ void SportFunction::checkShoesData(deque<sport_data_struct>& shoes_data_vector)
 
 
 	//假定真正的触地一定伴随着压力的上升。
 	//假定真正的触地一定伴随着压力的上升。
 
 
-	if (shoes_data_vector.back().zupt == 1 && len > 1)
-	{
-		int circle_len = 10 > len - 1 ? len - 1 : 10;
-
-		int front_min_press = shoes_data_vector.back().front_press;
-		int back_min_press = shoes_data_vector.back().back_press;
-
-		for (auto it = shoes_data_vector.rbegin(); it < shoes_data_vector.rbegin() + circle_len; it++)
-		{
-			if (it->front_press < front_min_press)
-			{
-				front_min_press = it->front_press;
-			}
-
-			if (it->back_press > back_min_press)
-			{
-				back_min_press = it->back_press;
-			}
-		}
-
-		if (!(shoes_data_vector.back().front_press - front_min_press > 500 || shoes_data_vector.front().front_press - back_min_press > 500))
-		{
-			shoes_data_vector.back().zupt = 0;
-		}
-	}
+	//if (shoes_data_vector.back().zupt == 1 && len > 1)
+	//{
+	//	int circle_len = 10 > len - 1 ? len - 1 : 10;
+
+	//	int front_min_press = shoes_data_vector.back().front_press;
+	//	int back_min_press = shoes_data_vector.back().back_press;
+
+	//	for (auto it = shoes_data_vector.rbegin(); it < shoes_data_vector.rbegin() + circle_len; it++)
+	//	{
+	//		if (it->front_press < front_min_press)
+	//		{
+	//			front_min_press = it->front_press;
+	//		}
+
+	//		if (it->back_press > back_min_press)
+	//		{
+	//			back_min_press = it->back_press;
+	//		}
+	//	}
+
+	//	if (!(shoes_data_vector.back().front_press - front_min_press > 500 || shoes_data_vector.front().front_press - back_min_press > 500))
+	//	{
+	//		shoes_data_vector.back().zupt = 0;
+	//	}
+	//}
 
 
 	//缓存最大Z轴值, 最小值
 	//缓存最大Z轴值, 最小值
 	if (len > 1)
 	if (len > 1)
@@ -310,8 +310,9 @@ void SportFunction::Process(int time_stamp, int* right_pos, int* right_att, int*
 	checkShoesData(right_shoes_data_vector);
 	checkShoesData(right_shoes_data_vector);
 	checkShoesData(left_shoes_data_vector);
 	checkShoesData(left_shoes_data_vector);
 
 
+
 	//统计跳的数目
 	//统计跳的数目
-	if (checkRopeSkip(left_shoes_data_vector, right_shoes_data_vector))
+	if (last_jump  != jump && jump == 1)
 	{
 	{
 		result[5] = ++jump_count;
 		result[5] = ++jump_count;
 
 
@@ -319,6 +320,8 @@ void SportFunction::Process(int time_stamp, int* right_pos, int* right_att, int*
 
 
 	}
 	}
 
 
+	last_jump = jump;
+
 	if (left_shoes_data_vector.back().not_on_floor == 1 && right_shoes_data_vector.back().not_on_floor == 1
 	if (left_shoes_data_vector.back().not_on_floor == 1 && right_shoes_data_vector.back().not_on_floor == 1
 		&& (left_shoes_data_vector.back().zupt == 1 || right_shoes_data_vector.back().zupt == 1)
 		&& (left_shoes_data_vector.back().zupt == 1 || right_shoes_data_vector.back().zupt == 1)
 		&&  (abs(left_shoes_data_vector.front().time_stamp - right_shoes_data_vector.front().time_stamp)) < 30)
 		&&  (abs(left_shoes_data_vector.front().time_stamp - right_shoes_data_vector.front().time_stamp)) < 30)