|
@@ -86,6 +86,8 @@ int last_stage;
|
|
uint8_t step_count;
|
|
uint8_t step_count;
|
|
uint16_t step_distance;
|
|
uint16_t step_distance;
|
|
|
|
|
|
|
|
+int step_time = 0;
|
|
|
|
+
|
|
//
|
|
//
|
|
short pos_offset_max = 0;
|
|
short pos_offset_max = 0;
|
|
short pos_offset_min = 0;
|
|
short pos_offset_min = 0;
|
|
@@ -841,9 +843,12 @@ unsigned char footPDR(int num, float *gyr, float *acc, int press, short* pos_res
|
|
{
|
|
{
|
|
|
|
|
|
//计算一步的距离及步数+1
|
|
//计算一步的距离及步数+1
|
|
- if(last_stage == 2)
|
|
|
|
|
|
+ //做一个计算时间时间,防止非正常走路的情况出来
|
|
|
|
+ if(last_stage == 2 && frame_index - step_time > 30)
|
|
{
|
|
{
|
|
cal_step_data();
|
|
cal_step_data();
|
|
|
|
+
|
|
|
|
+ step_time = frame_index;
|
|
}
|
|
}
|
|
|
|
|
|
stand_num = stand_num + 1;
|
|
stand_num = stand_num + 1;
|