FingerGuessing.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #include "PublicSDKMotion.h"
  2. #define RSSI_LEN 5
  3. struct motion_rssi {
  4. int rssi;
  5. int motion;
  6. };
  7. class FingerGuessing : public PublicSDKMotion
  8. {
  9. public:
  10. FingerGuessing();
  11. void ProcessResult(float* global_pos, deque<shoes_data_cell>& step_data_vector,
  12. deque<globalPos_struct>& global_pos_vector, int LEFT_OR_RIGHT);
  13. int ProcessDualStepVector(deque<shoes_data_cell>& left_cmd_step_data_vector, deque<shoes_data_cell> &right_cmd_step_data_vector,
  14. float* left_cmd_global_pos, float* right_cmd_global_pos , int rssi);
  15. bool unzuptValid(int* max_acc, int* min_acc);
  16. virtual void Process(int time_stamp, int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_front_press, int right_back_press,
  17. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_front_press, int left_back_press,
  18. int jump, int down, int rssi);
  19. private:
  20. deque<int> rssi_vec;
  21. deque<int> pitch_vec;
  22. deque<int> roll_vec;
  23. deque<int> left_acc_vec;
  24. deque<int> right_acc_vec;
  25. int pitch_reference_val = 0;
  26. int roll_reference_val = 0;
  27. int has_init = 0;
  28. deque<shoes_data_cell> left_shoes_data_vector;
  29. deque<shoes_data_cell> right_shoes_data_vector;
  30. deque<globalPos_struct> right_global_pos_vector;
  31. deque<globalPos_struct> left_global_pos_vector;
  32. float left_cmd_global_pos[3];
  33. float right_cmd_global_pos[3];
  34. deque<shoes_data_cell> left_step_data_vector;
  35. deque<shoes_data_cell> right_step_data_vector;
  36. deque<shoes_data_cell> left_cmd_step_data_vector;
  37. deque<shoes_data_cell> right_cmd_step_data_vector;
  38. float left_step_pos[3];
  39. float right_step_pos[3];
  40. float left_heading;
  41. float right_heading;
  42. int left_foot_has_init;
  43. int right_foot_has_init;
  44. int left_zupt_count;
  45. int right_zupt_count;
  46. int right_cmd_wait_time;
  47. int left_cmd_wait_time;
  48. int left_init;
  49. int right_init;
  50. int left_zupt_extension_time = 0;
  51. int right_zupt_extension_time = 0;
  52. const int rssi_threshold = 30;
  53. };