|
@@ -187,6 +187,15 @@ int FingerGuessing::ProcessDualStepVector(deque<shoes_data_cell>& left_cmd_step_
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+bool FingerGuessing::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) && min_acc[0] < 500)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+}
|
|
|
|
|
|
|
|
|
void FingerGuessing::Process(int time_stamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_front_press, int right_back_press,
|
|
@@ -254,6 +263,37 @@ void FingerGuessing::Process(int time_stamp, int* right_pos, int* right_att, int
|
|
|
}
|
|
|
|
|
|
|
|
|
+ if (left_zupt || right_zupt)
|
|
|
+ {
|
|
|
+ left_zupt = 1; right_zupt = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (left_zupt)
|
|
|
+ {
|
|
|
+ left_zupt_extension_time = 5;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (right_zupt)
|
|
|
+ {
|
|
|
+ right_zupt_extension_time = 5;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (left_zupt_extension_time > 0)
|
|
|
+ {
|
|
|
+ left_zupt = 1;
|
|
|
+
|
|
|
+ left_zupt_extension_time--;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (right_zupt_extension_time > 0)
|
|
|
+ {
|
|
|
+ right_zupt = 1;
|
|
|
+
|
|
|
+ right_zupt_extension_time--;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//缓存一步内的空中数据
|
|
|
setData(right_shoes_data_vector, time_stamp, right_pos[0] * 0.001f, right_pos[1] * 0.001f, right_pos[2] * 0.001f,
|
|
|
right_att[0] * 0.0001f, right_att[1] * 0.0001f, right_att[2] * 0.0001f, right_zupt, rssi);
|
|
@@ -295,6 +335,12 @@ void FingerGuessing::Process(int time_stamp, int* right_pos, int* right_att, int
|
|
|
left_cmd_wait_time = time_stamp;
|
|
|
|
|
|
left_init = 1;
|
|
|
+
|
|
|
+ right_shoes_data_vector.pop_front();
|
|
|
+ right_step_data_vector.pop_front();
|
|
|
+
|
|
|
+ left_shoes_data_vector.pop_front();
|
|
|
+ left_step_data_vector.pop_front();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -337,8 +383,10 @@ void FingerGuessing::Process(int time_stamp, int* right_pos, int* right_att, int
|
|
|
//看起来rssi的延迟有够烂的
|
|
|
|
|
|
|
|
|
- if (left_init == 1 && right_init == 1 &&
|
|
|
- time_stamp - left_cmd_wait_time > 9 && time_stamp - left_cmd_wait_time < 40 && time_stamp - right_cmd_wait_time > 9 && time_stamp - right_cmd_wait_time < 40)
|
|
|
+ //if (left_init == 1 && right_init == 1 &&
|
|
|
+ // time_stamp - left_cmd_wait_time > 9 && time_stamp - left_cmd_wait_time < 40 && time_stamp - right_cmd_wait_time > 9 && time_stamp - right_cmd_wait_time < 40)
|
|
|
+ if ((left_init == 1 && time_stamp - left_cmd_wait_time > 9 && time_stamp - left_cmd_wait_time < 40) ||
|
|
|
+ (right_init == 1 && time_stamp - right_cmd_wait_time > 9 && time_stamp - right_cmd_wait_time < 40))
|
|
|
{
|
|
|
|
|
|
if (rssi < rssi_threshold)
|
|
@@ -391,6 +439,7 @@ void FingerGuessing::Process(int time_stamp, int* right_pos, int* right_att, int
|
|
|
|
|
|
left_init = 0;
|
|
|
right_init = 0;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|