SingleFootAction.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "pub.h"
  2. #define STOP_ANGLE -0.65f
  3. class SingleFootAction {
  4. public:
  5. SingleFootAction(int foot_type) : can_report_motion(0), pause_signal(0), enter_signal(0),
  6. direction_signal(-1), last_zupt(1), left_or_right(foot_type), interation_state(-1),
  7. last_x(0), last_y(0), last_z(0), big_pitch_count(0), can_report_enter_signal(0), last_enter_signal(0),
  8. enter_signal_cooling(0)
  9. {};
  10. void can_listen_direction_signal(int rssi);
  11. //void pause_signal_listen(float pitch);
  12. int direction_signal_listen(int x, int y, int zupt, int rssi);
  13. //void set_motion_signal(int zupt);
  14. //��ȡ��ŵ��Լ���ͣ���ź�
  15. int enter_signal_listen(float* acc, float pitch);
  16. int can_listen_enter_signal(float* acc, float pitch);
  17. int get_interation_state();
  18. void run(int x, int y, int z, int zupt, int rssi, float pitch, float* acc);
  19. private:
  20. int pause_signal_count;
  21. int can_report_motion;
  22. int pause_signal;
  23. int enter_signal;
  24. int direction_signal;
  25. int last_zupt;
  26. int left_or_right;
  27. int interation_state;
  28. int last_x;
  29. int last_y;
  30. int last_z;
  31. float acc_x_buff[10];
  32. float big_pitch_count;
  33. int can_report_enter_signal;
  34. int last_enter_signal;
  35. int enter_signal_cooling;
  36. };