Austin Mitchell
/
RobotFightingControl
Diff: ik.h
- Revision:
- 0:e8eecd4b9a3d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ik.h Thu Dec 06 01:30:51 2018 +0000 @@ -0,0 +1,19 @@ +/* meArmIK - York Hackspace May 2014 + * Inverse Kinematics solver for three degrees of freedom + * created for Phenoptix' meArm robot arm + */ +#ifndef IK_H_INCLUDED +#define IK_H_INCLUDED + +extern float L1, L2, L3; + +// Get polar coords from cartesian ones +void cart2polar(float a, float b, float& r, float& theta); + +// Get angle from a triangle using cosine rule +bool cosangle(float opp, float adj1, float adj2, float& theta); + +// Solve angles! +bool solve(float x, float y, float z, float& a0, float& a1, float& a2); + +#endif // IK_H_INCLUDED \ No newline at end of file