123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #include "pub.h"
- #include "ctime"
- #define STOP_ANGLE -0.65f
- class SingleFootAction {
- public:
- SingleFootAction(int foot_type) : can_report_motion(0), pause_signal(0), enter_signal(0),
- direction_signal(-1), last_zupt(1), left_or_right(foot_type), interation_state(-1),
- last_x(0), last_y(0), last_z(0), big_pitch_count(0), can_report_enter_signal(0), last_enter_signal(0),
- enter_signal_cooling(0)
- {};
- void can_listen_direction_signal(int rssi);
- //void pause_signal_listen(float pitch);
- int direction_signal_listen(int x, int y, int zupt, int rssi);
- //void set_motion_signal(int zupt);
- //获取垫脚的以及暂停的信号
- int enter_signal_listen(float* acc, float pitch);
- int can_listen_enter_signal(float* acc, float pitch);
- FootActionState get_interation_state();
- void run(uint32_t _time, int x, int y, int z, int zupt, int rssi, float pitch, float* acc);
- //新的脚步命令
- int direction_signal_listen_new(uint32_t _time, int x, int y, int zupt, int rssi, float pitch);
- void reset_interation_state();
- int enter_signal_listen_new(uint32_t _time, float* acc, float pitch, int zupt_trigger);
- private:
- int pause_signal_count;
- int can_report_motion;
- int pause_signal;
- int enter_signal;
- int direction_signal;
- int last_zupt;
- int left_or_right;
- int interation_state;
- int last_x;
-
- int last_y;
- int last_z;
- float acc_x_buff[10];
- float big_pitch_count;
- int shake_tag = 0;
- int station_count = 0;
- float acc_x_max = 0;
- float acc_x_min = 0;
-
- int can_report_enter_signal;
- int last_enter_signal;
- int enter_signal_cooling;
- int on_floor_count = 0;
- int has_reset_signal = 0;
- int cmd_stage = 0;
- clock_t time_s = clock();
- FootActionState footActionState = {0, 0 , 0};
- };
|