Sword fighting robots WIP

Dependencies:   mbed PinDetect

Committer:
amitchell41
Date:
Thu Dec 06 01:30:51 2018 +0000
Revision:
0:e8eecd4b9a3d
Swing batta batta swing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
amitchell41 0:e8eecd4b9a3d 1 /* meArmIK - York Hackspace May 2014
amitchell41 0:e8eecd4b9a3d 2 * Inverse Kinematics solver for three degrees of freedom
amitchell41 0:e8eecd4b9a3d 3 * created for Phenoptix' meArm robot arm
amitchell41 0:e8eecd4b9a3d 4 */
amitchell41 0:e8eecd4b9a3d 5 #ifndef IK_H_INCLUDED
amitchell41 0:e8eecd4b9a3d 6 #define IK_H_INCLUDED
amitchell41 0:e8eecd4b9a3d 7
amitchell41 0:e8eecd4b9a3d 8 extern float L1, L2, L3;
amitchell41 0:e8eecd4b9a3d 9
amitchell41 0:e8eecd4b9a3d 10 // Get polar coords from cartesian ones
amitchell41 0:e8eecd4b9a3d 11 void cart2polar(float a, float b, float& r, float& theta);
amitchell41 0:e8eecd4b9a3d 12
amitchell41 0:e8eecd4b9a3d 13 // Get angle from a triangle using cosine rule
amitchell41 0:e8eecd4b9a3d 14 bool cosangle(float opp, float adj1, float adj2, float& theta);
amitchell41 0:e8eecd4b9a3d 15
amitchell41 0:e8eecd4b9a3d 16 // Solve angles!
amitchell41 0:e8eecd4b9a3d 17 bool solve(float x, float y, float z, float& a0, float& a1, float& a2);
amitchell41 0:e8eecd4b9a3d 18
amitchell41 0:e8eecd4b9a3d 19 #endif // IK_H_INCLUDED