1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include "host_shoes.h"
- void host_shoes(int time_stamp, float gyr[3], float acc[3], float mag[3], uint16_t h_press, uint16_t s_press,
- int32_t h_pos[3], int16_t h_att[3], int32_t s_pos[3], int16_t s_att[3], int16_t h_zupt, int16_t s_zupt,uint16_t s_rssi)
- {
- static int16_t h_pos_offset[3];
- static int16_t s_pos_offset[3];
- static int16_t h_pos_last[3];
- static int16_t s_pos_last[3];
-
- int32_t left_press = (((int32_t)h_press & 0x0000ffff)<<8);
-
- int16_t is_down = 0;
-
- int16_t is_jump = 0;
-
- if(!CAL_MODE)
- {
- unsigned char left_tag = footPDR(time_stamp, gyr, acc, mag, left_press, h_pos, h_att, &h_zupt);
-
- if(h_zupt == 1)
- {
- for(int i = 0; i < 3; i ++)
- {
- h_pos_last[i] = h_pos[i];
- }
- }
-
- if(s_zupt == 1)
- {
- for(int i = 0; i < 3; i ++)
- {
- s_pos_last[i] = s_pos[i];
- }
- }
-
- for(int i = 0; i <3; i++)
- {
- h_pos_offset[i] = h_pos[i] - h_pos_last[i];
- s_pos_offset[i] = s_pos[i] - s_pos_last[i];
- }
-
- special_motion(time_stamp, h_press, s_press, h_pos_offset, s_pos_offset, &is_down, &is_jump, acc);
- }
-
-
- send_data_to_com(s_pos, h_pos, s_att, h_att, s_zupt, h_zupt, is_down, is_jump, s_rssi);
-
- }
|