DemoState with IK and MotorControl and input vx_des and vy_des with potmeter1 and button2
Dependencies: FastPWM MODSERIAL Matrix MatrixMath mbed QEI
Diff: main.cpp
- Revision:
- 6:a6f79f31767b
- Parent:
- 5:aca2af310419
- Child:
- 7:fb3da4df4269
diff -r aca2af310419 -r a6f79f31767b main.cpp --- a/main.cpp Sat Nov 03 13:46:07 2018 +0000 +++ b/main.cpp Sat Nov 03 13:52:22 2018 +0000 @@ -247,9 +247,9 @@ q1 = IntegrateQ1(); // Compute required angle to go to desired position of end-effector q2 = IntegrateQ2(); // Compute required angle to go to desired position of end-effector if (q > 0.0) { // q1 cannot be greater than 0 - q == 0.0; + q = 0.0; } else if (q < - 1.047) { // q1 cannot be smaller than 60 degrees - q1 = -1.047 + q1 = -1.047; } else { // q1 can be computed q1 between intervals q1 = q1; }