Library to control a 3DOF leg with a PCA9685.
structs.h@1:4c98fa9a06a4, 2016-04-12 (annotated)
- Committer:
- el13cj
- Date:
- Tue Apr 12 15:41:58 2016 +0000
- Revision:
- 1:4c98fa9a06a4
- Parent:
- 0:ead365546ca5
- Child:
- 2:40956b2ed45b
Updated struct values for true calibrated results
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el13cj | 0:ead365546ca5 | 1 | #ifndef HEXAPOD_LEG_STRUCTS_H |
el13cj | 0:ead365546ca5 | 2 | #define HEXAPOD_LEG_STRUCTS_H |
el13cj | 0:ead365546ca5 | 3 | |
el13cj | 0:ead365546ca5 | 4 | struct leg_angles |
el13cj | 0:ead365546ca5 | 5 | |
el13cj | 0:ead365546ca5 | 6 | { |
el13cj | 0:ead365546ca5 | 7 | |
el13cj | 0:ead365546ca5 | 8 | float a; //Body Joint |
el13cj | 0:ead365546ca5 | 9 | float b; //Mid Joint |
el13cj | 0:ead365546ca5 | 10 | float c; //End Joint |
el13cj | 0:ead365546ca5 | 11 | |
el13cj | 0:ead365546ca5 | 12 | }; |
el13cj | 0:ead365546ca5 | 13 | |
el13cj | 0:ead365546ca5 | 14 | //Calibrated centre positions for all six legs |
el13cj | 0:ead365546ca5 | 15 | |
el13cj | 0:ead365546ca5 | 16 | typedef const struct leg_angles calibrated_leg_centre; |
el13cj | 0:ead365546ca5 | 17 | |
el13cj | 0:ead365546ca5 | 18 | calibrated_leg_centre leg_cent[6] = |
el13cj | 0:ead365546ca5 | 19 | { |
el13cj | 0:ead365546ca5 | 20 | // A B C |
el13cj | 1:4c98fa9a06a4 | 21 | {1520, 1570, 2474}, //LEG 1 |
el13cj | 1:4c98fa9a06a4 | 22 | {1500, 1494, 2440}, //LEG 2 |
el13cj | 1:4c98fa9a06a4 | 23 | {1535, 1449, 2524}, //LEG 3 |
el13cj | 1:4c98fa9a06a4 | 24 | {1472, 1537, 485 }, //LEG 4 |
el13cj | 1:4c98fa9a06a4 | 25 | {1504, 1520, 587 }, //LEG 5 |
el13cj | 1:4c98fa9a06a4 | 26 | {1455, 1493, 553 }, //LEG 6 |
el13cj | 0:ead365546ca5 | 27 | }; |
el13cj | 0:ead365546ca5 | 28 | |
el13cj | 0:ead365546ca5 | 29 | |
el13cj | 0:ead365546ca5 | 30 | typedef const struct leg_angles calibrated_leg_1_degree; |
el13cj | 0:ead365546ca5 | 31 | |
el13cj | 0:ead365546ca5 | 32 | calibrated_leg_1_degree leg_step[6] = |
el13cj | 0:ead365546ca5 | 33 | { |
el13cj | 0:ead365546ca5 | 34 | // A B C |
el13cj | 1:4c98fa9a06a4 | 35 | {10.444, 10.500, 10.778}, //LEG 1 |
el13cj | 1:4c98fa9a06a4 | 36 | {10.722, 10.811, 10.478}, //LEG 2 |
el13cj | 1:4c98fa9a06a4 | 37 | {10.633, 10.644, 10.822}, //LEG 3 |
el13cj | 1:4c98fa9a06a4 | 38 | {10.744, 10.700, 10.478}, //LEG 4 |
el13cj | 1:4c98fa9a06a4 | 39 | {10.744, 10.511, 10.811}, //LEG 5 |
el13cj | 1:4c98fa9a06a4 | 40 | {10.733, 11.011, 10.478}, //LEG 6 |
el13cj | 0:ead365546ca5 | 41 | }; |
el13cj | 0:ead365546ca5 | 42 | |
el13cj | 0:ead365546ca5 | 43 | |
el13cj | 0:ead365546ca5 | 44 | struct pwm_outputs |
el13cj | 0:ead365546ca5 | 45 | |
el13cj | 0:ead365546ca5 | 46 | { |
el13cj | 0:ead365546ca5 | 47 | int a; |
el13cj | 0:ead365546ca5 | 48 | int b; |
el13cj | 0:ead365546ca5 | 49 | int c; |
el13cj | 0:ead365546ca5 | 50 | |
el13cj | 0:ead365546ca5 | 51 | }; |
el13cj | 0:ead365546ca5 | 52 | |
el13cj | 0:ead365546ca5 | 53 | |
el13cj | 0:ead365546ca5 | 54 | typedef const struct pwm_outputs leg_outputs; |
el13cj | 0:ead365546ca5 | 55 | |
el13cj | 0:ead365546ca5 | 56 | leg_outputs leg_out[3] = |
el13cj | 0:ead365546ca5 | 57 | { |
el13cj | 0:ead365546ca5 | 58 | // A B C |
el13cj | 0:ead365546ca5 | 59 | {0, 1, 2}, //FRONT LEG |
el13cj | 0:ead365546ca5 | 60 | {3, 4, 5}, //MID LEG |
el13cj | 0:ead365546ca5 | 61 | {6, 7, 8}, //REAR LEG |
el13cj | 0:ead365546ca5 | 62 | }; |
el13cj | 0:ead365546ca5 | 63 | |
el13cj | 0:ead365546ca5 | 64 | |
el13cj | 0:ead365546ca5 | 65 | |
el13cj | 0:ead365546ca5 | 66 | #endif |