12
LEG_MESSAGE/leg_message.h@0:dd5d4837292c, 2021-06-09 (annotated)
- Committer:
- panzhan
- Date:
- Wed Jun 09 01:41:45 2021 +0000
- Revision:
- 0:dd5d4837292c
continuous motion
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
panzhan | 0:dd5d4837292c | 1 | #ifndef _leg_message |
panzhan | 0:dd5d4837292c | 2 | #define _leg_message |
panzhan | 0:dd5d4837292c | 3 | |
panzhan | 0:dd5d4837292c | 4 | // 头文件 |
panzhan | 0:dd5d4837292c | 5 | #include <stdint.h> |
panzhan | 0:dd5d4837292c | 6 | |
panzhan | 0:dd5d4837292c | 7 | // 定义结构体 |
panzhan | 0:dd5d4837292c | 8 | struct joint_control{ // 关节控制结构体 |
panzhan | 0:dd5d4837292c | 9 | float p_des, v_des, kp, kd, t_ff; // 控制量为: p_des, v_des, kp, kd, t_ff |
panzhan | 0:dd5d4837292c | 10 | }; |
panzhan | 0:dd5d4837292c | 11 | |
panzhan | 0:dd5d4837292c | 12 | struct leg_control{ // 系统控制结构体 |
panzhan | 0:dd5d4837292c | 13 | joint_control ankle, knee; // 控制成员: knee, ankle关节 |
panzhan | 0:dd5d4837292c | 14 | }; |
panzhan | 0:dd5d4837292c | 15 | |
panzhan | 0:dd5d4837292c | 16 | |
panzhan | 0:dd5d4837292c | 17 | struct joint_state{ // 关节状态结构体 |
panzhan | 0:dd5d4837292c | 18 | float p, v, t; // 状态成员: p\v\t |
panzhan | 0:dd5d4837292c | 19 | }; |
panzhan | 0:dd5d4837292c | 20 | |
panzhan | 0:dd5d4837292c | 21 | struct leg_state{ // 系统状态结构体 |
panzhan | 0:dd5d4837292c | 22 | joint_state ankle_state, knee_state; // 状态成员: ankle_state, knee_state状态 |
panzhan | 0:dd5d4837292c | 23 | }; |
panzhan | 0:dd5d4837292c | 24 | |
panzhan | 0:dd5d4837292c | 25 | |
panzhan | 0:dd5d4837292c | 26 | //struct cal_data_t |
panzhan | 0:dd5d4837292c | 27 | //{ |
panzhan | 0:dd5d4837292c | 28 | // float q_pf; |
panzhan | 0:dd5d4837292c | 29 | // float q_df; |
panzhan | 0:dd5d4837292c | 30 | // |
panzhan | 0:dd5d4837292c | 31 | // float qd_pf; |
panzhan | 0:dd5d4837292c | 32 | // float qd_df; |
panzhan | 0:dd5d4837292c | 33 | // |
panzhan | 0:dd5d4837292c | 34 | // int32_t flag_pf; |
panzhan | 0:dd5d4837292c | 35 | // int32_t flag_df; |
panzhan | 0:dd5d4837292c | 36 | // //int32_t checksum; |
panzhan | 0:dd5d4837292c | 37 | //}; |
panzhan | 0:dd5d4837292c | 38 | // |
panzhan | 0:dd5d4837292c | 39 | struct cal_command_t |
panzhan | 0:dd5d4837292c | 40 | { |
panzhan | 0:dd5d4837292c | 41 | float q_des_ankle; |
panzhan | 0:dd5d4837292c | 42 | float q_des_knee; |
panzhan | 0:dd5d4837292c | 43 | |
panzhan | 0:dd5d4837292c | 44 | float qd_des_ankle; |
panzhan | 0:dd5d4837292c | 45 | float qd_des_knee; |
panzhan | 0:dd5d4837292c | 46 | |
panzhan | 0:dd5d4837292c | 47 | float kp_ankle; |
panzhan | 0:dd5d4837292c | 48 | float kp_knee; |
panzhan | 0:dd5d4837292c | 49 | |
panzhan | 0:dd5d4837292c | 50 | float kd_ankle; |
panzhan | 0:dd5d4837292c | 51 | float kd_knee; |
panzhan | 0:dd5d4837292c | 52 | |
panzhan | 0:dd5d4837292c | 53 | float tau_ankle_ff; |
panzhan | 0:dd5d4837292c | 54 | float tau_knee_ff; |
panzhan | 0:dd5d4837292c | 55 | |
panzhan | 0:dd5d4837292c | 56 | int32_t flag; // 进入电机模式标志位 |
panzhan | 0:dd5d4837292c | 57 | //int32_t checksum; |
panzhan | 0:dd5d4837292c | 58 | }; |
panzhan | 0:dd5d4837292c | 59 | |
panzhan | 0:dd5d4837292c | 60 | |
panzhan | 0:dd5d4837292c | 61 | #endif |