|
@@ -24,7 +24,9 @@ bool JumpHouse::unzuptValid(int* max_acc, int* min_acc)
|
|
|
{
|
|
|
if ((max_acc[0] - min_acc[0] > 2048 || max_acc[1] - min_acc[1] > 2048 || max_acc[2] - min_acc[2] > 2048) && max_acc[0] > 3000)
|
|
|
{
|
|
|
- std::cout << "JumpHouse::unzuptValid" << endl;
|
|
|
+ std::cout << "JumpHouse::unzuptValid, " << max_acc[0] << ", " << min_acc[0] << ", " << max_acc[1] << ", "
|
|
|
+ << min_acc[1] << ", " << max_acc[2] << ", " << min_acc[2] << ", " <<endl;
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -39,14 +41,14 @@ void JumpHouse::Process(int time_stamp, int* right_pos, int* right_att, int* rig
|
|
|
|
|
|
//翘脚视为不在地上
|
|
|
//
|
|
|
- if (left_zupt == 1 && left_att[1] * 0.0001f > 0.4f)
|
|
|
+ if (left_zupt == 1 && left_att[1] * 0.0001f > 0.6f)
|
|
|
{
|
|
|
- std::cout << "if (left_zupt == 1 && left_att[1] * 0.0001f > 0.2f) " << left_att[1] * 0.0001f << endl;
|
|
|
+ std::cout << "if (left_zupt == 1 && left_att[1] * 0.0001f > 0.6f) " << left_att[1] * 0.0001f << endl;
|
|
|
left_zupt = 0;
|
|
|
}
|
|
|
- if (right_zupt == 1 && right_att[1] * 0.0001f > 0.4f)
|
|
|
+ if (right_zupt == 1 && right_att[1] * 0.0001f > 0.6f)
|
|
|
{
|
|
|
- std::cout << "if (right_zupt == 1 && right_att[1] * 0.0001f > 0.2f) " << right_att[1] * 0.0001f << endl;
|
|
|
+ std::cout << "if (right_zupt == 1 && right_att[1] * 0.0001f > 0.6f) " << right_att[1] * 0.0001f << endl;
|
|
|
right_zupt = 0;
|
|
|
}
|
|
|
|
|
@@ -90,6 +92,7 @@ void JumpHouse::Process(int time_stamp, int* right_pos, int* right_att, int* rig
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //std::cout << left_acc[0] << ", " << left_acc[1] << ", " << left_acc[2] << std::endl;
|
|
|
setPolarAccUnzupt(max_acc_unzupt_left, min_acc_unzupt_left, left_acc, left_zupt);
|
|
|
|
|
|
setPolarAccUnzupt(max_acc_unzupt_right, min_acc_unzupt_right, right_acc, right_zupt);
|
|
@@ -100,7 +103,8 @@ void JumpHouse::Process(int time_stamp, int* right_pos, int* right_att, int* rig
|
|
|
|
|
|
//判断双脚触地的时候, rssi < 23 必须归位,不然也没办法处理
|
|
|
//看起来rssi的延迟有够烂的
|
|
|
-
|
|
|
+ static int count;
|
|
|
+ count++;
|
|
|
if (left_init == 1 && time_stamp - left_cmd_wait_time >= 9 && time_stamp - left_cmd_wait_time < 30)
|
|
|
{
|
|
|
if (right_init == 1)
|
|
@@ -109,19 +113,19 @@ void JumpHouse::Process(int time_stamp, int* right_pos, int* right_att, int* rig
|
|
|
{
|
|
|
result[0] = MOTION_BOTH_ON_FLOOR_CLOSE;
|
|
|
|
|
|
- std::cout << " MOTION_BOTH_ON_FLOOR_CLOSE " << rssi << std::endl;
|
|
|
+ std::cout << " MOTION_BOTH_ON_FLOOR_CLOSE " << rssi << ", "<< count << std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
result[0] = MOTION_BOTH_ON_FLOOR_OPEN;
|
|
|
- std::cout << " MOTION_BOTH_ON_FLOOR_OPEN "<< rssi << std::endl;
|
|
|
+ std::cout << " MOTION_BOTH_ON_FLOOR_OPEN "<< rssi << ", " << count << std::endl;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
result[0] = MOTION_LEFT_ON_FLOOR;
|
|
|
- std::cout << " MOTION_LEFT_ON_FLOOR " <<time_stamp << std::endl;
|
|
|
+ std::cout << " MOTION_LEFT_ON_FLOOR " <<time_stamp << ", " << count << std::endl;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -140,12 +144,12 @@ void JumpHouse::Process(int time_stamp, int* right_pos, int* right_att, int* rig
|
|
|
{
|
|
|
result[0] = MOTION_BOTH_ON_FLOOR_CLOSE;
|
|
|
|
|
|
- std::cout << " MOTION_BOTH_ON_FLOOR_CLOSE " << " "<< rssi << std::endl;
|
|
|
+ std::cout << " MOTION_BOTH_ON_FLOOR_CLOSE " << " "<< rssi << ", " << count << std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
result[0] = MOTION_BOTH_ON_FLOOR_OPEN;
|
|
|
- std::cout << " MOTION_BOTH_ON_FLOOR_OPEN " << " " << rssi << std::endl;
|
|
|
+ std::cout << " MOTION_BOTH_ON_FLOOR_OPEN " << " " << rssi << ", " << count << std::endl;
|
|
|
}
|
|
|
|
|
|
left_init = 0;
|
|
@@ -155,7 +159,7 @@ void JumpHouse::Process(int time_stamp, int* right_pos, int* right_att, int* rig
|
|
|
else
|
|
|
{
|
|
|
result[0] = MOTION_RIGHT_ON_FLOOR;
|
|
|
- std::cout << " MOTION_RIGHT_ON_FLOOR " << time_stamp << std::endl;
|
|
|
+ std::cout << " MOTION_RIGHT_ON_FLOOR " << time_stamp << ", " << count << std::endl;
|
|
|
|
|
|
}
|
|
|
right_init = 0;
|