Calum Johnston / Hexapod_Leg
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers structs.h Source File

structs.h

00001 #ifndef HEXAPOD_LEG_STRUCTS_H
00002 #define HEXAPOD_LEG_STRUCTS_H
00003 
00004 struct leg_angles
00005 
00006 {    
00007 
00008     float a;    //Body Joint
00009     float b;    //Mid Joint
00010     float c;    //End Joint
00011     
00012 };
00013 
00014 //Calibrated centre positions for all six legs
00015 
00016 typedef const struct leg_angles calibrated_leg_centre;
00017 
00018 calibrated_leg_centre leg_cent[7] = 
00019 {
00020 //    A     B     C
00021     {0,    0,    0   },         //Dummy Leg for  better structure
00022     {1520, 1570, 2474},         //LEG 1
00023     {1500, 1494, 2440},         //LEG 2
00024     {1535, 1449, 2524},         //LEG 3
00025     {1472, 1537, 485 },         //LEG 4
00026     {1504, 1520, 587 },         //LEG 5
00027     {1455, 1493, 553 },         //LEG 6
00028 };
00029 
00030 
00031 typedef const struct leg_angles calibrated_leg_1_degree;
00032 
00033 calibrated_leg_1_degree leg_step[7] = 
00034 {
00035 //      A       B       C
00036     {0,      0,      0     },   //Dummy Leg for  better structure
00037     {10.444, 10.500, 10.778},   //LEG 1
00038     {10.722, 10.811, 10.478},   //LEG 2
00039     {10.633, 10.644, 10.822},   //LEG 3
00040     {10.744, 10.700, 10.478},   //LEG 4
00041     {10.744, 10.511, 10.811},   //LEG 5
00042     {10.733, 11.011, 10.478},   //LEG 6
00043 };
00044 
00045 
00046 struct pwm_outputs 
00047 
00048 {    
00049     int a;
00050     int b;
00051     int c;
00052     
00053 };
00054 
00055 
00056 typedef const struct pwm_outputs leg_outputs;
00057 
00058 leg_outputs leg_out[3] = 
00059 {
00060 //   A   B   C
00061     {0,  1,  2},  //FRONT LEG
00062     {3,  4,  5},  //MID LEG
00063     {6, 7, 8},  //REAR LEG
00064 };
00065 
00066 typedef const struct leg_angles leg_x_angles;      
00067         
00068 #endif