Biorobotics / Robot-Software

Dependencies:   HIDScope MODSERIAL QEI biquadFilter mbed Servo

Revision:
4:88d28354e023
Parent:
3:40e0e9404f82
Child:
5:0dd66c757f24
--- a/help_functions/kinematics.h	Mon Oct 22 19:09:19 2018 +0000
+++ b/help_functions/kinematics.h	Mon Oct 22 19:10:41 2018 +0000
@@ -4,11 +4,13 @@
 double L2 = 0.7;
 double x01 = 0.0;
 double y01 = 0.2;
-double q1,q2,x,y;
 
 double forwardkinematics_function(double q1, double q2) {
     // input are joint angles, output are x and y position of end effector
     
+    double x;
+    double y;
+    
     x = x01 - L1 * sin(q1) + L2 * cos(q1 + q2);
     y = y01 + L1 * cos(q1) + L2 * sin(q1 + q2);
     return x;