Martin Smith
/
3DForwardKinematics
Forward Kinematics code for all four of E.R.I.C.'s legs...
FK.h
- Committer:
- ms523
- Date:
- 2011-10-08
- Revision:
- 2:a51b150e4189
- Parent:
- 1:937018869855
File content as of revision 2:a51b150e4189:
#include "mbed.h" #include "AX12.h" #define B 45 // Offset dimension #define FEMUR 80 // Femur length #define TIBIA 140 // Tibia length #define ULNA 90 // Ulna length #define RADIUS 120 // Radius length #define X_OFFSET 25 // Distance from the X-axis -> servo centre #define PI 3.14159 /********** Global structures **********/ struct Positions { float X_fore_right; float Y_fore_right; float Z_fore_right; float X_fore_left; float Y_fore_left; float Z_fore_left; float X_hind_right; float Y_hind_right; float Z_hind_right; float X_hind_left; float Y_hind_left; float Z_hind_left; }; /************************************************************************** Global variables **************************************************************************/ extern AX12 Fore_Right_Hip_Lateral, Fore_Right_Hip, Fore_Right_Knee, Fore_Left_Hip_Lateral, Fore_Left_Hip, Fore_Left_Knee, Hind_Right_Hip_Lateral, Hind_Right_Hip, Hind_Right_Knee, Hind_Left_Hip_Lateral, Hind_Left_Hip, Hind_Left_Knee; /********** Functions **********/ Positions FK_Engine();