StepVel.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "PublicSDKMotion.h"
  2. #define PRESS_WINDOW_SIZE 10
  3. struct vel_struct {
  4. int time_stamp;
  5. float vel;
  6. };
  7. class StepVel : public PublicSDKMotion
  8. {
  9. public:
  10. StepVel();
  11. void setData(deque<shoes_data_cell>& shoes_data_vector, int time_stamp, float pos_x, float pos_y, float pos_z, float heading, float pitch, float roll, int zupt, int rssi);
  12. void calGlobalPos(deque<shoes_data_cell>& shoes_data_vector, deque<shoes_data_cell>& step_data_vector,
  13. float* global_pos, int LEFT_OR_RIGHT);
  14. 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,
  15. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_front_press, int left_back_press,
  16. int jump, int down, int rssi);
  17. int getStepVel();
  18. void check_vel_vector(int time_stamp, deque<vel_struct>& vel_vector);
  19. float cal_mean_vel(int end_time, int start_time, float max_val);
  20. float get_vel_mean(int time_stamp, deque<vel_struct>& vel_vector, deque<shoes_data_cell>& step_data_vector);
  21. private:
  22. deque<shoes_data_cell> left_shoes_data_vector;
  23. deque<shoes_data_cell> right_shoes_data_vector;
  24. deque<shoes_data_cell> left_step_data_vector;
  25. deque<shoes_data_cell> right_step_data_vector;
  26. deque<vel_struct> left_vel_vector;
  27. deque<vel_struct> right_vel_vector;
  28. float right_global_pos[3];
  29. float left_global_pos[3];
  30. int left_jump_cancel_update_vel;
  31. int right_jump_cancel_update_vel;
  32. float step_vel;
  33. int both_zupt_count = 0;
  34. };