1
LEG_MESSAGE/leg_message.h@8:95a914f962bd, 2020-01-07 (annotated)
- Committer:
- shaorui
- Date:
- Tue Jan 07 09:23:24 2020 +0000
- Revision:
- 8:95a914f962bd
- Parent:
- 5:6a95726e45b0
- Child:
- 10:f94e325fc1e6
1234
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
benkatz | 3:9ef9b4c66648 | 1 | #ifndef _leg_message |
benkatz | 3:9ef9b4c66648 | 2 | #define _leg_message |
benkatz | 3:9ef9b4c66648 | 3 | |
WXD | 5:6a95726e45b0 | 4 | |
WXD | 5:6a95726e45b0 | 5 | // 头文件 |
benkatz | 3:9ef9b4c66648 | 6 | #include <stdint.h> |
benkatz | 3:9ef9b4c66648 | 7 | |
WXD | 5:6a95726e45b0 | 8 | |
WXD | 5:6a95726e45b0 | 9 | // 定义结构体 |
WXD | 5:6a95726e45b0 | 10 | struct joint_control{ // 关节控制结构体 |
shaorui | 8:95a914f962bd | 11 | float p_des, v_des, kp, kd, t_ff,pp; // 控制量为: p_des, v_des, kp, kd, t_ff |
WXD | 5:6a95726e45b0 | 12 | }; |
WXD | 5:6a95726e45b0 | 13 | |
WXD | 5:6a95726e45b0 | 14 | struct ankle_control{ // 系统控制结构体 |
shaorui | 8:95a914f962bd | 15 | joint_control ef, wf; // 控制成员: ef:肘关节 wf:腕关节 |
WXD | 5:6a95726e45b0 | 16 | }; |
WXD | 5:6a95726e45b0 | 17 | |
WXD | 5:6a95726e45b0 | 18 | struct joint_state{ // 关节状态结构体 |
WXD | 5:6a95726e45b0 | 19 | float p, v, t; // 状态成员: p\v\t |
WXD | 5:6a95726e45b0 | 20 | }; |
WXD | 5:6a95726e45b0 | 21 | |
WXD | 5:6a95726e45b0 | 22 | struct ankle_state{ // 系统状态结构体 |
shaorui | 8:95a914f962bd | 23 | joint_state ef, wf; // 状态成员: pf, df状态 |
WXD | 5:6a95726e45b0 | 24 | }; |
shaorui | 8:95a914f962bd | 25 | /* |
WXD | 5:6a95726e45b0 | 26 | struct cal_data_t |
benkatz | 3:9ef9b4c66648 | 27 | { |
WXD | 5:6a95726e45b0 | 28 | float q_pf; |
WXD | 5:6a95726e45b0 | 29 | float q_df; |
WXD | 5:6a95726e45b0 | 30 | |
WXD | 5:6a95726e45b0 | 31 | float qd_pf; |
WXD | 5:6a95726e45b0 | 32 | float qd_df; |
WXD | 5:6a95726e45b0 | 33 | |
WXD | 5:6a95726e45b0 | 34 | int32_t flag_pf; |
WXD | 5:6a95726e45b0 | 35 | int32_t flag_df; |
WXD | 5:6a95726e45b0 | 36 | //int32_t checksum; |
benkatz | 3:9ef9b4c66648 | 37 | }; |
benkatz | 3:9ef9b4c66648 | 38 | |
WXD | 5:6a95726e45b0 | 39 | struct cal_command_t |
benkatz | 3:9ef9b4c66648 | 40 | { |
WXD | 5:6a95726e45b0 | 41 | float q_des_pf; |
WXD | 5:6a95726e45b0 | 42 | float q_des_df; |
WXD | 5:6a95726e45b0 | 43 | |
WXD | 5:6a95726e45b0 | 44 | float qd_des_pf; |
WXD | 5:6a95726e45b0 | 45 | float qd_des_df; |
WXD | 5:6a95726e45b0 | 46 | |
WXD | 5:6a95726e45b0 | 47 | float kp_pf; |
WXD | 5:6a95726e45b0 | 48 | float kp_df; |
WXD | 5:6a95726e45b0 | 49 | |
WXD | 5:6a95726e45b0 | 50 | float kd_pf; |
WXD | 5:6a95726e45b0 | 51 | float kd_df; |
WXD | 5:6a95726e45b0 | 52 | |
WXD | 5:6a95726e45b0 | 53 | float tau_pf_ff; |
WXD | 5:6a95726e45b0 | 54 | float tau_df_ff; |
WXD | 5:6a95726e45b0 | 55 | |
WXD | 5:6a95726e45b0 | 56 | int32_t flag; // 进入电机模式标志位 |
WXD | 5:6a95726e45b0 | 57 | //int32_t checksum; |
benkatz | 3:9ef9b4c66648 | 58 | }; |
benkatz | 3:9ef9b4c66648 | 59 | |
shaorui | 8:95a914f962bd | 60 | */ |
benkatz | 3:9ef9b4c66648 | 61 | |
WXD | 5:6a95726e45b0 | 62 | |
WXD | 5:6a95726e45b0 | 63 | |
WXD | 5:6a95726e45b0 | 64 | |
WXD | 5:6a95726e45b0 | 65 | |
WXD | 5:6a95726e45b0 | 66 | |
WXD | 5:6a95726e45b0 | 67 | |
WXD | 5:6a95726e45b0 | 68 | |
WXD | 5:6a95726e45b0 | 69 | |
WXD | 5:6a95726e45b0 | 70 | |
WXD | 5:6a95726e45b0 | 71 | |
benkatz | 3:9ef9b4c66648 | 72 | #endif |