not working version
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
kinematics.cpp
- Committer:
- PatrickZieverink
- Date:
- 2019-10-29
- Revision:
- 29:fa864b0f62d8
- Parent:
- 17:615c5d8b3710
File content as of revision 29:fa864b0f62d8:
/* void kinematics1() // { double length_1; double theta; //hoek tussen coordinatenstels, hidde vragen double length_2; class H_matrix //rows_columns (als je het niet ziet, gebruik dat de onderste rij 0 0 1 is) { public: int h1_1_1 = 1; int h1_1_2 = 0; float h1_1_3 = sin(theta*PI/180)*(length_1+length_2); //sinus en cosinus zijn standaard gedefinieërd in radians, maar theta is hier dus in graden int h1_2_1 = 0; int h1_2_2 = 1; float h1_2_3 = cos(theta*PI/180)*(length_1+length_2); int h1_3_1 = 0; int h1_3_2 = 0; int h1_3_3 = 1; } H_matrix H; class Position_vector1 //positie vector gezien vanuit het uiteinde van de complete arm (coördinatiestelsel draait niet mee met de arm) { public: float p1_1_1 float p1_2_1 float p1_3_1 } class Position_vector2 { public: float p2_1_1 = h1_1_1*p1_1_1 + h1_1_2*p1_2_1 + h1_1_3*p1_3_1; float p2_2_1 = h1_2_1*p1_1_1 + h1_2_2*p1_2_1 + h1_2_3*p1_3_1; float p2_3_1 = h1_3_1*p1_1_1 + h1_3_2*p1_2_1 + h1_3_3*p1_3_1; } } void kinematics2() // { double length_1; volatile double theta; volatile double length_2; class H_matrix2 //rows_columns (als je het niet ziet, gebruik dat de onderste rij 0 0 1 is) { public: int h2_1_1 = 1; int h2_1_2 = 0; float h2_1_3 = -sin(theta*PI/180)*(length_1+length_2); //sinus en cosinus zijn standaard gedefinieërd in radians, maar theta is hier dus in graden int h2_2_1 = 0; int h2_2_2 = 1; float h2_2_3 = -cos(theta*PI/180)*(length_1+length_2); int h2_3_1 = 0; int h2_3_2 = 0; int h2_3_3 = 1; } H_matrix H; class Position_vector3 //positie vector gezien vanuit het onderste draaipunt { public: float p3_1_1; float p3_2_1; float p3_3_1; } class Position_vector4 { public: float p4_1_1 = h2_1_1*p3_1_1 + h2_1_2*p3_2_1 + h2_1_3*p3_3_1; float p4_2_1 = h2_2_1*p1_1_1 + h2_2_2*p1_2_1 + h2_2_3*p3_3_1; float p4_3_1 = h2_3_1*p1_1_1 + h2_3_2*p1_2_1 + h2_3_3*p3_3_1; } H_matrix2 H2 } */