Browse Source

优化脚环-踢馆大师,将条件跳窄

liang 2 năm trước cách đây
mục cha
commit
59c550bb68

+ 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.5.63"
+#define GAME_VERSION "0.6.1"
 
 
 enum CMD_MOTION
 enum CMD_MOTION
 {
 {

+ 13 - 11
footRing_sdk_1.0/src/Aerobics.cpp

@@ -182,28 +182,30 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 	float roll  = step_data_vector.back().roll;
 	float roll  = step_data_vector.back().roll;
 
 
 	//暂时先将抬脚的高度阈值为0.1m, 伸脚的距离设置为0.2m
 	//暂时先将抬脚的高度阈值为0.1m, 伸脚的距离设置为0.2m
-	if (high > high_thresh && plane_length > 0.2)
+	if ( plane_length > 0.3)
 	{
 	{
 		//if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > -2.9f && roll < 0.0f)
 		//if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > -2.9f && roll < 0.0f)
-		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > 2.0f)
+		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_left_status == 1 && roll > 1.8f)
 		{
 		{
-			std::cout << "MOTION_STRETCH_LEFT" << endl;
+			std::cout << "MOTION_STRETCH_LEFT : " << "左侧踢"<< endl;
 			result[0] = MOTION_STRETCH_LEFT;
 			result[0] = MOTION_STRETCH_LEFT;
 			stretch_left_status = 0;
 			stretch_left_status = 0;
 			lift_left_status = 0;
 			lift_left_status = 0;
+			stretch_front_left_status = 0;
 		}
 		}
-		else if(LEFT_OR_RIGHT == RIGHT_FOOT && stretch_right_status == 1 && roll > 2.0f)
+		else if(LEFT_OR_RIGHT == RIGHT_FOOT && stretch_right_status == 1 && roll > 1.8f)
 		{
 		{
-			std::cout << "MOTION_STRETCH_RIGHT" << endl;
+			std::cout << "MOTION_STRETCH_RIGHT: " << "右侧踢" << endl;
 			result[0] = MOTION_STRETCH_RIGHT;
 			result[0] = MOTION_STRETCH_RIGHT;
 			stretch_right_status = 0;
 			stretch_right_status = 0;
 			lift_right_status = 0;
 			lift_right_status = 0;
+			stretch_front_right_status = 0;
 		}
 		}
 
 
 		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_front_left_status == 1
 		if (LEFT_OR_RIGHT == LEFT_FOOT && stretch_front_left_status == 1
 			&& step_data_vector.back().pos_y > 0.2f)
 			&& step_data_vector.back().pos_y > 0.2f)
 		{
 		{
-			std::cout << "MOTION_STRETCH_FRONT_LEFT" << endl;
+			std::cout << "MOTION_STRETCH_FRONT_LEFT: " << "左前踢" << endl;
 			result[0] = MOTION_STRETCH_FRONT_LEFT;
 			result[0] = MOTION_STRETCH_FRONT_LEFT;
 			stretch_front_left_status = 0;
 			stretch_front_left_status = 0;
 			lift_left_status = 0;
 			lift_left_status = 0;
@@ -211,7 +213,7 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 		else if (LEFT_OR_RIGHT == RIGHT_FOOT && stretch_front_right_status == 1 
 		else if (LEFT_OR_RIGHT == RIGHT_FOOT && stretch_front_right_status == 1 
 			&& step_data_vector.back().pos_y > 0.2f)
 			&& step_data_vector.back().pos_y > 0.2f)
 		{
 		{
-			std::cout << "MOTION_STRETCH_FRONT_RIGHT" << endl;
+			std::cout << "MOTION_STRETCH_FRONT_RIGHT" << "右前踢" << endl;
 			result[0] = MOTION_STRETCH_FRONT_RIGHT;
 			result[0] = MOTION_STRETCH_FRONT_RIGHT;
 			stretch_front_right_status = 0;
 			stretch_front_right_status = 0;
 			lift_right_status = 0;
 			lift_right_status = 0;
@@ -222,19 +224,19 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 	{
 	{
 		if (LEFT_OR_RIGHT == LEFT_FOOT && lift_left_status == 1)
 		if (LEFT_OR_RIGHT == LEFT_FOOT && lift_left_status == 1)
 		{
 		{
-			std::cout << "MOTION_LIFT_LEFT" << endl;
+			std::cout << "MOTION_LIFT_LEFT " << "左抬脚" << endl;
 			result[0] = MOTION_LIFT_LEFT;
 			result[0] = MOTION_LIFT_LEFT;
 			lift_left_status = 0;
 			lift_left_status = 0;
 		}
 		}
 		else if (LEFT_OR_RIGHT == RIGHT_FOOT && lift_right_status == 1)
 		else if (LEFT_OR_RIGHT == RIGHT_FOOT && lift_right_status == 1)
 		{
 		{
-			std::cout << "MOTION_LIFT_RIGHT" << endl;
+			std::cout << "MOTION_LIFT_RIGHT " << "右抬脚" << endl;
 			result[0] = MOTION_LIFT_RIGHT;
 			result[0] = MOTION_LIFT_RIGHT;
 			lift_right_status = 0;
 			lift_right_status = 0;
 		}
 		}
 	}
 	}
 
 
-	/*if (plane_length > 0.2)
+	if (plane_length > 0.3)
 	{
 	{
 		std::cout << "test : plane_length > 0.2" << endl;
 		std::cout << "test : plane_length > 0.2" << endl;
 	}
 	}
@@ -242,5 +244,5 @@ void Aerobics::setResult(deque<shoes_data_cell>& step_data_vector,int LEFT_OR_RI
 	if (high > high_thresh)
 	if (high > high_thresh)
 	{
 	{
 		std::cout << "high > high_thresh" << endl;
 		std::cout << "high > high_thresh" << endl;
-	}*/
+	}
 }
 }