1

Committer:
ccxx1200
Date:
Thu Mar 12 15:17:18 2020 +0000
Revision:
10:f94e325fc1e6
Parent:
8:95a914f962bd
1

Who changed what in which revision?

UserRevisionLine numberNew 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 };
ccxx1200 10:f94e325fc1e6 25
ccxx1200 10:f94e325fc1e6 26 struct duoji_control{ // 关节控制结构体
ccxx1200 10:f94e325fc1e6 27 float p_des, t_des; // 控制量为: p_des, v_des, kp, kd, t_ff
ccxx1200 10:f94e325fc1e6 28 };
ccxx1200 10:f94e325fc1e6 29
ccxx1200 10:f94e325fc1e6 30
shaorui 8:95a914f962bd 31 /*
WXD 5:6a95726e45b0 32 struct cal_data_t
benkatz 3:9ef9b4c66648 33 {
WXD 5:6a95726e45b0 34 float q_pf;
WXD 5:6a95726e45b0 35 float q_df;
WXD 5:6a95726e45b0 36
WXD 5:6a95726e45b0 37 float qd_pf;
WXD 5:6a95726e45b0 38 float qd_df;
WXD 5:6a95726e45b0 39
WXD 5:6a95726e45b0 40 int32_t flag_pf;
WXD 5:6a95726e45b0 41 int32_t flag_df;
WXD 5:6a95726e45b0 42 //int32_t checksum;
benkatz 3:9ef9b4c66648 43 };
benkatz 3:9ef9b4c66648 44
WXD 5:6a95726e45b0 45 struct cal_command_t
benkatz 3:9ef9b4c66648 46 {
WXD 5:6a95726e45b0 47 float q_des_pf;
WXD 5:6a95726e45b0 48 float q_des_df;
WXD 5:6a95726e45b0 49
WXD 5:6a95726e45b0 50 float qd_des_pf;
WXD 5:6a95726e45b0 51 float qd_des_df;
WXD 5:6a95726e45b0 52
WXD 5:6a95726e45b0 53 float kp_pf;
WXD 5:6a95726e45b0 54 float kp_df;
WXD 5:6a95726e45b0 55
WXD 5:6a95726e45b0 56 float kd_pf;
WXD 5:6a95726e45b0 57 float kd_df;
WXD 5:6a95726e45b0 58
WXD 5:6a95726e45b0 59 float tau_pf_ff;
WXD 5:6a95726e45b0 60 float tau_df_ff;
WXD 5:6a95726e45b0 61
WXD 5:6a95726e45b0 62 int32_t flag; // 进入电机模式标志位
WXD 5:6a95726e45b0 63 //int32_t checksum;
benkatz 3:9ef9b4c66648 64 };
benkatz 3:9ef9b4c66648 65
shaorui 8:95a914f962bd 66 */
benkatz 3:9ef9b4c66648 67
WXD 5:6a95726e45b0 68
WXD 5:6a95726e45b0 69
WXD 5:6a95726e45b0 70
WXD 5:6a95726e45b0 71
WXD 5:6a95726e45b0 72
WXD 5:6a95726e45b0 73
WXD 5:6a95726e45b0 74
WXD 5:6a95726e45b0 75
WXD 5:6a95726e45b0 76
WXD 5:6a95726e45b0 77
benkatz 3:9ef9b4c66648 78 #endif