111

Dependencies:   yezhong_main_controller_copy mbed1-dev

Committer:
yezhong
Date:
Thu Nov 19 07:59:28 2020 +0000
Revision:
2:cd74a8cb03b0
Parent:
0:d80c66cb1b3a
Child:
5:2503c88a564f
Child:
9:c082f1c52936
11

Who changed what in which revision?

UserRevisionLine numberNew contents of line
panzhan 0:d80c66cb1b3a 1 #ifndef _leg_message
panzhan 0:d80c66cb1b3a 2 #define _leg_message
panzhan 0:d80c66cb1b3a 3
panzhan 0:d80c66cb1b3a 4 // 头文件
panzhan 0:d80c66cb1b3a 5 #include <stdint.h>
panzhan 0:d80c66cb1b3a 6
panzhan 0:d80c66cb1b3a 7 // 定义结构体
panzhan 0:d80c66cb1b3a 8 struct joint_control{ // 关节控制结构体
panzhan 0:d80c66cb1b3a 9 float p_des, v_des, kp, kd, t_ff; // 控制量为: p_des, v_des, kp, kd, t_ff
panzhan 0:d80c66cb1b3a 10 };
yezhong 2:cd74a8cb03b0 11
yezhong 2:cd74a8cb03b0 12 struct ankle_control{ // 系统控制结构体
yezhong 2:cd74a8cb03b0 13 joint_control pf, df; // 控制成员: pf, df关节
panzhan 0:d80c66cb1b3a 14 };
yezhong 2:cd74a8cb03b0 15
panzhan 0:d80c66cb1b3a 16 struct joint_state{ // 关节状态结构体
panzhan 0:d80c66cb1b3a 17 float p, v, t; // 状态成员: p\v\t
panzhan 0:d80c66cb1b3a 18 };
panzhan 0:d80c66cb1b3a 19
yezhong 2:cd74a8cb03b0 20 struct ankle_state{ // 系统状态结构体
yezhong 2:cd74a8cb03b0 21 joint_state pf, df; // 状态成员: pf, df状态
panzhan 0:d80c66cb1b3a 22 };
panzhan 0:d80c66cb1b3a 23
panzhan 0:d80c66cb1b3a 24
panzhan 0:d80c66cb1b3a 25 //struct cal_data_t
panzhan 0:d80c66cb1b3a 26 //{
panzhan 0:d80c66cb1b3a 27 // float q_pf;
panzhan 0:d80c66cb1b3a 28 // float q_df;
panzhan 0:d80c66cb1b3a 29 //
panzhan 0:d80c66cb1b3a 30 // float qd_pf;
panzhan 0:d80c66cb1b3a 31 // float qd_df;
panzhan 0:d80c66cb1b3a 32 //
panzhan 0:d80c66cb1b3a 33 // int32_t flag_pf;
panzhan 0:d80c66cb1b3a 34 // int32_t flag_df;
panzhan 0:d80c66cb1b3a 35 // //int32_t checksum;
panzhan 0:d80c66cb1b3a 36 //};
panzhan 0:d80c66cb1b3a 37 //
panzhan 0:d80c66cb1b3a 38 //struct cal_command_t
panzhan 0:d80c66cb1b3a 39 //{
panzhan 0:d80c66cb1b3a 40 // float q_des_pf;
panzhan 0:d80c66cb1b3a 41 // float q_des_df;
panzhan 0:d80c66cb1b3a 42 //
panzhan 0:d80c66cb1b3a 43 // float qd_des_pf;
panzhan 0:d80c66cb1b3a 44 // float qd_des_df;
panzhan 0:d80c66cb1b3a 45 //
panzhan 0:d80c66cb1b3a 46 // float kp_pf;
panzhan 0:d80c66cb1b3a 47 // float kp_df;
panzhan 0:d80c66cb1b3a 48 //
panzhan 0:d80c66cb1b3a 49 // float kd_pf;
panzhan 0:d80c66cb1b3a 50 // float kd_df;
panzhan 0:d80c66cb1b3a 51 //
panzhan 0:d80c66cb1b3a 52 // float tau_pf_ff;
panzhan 0:d80c66cb1b3a 53 // float tau_df_ff;
panzhan 0:d80c66cb1b3a 54 //
panzhan 0:d80c66cb1b3a 55 // int32_t flag; // 进入电机模式标志位
panzhan 0:d80c66cb1b3a 56 // //int32_t checksum;
panzhan 0:d80c66cb1b3a 57 //};
panzhan 0:d80c66cb1b3a 58
panzhan 0:d80c66cb1b3a 59
panzhan 0:d80c66cb1b3a 60 #endif