|
5 | 5 | * @brief Configuration file for the Arduino sketch. |
6 | 6 | * @details This file contains the configuration for the Arduino sketch. |
7 | 7 | */ |
| 8 | +//#define SERVO_CALIBRATION_ENABLED // Enable servo calibration (see ServoManager::calibrate()) |
| 9 | +//#define SERVO_CALIBRATION_SYMMETRICAL // Calculate and apply equivelant changes on other leg. |
8 | 10 |
|
9 | 11 | #define SERVO_PIN_OFFSET 2 // Legacy, used to identify pin from pi communication |
10 | 12 | // Left Leg |
|
19 | 21 | #define PIN_SNT 2 // Servo neck tilt |
20 | 22 | #define PIN_SNP 3 // Servo neck pan |
21 | 23 | // Sway |
22 | | -#define PIN_SLLHP 4 // Servo left leg hip piovot (unused) |
| 24 | +#define PIN_SLLHP 4 // Servo left leg hip pivot (unused) |
23 | 25 | #define PIN_SRLHP 5 // Servo right leg hip pivot (unused) |
24 | 26 |
|
25 | 27 | #define LEG_LENGTH_SHIN 94.0 // Length of shin |
26 | 28 | #define LEG_LENGTH_THIGH 94.0 // Length of thigh |
27 | 29 | #define LEG_LENGTH_FOOT 28.0 // Length of foot |
28 | 30 |
|
| 31 | +#define HIP_ADJUSTMENT 120 // Starting angle of hip relative to IK model |
| 32 | +#define KNEE_ADJUSTMENT 90 |
| 33 | +#define ANKLE_ADJUSTMENT 85 |
| 34 | + |
29 | 35 | #define EASING_TYPE EASE_QUADRATIC_IN_OUT |
30 | 36 | #define ENABLE_EASE_QUADRATIC |
31 | 37 | #define SERVO_SPEED_MIN 20 |
|
35 | 41 |
|
36 | 42 | #define SERVO_COUNT 8 // Number of servos to be controlled by ServoEasing |
37 | 43 |
|
38 | | -#define LEG_IK_MIN 140 // Min solvable height of leg between hip and ankle |
| 44 | +#define LEG_IK_MIN 75 // Min solvable height of leg between hip and ankle |
39 | 45 | #define LEG_IK_MAX 170 // Max solvable height of leg between hip and ankle |
40 | 46 |
|
41 | 47 | #define NOVAL 1000 |
42 | 48 |
|
43 | | -#define MPU6050_ENABLED // Enable MPU6050 |
| 49 | +//#define MPU6050_ENABLED // Enable MPU6050 |
44 | 50 | //#define MPU6050_DEBUG // Debug in serial plotter |
| 51 | +//#define ANIMATE_ENABLED // Enable random animations |
45 | 52 |
|
46 | 53 |
|
47 | 54 | // Arrays to store servo min / max positions to avoid mechanical issues due |
48 | 55 | // NOTE: attach() disregards this, set PosRest to be within range of the servo's physical boundaries |
49 | | -int PosMin[SERVO_COUNT] = {20, 5, 40, 20, 5, 15, 60, 20}; |
50 | | -int PosMax[SERVO_COUNT] = {160, 175, 180, 160, 175, 180, 120, 160}; |
51 | | -int PosSleep[SERVO_COUNT] = {70, PosMin[1], PosMax[2], 110, PosMax[4], PosMin[5], PosMax[7], 90}; |
| 56 | +int PosMin[SERVO_COUNT] = {0, 0, 5, 0, 0, 10, 60, 30}; |
| 57 | +int PosMax[SERVO_COUNT] = {180, 180, 165, 180, 180, 180, 120, 150}; |
| 58 | +int PosSleep[SERVO_COUNT] = {40, 60, 95, 140, 120, 85, PosMax[7], 90}; |
52 | 59 | //int PrepRestFromSleep[SERVO_COUNT] = {80, PosMin[1], PosMax[2], 100, PosMax[4], PosMin[5], S7_REST, 80, S9_REST}; |
53 | 60 | //int PrepSleepFromRest[SERVO_COUNT] = {S1_REST, S2_REST, S3_REST, S4_REST, S5_REST, S6_REST, S7_REST, 80, S9_REST}; |
54 | 61 |
|
55 | 62 | // Starting positions |
56 | | -int PosStart[SERVO_COUNT] = {30, 21, 94, 149, 158, 85, 90, 90}; |
| 63 | +//0, 3 = HIP |
| 64 | +int PosStart[SERVO_COUNT] = {60, 0, 165, 120, 180, 10, 90, 90}; |
57 | 65 |
|
58 | 66 |
|
59 | 67 |
|
60 | 68 | //int PosRest[SERVO_COUNT] = {S1_REST, S2_REST, S3_REST, S4_REST, S5_REST, S6_REST, S7_REST, S8_REST, S9_REST}; |
61 | | -int PosRest[SERVO_COUNT] = {30, 21, 94, 149, 158, 85, 90, 90}; |
| 69 | +int PosRest[SERVO_COUNT] = {60, 0, 165, 120, 180, 10, 90, 90}; |
62 | 70 |
|
63 | 71 | int PosConfig[SERVO_COUNT] = {90, 90, 90, 90, 90, 90, 90, 90}; |
64 | 72 |
|
65 | 73 | // Poses |
66 | | -int PosStand[SERVO_COUNT] = {110, 110, 110, 70, 70, 70, NOVAL, NOVAL}; |
| 74 | +int PosStand[SERVO_COUNT] = {40, 60, 95, 140, 120, 85, NOVAL, NOVAL}; |
67 | 75 | int PosLookLeft[SERVO_COUNT] = {NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, 180}; |
68 | 76 | int PosLookRight[SERVO_COUNT] = {NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, 0}; |
69 | | -int PosLookRandom[SERVO_COUNT] = {NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, -1, -1}; // Made random by calling the function moveRandom() if the value is -1 |
| 77 | +int PosLookRandom[SERVO_COUNT] = {NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, -1, NOVAL}; // Made random by calling the function moveRandom() if the value is -1 |
70 | 78 | int PosLookUp[SERVO_COUNT] = {NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, 60, 90}; |
71 | 79 | int PosLookDown[SERVO_COUNT] = {NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, NOVAL, 120, 90}; |
72 | 80 |
|
|
0 commit comments