11
CONTROL/control.cpp@2:9418258519ea, 2021-08-06 (annotated)
- Committer:
- yezhong
- Date:
- Fri Aug 06 09:03:02 2021 +0000
- Revision:
- 2:9418258519ea
- Parent:
- 0:dd5d4837292c
111
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
panzhan | 0:dd5d4837292c | 1 | #include "control.h" |
panzhan | 0:dd5d4837292c | 2 | |
panzhan | 0:dd5d4837292c | 3 | |
panzhan | 0:dd5d4837292c | 4 | void control(float ankp, float knp) |
panzhan | 0:dd5d4837292c | 5 | { |
panzhan | 0:dd5d4837292c | 6 | if(command_control_flag == 1) |
panzhan | 0:dd5d4837292c | 7 | command_control(); |
panzhan | 0:dd5d4837292c | 8 | |
panzhan | 0:dd5d4837292c | 9 | |
panzhan | 0:dd5d4837292c | 10 | if(c_lock == 0) |
panzhan | 0:dd5d4837292c | 11 | { |
panzhan | 0:dd5d4837292c | 12 | calculate_fuzzy(ankp,knp); |
panzhan | 0:dd5d4837292c | 13 | } |
panzhan | 0:dd5d4837292c | 14 | |
panzhan | 0:dd5d4837292c | 15 | // 将计算得到的数值赋给控制器 |
panzhan | 0:dd5d4837292c | 16 | |
panzhan | 0:dd5d4837292c | 17 | a_control.ankle.p_des = cal_command.q_des_ankle; |
panzhan | 0:dd5d4837292c | 18 | a_control.ankle.v_des = cal_command.qd_des_ankle; |
panzhan | 0:dd5d4837292c | 19 | a_control.ankle.kp = cal_command.kp_ankle; |
panzhan | 0:dd5d4837292c | 20 | a_control.ankle.kd = cal_command.kd_ankle; |
panzhan | 0:dd5d4837292c | 21 | a_control.ankle.t_ff = cal_command.tau_ankle_ff; |
panzhan | 0:dd5d4837292c | 22 | |
panzhan | 0:dd5d4837292c | 23 | a_control.knee.p_des = cal_command.q_des_knee; |
panzhan | 0:dd5d4837292c | 24 | a_control.knee.v_des = cal_command.qd_des_knee; |
panzhan | 0:dd5d4837292c | 25 | a_control.knee.kp = cal_command.kp_knee; |
panzhan | 0:dd5d4837292c | 26 | a_control.knee.kd = cal_command.kd_knee; |
panzhan | 0:dd5d4837292c | 27 | a_control.knee.t_ff = cal_command.tau_knee_ff; |
panzhan | 0:dd5d4837292c | 28 | |
panzhan | 0:dd5d4837292c | 29 | } |
panzhan | 0:dd5d4837292c | 30 | |
panzhan | 0:dd5d4837292c | 31 | |
panzhan | 0:dd5d4837292c | 32 | |
panzhan | 0:dd5d4837292c | 33 | |
panzhan | 0:dd5d4837292c | 34 | |
panzhan | 0:dd5d4837292c | 35 | |
panzhan | 0:dd5d4837292c | 36 | |
panzhan | 0:dd5d4837292c | 37 | |
panzhan | 0:dd5d4837292c | 38 | |
panzhan | 0:dd5d4837292c | 39 | |
panzhan | 0:dd5d4837292c | 40 | |
panzhan | 0:dd5d4837292c | 41 | |
panzhan | 0:dd5d4837292c | 42 | |
panzhan | 0:dd5d4837292c | 43 |