S.W Eijpe / Mbed 2 deprecated MatrixMult

Dependencies:   MODSERIAL mbed

Committer:
SvenEijpe
Date:
Mon Oct 29 16:00:04 2018 +0000
Revision:
0:9914ce5b3003
Child:
1:fda67b3a1100
Only the x and y position of frame f;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SvenEijpe 0:9914ce5b3003 1 #include "mbed.h"
SvenEijpe 0:9914ce5b3003 2 #include "math.h"
SvenEijpe 0:9914ce5b3003 3 #include "MODSERIAL.h"
SvenEijpe 0:9914ce5b3003 4
SvenEijpe 0:9914ce5b3003 5 MODSERIAL pc(USBTX, USBRX);
SvenEijpe 0:9914ce5b3003 6
SvenEijpe 0:9914ce5b3003 7 int main()
SvenEijpe 0:9914ce5b3003 8 {
SvenEijpe 0:9914ce5b3003 9 pc.baud(115200);
SvenEijpe 0:9914ce5b3003 10 pc.printf("Hello World!\r\n");
SvenEijpe 0:9914ce5b3003 11 float L0 = 0.1;
SvenEijpe 0:9914ce5b3003 12 float L1 = 0.326;
SvenEijpe 0:9914ce5b3003 13 float L2 = 0.209;
SvenEijpe 0:9914ce5b3003 14 float q1 = 0;
SvenEijpe 0:9914ce5b3003 15 float q2 = 0;
SvenEijpe 0:9914ce5b3003 16 float Oe0_x;
SvenEijpe 0:9914ce5b3003 17 float inv_Oe0_x;
SvenEijpe 0:9914ce5b3003 18 float Oe0_y;
SvenEijpe 0:9914ce5b3003 19 float inv_Oe0_y;
SvenEijpe 0:9914ce5b3003 20
SvenEijpe 0:9914ce5b3003 21 //Oe0x
SvenEijpe 0:9914ce5b3003 22 Oe0_x = L0 + cos(q1)*(L0 + L1 - cos(q2)*(L0 + L1)) - L0*cos(q1) + (cos(q1)*cos(q2) - sin(q1)*sin(q2))*(L0 + L1 - L2) + sin(q1)*sin(q2)*(L0 + L1);
SvenEijpe 0:9914ce5b3003 23 inv_Oe0_x = -Oe0_x;
SvenEijpe 0:9914ce5b3003 24
SvenEijpe 0:9914ce5b3003 25 //Oe0y
SvenEijpe 0:9914ce5b3003 26 Oe0_y = sin(q1)*(L0 + L1 - cos(q2)*(L0 + L1)) - L0*sin(q1) + (cos(q1)*sin(q2) + cos(q2)*sin(q1))*(L0 + L1 - L2) - cos(q1)*sin(q2)*(L0 + L1);
SvenEijpe 0:9914ce5b3003 27 inv_Oe0_y = -Oe0_y;
SvenEijpe 0:9914ce5b3003 28
SvenEijpe 0:9914ce5b3003 29 pc.printf("Oe0_x = %f, Oe0_y = %f, inv_Oe0_x = %f and inv_Oe0_y = %f \r\n", Oe0_x, Oe0_y, inv_Oe0_x, inv_Oe0_y); // print the value of variable c
SvenEijpe 0:9914ce5b3003 30
SvenEijpe 0:9914ce5b3003 31
SvenEijpe 0:9914ce5b3003 32
SvenEijpe 0:9914ce5b3003 33
SvenEijpe 0:9914ce5b3003 34 }
SvenEijpe 0:9914ce5b3003 35