1

Dependencies:   mcp2515 mbed-dev-f303

Committer:
panzhan
Date:
Tue Nov 10 09:09:58 2020 +0000
Revision:
0:d80c66cb1b3a
Child:
2:cd74a8cb03b0
panzhan_main_controller_copy2

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 };
panzhan 0:d80c66cb1b3a 11
panzhan 0:d80c66cb1b3a 12 struct leg_control{ // 系统控制结构体
panzhan 0:d80c66cb1b3a 13 joint_control ankle, knee; // 控制成员: knee, ankle关节
panzhan 0:d80c66cb1b3a 14 };
panzhan 0:d80c66cb1b3a 15
panzhan 0:d80c66cb1b3a 16
panzhan 0:d80c66cb1b3a 17 struct joint_state{ // 关节状态结构体
panzhan 0:d80c66cb1b3a 18 float p, v, t; // 状态成员: p\v\t
panzhan 0:d80c66cb1b3a 19 };
panzhan 0:d80c66cb1b3a 20
panzhan 0:d80c66cb1b3a 21 struct leg_state{ // 系统状态结构体
panzhan 0:d80c66cb1b3a 22 joint_state ankle_state, knee_state; // 状态成员: ankle_state, knee_state状态
panzhan 0:d80c66cb1b3a 23 };
panzhan 0:d80c66cb1b3a 24
panzhan 0:d80c66cb1b3a 25
panzhan 0:d80c66cb1b3a 26 //struct cal_data_t
panzhan 0:d80c66cb1b3a 27 //{
panzhan 0:d80c66cb1b3a 28 // float q_pf;
panzhan 0:d80c66cb1b3a 29 // float q_df;
panzhan 0:d80c66cb1b3a 30 //
panzhan 0:d80c66cb1b3a 31 // float qd_pf;
panzhan 0:d80c66cb1b3a 32 // float qd_df;
panzhan 0:d80c66cb1b3a 33 //
panzhan 0:d80c66cb1b3a 34 // int32_t flag_pf;
panzhan 0:d80c66cb1b3a 35 // int32_t flag_df;
panzhan 0:d80c66cb1b3a 36 // //int32_t checksum;
panzhan 0:d80c66cb1b3a 37 //};
panzhan 0:d80c66cb1b3a 38 //
panzhan 0:d80c66cb1b3a 39 //struct cal_command_t
panzhan 0:d80c66cb1b3a 40 //{
panzhan 0:d80c66cb1b3a 41 // float q_des_pf;
panzhan 0:d80c66cb1b3a 42 // float q_des_df;
panzhan 0:d80c66cb1b3a 43 //
panzhan 0:d80c66cb1b3a 44 // float qd_des_pf;
panzhan 0:d80c66cb1b3a 45 // float qd_des_df;
panzhan 0:d80c66cb1b3a 46 //
panzhan 0:d80c66cb1b3a 47 // float kp_pf;
panzhan 0:d80c66cb1b3a 48 // float kp_df;
panzhan 0:d80c66cb1b3a 49 //
panzhan 0:d80c66cb1b3a 50 // float kd_pf;
panzhan 0:d80c66cb1b3a 51 // float kd_df;
panzhan 0:d80c66cb1b3a 52 //
panzhan 0:d80c66cb1b3a 53 // float tau_pf_ff;
panzhan 0:d80c66cb1b3a 54 // float tau_df_ff;
panzhan 0:d80c66cb1b3a 55 //
panzhan 0:d80c66cb1b3a 56 // int32_t flag; // 进入电机模式标志位
panzhan 0:d80c66cb1b3a 57 // //int32_t checksum;
panzhan 0:d80c66cb1b3a 58 //};
panzhan 0:d80c66cb1b3a 59
panzhan 0:d80c66cb1b3a 60
panzhan 0:d80c66cb1b3a 61 #endif