1
Revision 1:a71791b81b8a, committed 2020-11-17
- Comitter:
- panzhan
- Date:
- Tue Nov 17 11:32:58 2020 +0000
- Parent:
- 0:d80c66cb1b3a
- Commit message:
- dadsada
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 10 09:09:58 2020 +0000 +++ b/main.cpp Tue Nov 17 11:32:58 2020 +0000 @@ -50,19 +50,19 @@ EnterMotorMode(&ankle_txMsg); //////////////////////////////////////////position///////////////////////////////////////// -// a_control.ankle.p_des=3.14/8; -// a_control.ankle.v_des=0; -// a_control.ankle.kp=10; -// a_control.ankle.kd=0; -// a_control.ankle.t_ff=0; -// -// a_control.knee.p_des=3.14/8; -// a_control.knee.v_des=0; -// a_control.knee.kp=10; -// a_control.knee.kd=0; -// a_control.knee.t_ff=0; -// PackAll(); -// WriteAll(); + a_control.ankle.p_des=3.14/8; + a_control.ankle.v_des=0; + a_control.ankle.kp=5; + a_control.ankle.kd=0; + a_control.ankle.t_ff=0; + + a_control.knee.p_des=3.14/8; + a_control.knee.v_des=0; + a_control.knee.kp=5; + a_control.knee.kd=0; + a_control.knee.t_ff=0; + PackAll(); + WriteAll(); while(1) { @@ -74,28 +74,28 @@ knee_can.read(knee_rxMsg); unpack_reply(knee_rxMsg, &a_state); - ankp = a_state.ankle_state.p; // 从CAN获得的当前位置 - ankv = a_state.ankle_state.v; - ankt = a_state.ankle_state.t; + float ankp = a_state.ankle_state.p; // 从CAN获得的当前位置 + float ankv = a_state.ankle_state.v; + float ankt = a_state.ankle_state.t; - knp = a_state.knee_state.p; - knv = a_state.knee_state.v; - knt = a_state.knee_state.t; + float knp = a_state.knee_state.p; + float knv = a_state.knee_state.v; + float knt = a_state.knee_state.t; pc.printf("%.3f--%.3f--%.3f==================%.3f--%.3f--%.3f\n",ankp,ankv,ankt,knp,knv,knt); ///////////////////////////////////////velocity/////////////////////////////////////////////// // a_control.ankle.p_des=0; -// a_control.ankle.v_des=500*2*3.14/60/49; +// a_control.ankle.v_des=100*2*3.14/60/49; // a_control.ankle.kp=0; -// a_control.ankle.kd=3; +// a_control.ankle.kd=4; // a_control.ankle.t_ff=0; // // a_control.knee.p_des=0; -// a_control.knee.v_des=500*2*3.14/60/49; +// a_control.knee.v_des=100*2*3.14/60/49; // a_control.knee.kp=0; -// a_control.knee.kd=3; +// a_control.knee.kd=4; // a_control.knee.t_ff=0; // PackAll(); // WriteAll();