Browse Source

Merge branch 'lars' of ssh://git.lbsfilm.at:10022/lbsadmin/LARS

lars
Lukas Bachschwell 1 year ago
parent
commit
b5ac2d6875
2 changed files with 26 additions and 26 deletions
  1. 25
    25
      src/LARS.cpp
  2. 1
    1
      src/LARS.h

+ 25
- 25
src/LARS.cpp View File

@@ -17,14 +17,14 @@
17 17
 
18 18
 
19 19
 LARS::LARS(): reverse{0, 0, 0, 0, 0, 0, 0, 0}, trim{0, 0, 0, 0, 0, 0, 0, 0} {
20
-  board_pins[FRONT_RIGHT_HIP] = 26; // front left inner
21
-  board_pins[FRONT_LEFT_HIP] = 25; // front right inner
22
-  board_pins[BACK_RIGHT_HIP] = 17; // back left inner
23
-  board_pins[BACK_LEFT_HIP] = 16; // back right inner
24
-  board_pins[FRONT_RIGHT_LEG] = 27; // front left outer
25
-  board_pins[FRONT_LEFT_LEG] = 14; // front right outer               // 15, 14, 12 free for Lukas
26
-  board_pins[BACK_RIGHT_LEG] = 12; // back left outer
27
-  board_pins[BACK_LEFT_LEG] = 13; // back right outer
20
+  board_pins[FRONT_RIGHT_HIP] = 26; // front right inner
21
+  board_pins[FRONT_LEFT_HIP] = 25; // front left inner
22
+  board_pins[BACK_RIGHT_HIP] = 17; // back right inner
23
+  board_pins[BACK_LEFT_HIP] = 16; // back left inner
24
+  board_pins[FRONT_RIGHT_LEG] = 27; // front right outer
25
+  board_pins[FRONT_LEFT_LEG] = 5; //  front left outer       // POSITIONS LOOKING FROM THE MIDDLE OF THE ROBOT!!!!!
26
+  board_pins[BACK_RIGHT_LEG] = 23; // back right outer
27
+  board_pins[BACK_LEFT_LEG] = 13; // back left outer
28 28
 }
29 29
 
30 30
 void LARS::init() {
@@ -152,12 +152,12 @@ void LARS::moonwalk(float steps, float T = 5000) {
152 152
 
153 153
 
154 154
 void LARS::walk(int dir, float steps, float T) {
155
-  int x_amp = 15;
155
+  int x_amp = 30;//15;
156 156
   int x_amp_test = 50;
157 157
   int z_amp = 20;
158 158
   int z_amp_test = 50;
159 159
   int ap = 20;
160
-  int hi = 23;
160
+  int hi = 0; //23;
161 161
   //int hi = -10;
162 162
   //int front_x = 12;             // inner back, inner back , outer back, outer back, inner front  , inner  front, outer front , outer front
163 163
   int front_x = 0;
@@ -165,12 +165,12 @@ void LARS::walk(int dir, float steps, float T) {
165 165
   int amplitude[] = {x_amp, x_amp, z_amp_test, z_amp_test, x_amp, x_amp, z_amp_test, z_amp_test};
166 166
   int offset[] = {   90 + ap - front_x,
167 167
                      90 - ap + front_x,
168
-                     90 - hi ,
169
-                     90 + hi,
168
+                     90 - hi +30,
169
+                     90 + hi -30,
170 170
                      90 - ap - front_x,
171 171
                      90 + ap + front_x,
172
-                     90 + hi,
173
-                     90 - hi
172
+                     90 + hi -30,
173
+                     90 - hi +30
174 174
                     /* 90,
175 175
                      90,
176 176
                      90,
@@ -182,7 +182,7 @@ void LARS::walk(int dir, float steps, float T) {
182 182
                  };
183 183
   //int  phase[] = {90, 90, 270, 90, 270, 270, 90, 270};
184 184
   int  phase[] = {270, 270, 270, 90, 90, 90, 90, 270};
185
-  if (dir == 0) { //backward
185
+  if (dir == 0) { //forward
186 186
     phase[0] = phase[1] = 90;
187 187
     phase[4] = phase[5] = 270;
188 188
   }
@@ -300,10 +300,10 @@ void LARS::wave(int legNumber){
300 300
 	  case 2 : {
301 301
 		amplitude[0] = 60;
302 302
 		int offset[]  = {
303
-			90-60 , 90-20,
304
-			90+70 , 90 ,
305
-			90 , 90+90 ,
306
-			90+140 , 90
303
+			90-20 , 90+20,
304
+			90-70 , 90 ,
305
+			90-60 , 90+90 ,
306
+			90 , 90 -70
307 307
 		};
308 308
 		memcpy ( &offsetLeg, &offset, sizeof(offset) );
309 309
 		break;
@@ -311,21 +311,21 @@ void LARS::wave(int legNumber){
311 311
 	  case 3 : {
312 312
 		amplitude[4] = 60;
313 313
 		int offset[]  = {
314
-			90-20 , 90-60,
314
+			90+40 , 90-60,
315 315
 			90 , 90+70 ,
316
-			90 , 90+90 ,
316
+			90 , 90+0 ,
317 317
 			90+140 , 90
318 318
 		};
319 319
 		memcpy ( &offsetLeg, &offset, sizeof(offset) );
320 320
 		break;
321 321
 	  }
322 322
 	  case 4 : {
323
-		amplitude[5]= 60;
323
+		amplitude[5]= 90;
324 324
 		int offset[]  = {
325 325
 			90-20 , 90-60,
326
-			90 , 90+70 ,
327
-			90 , 90+90 ,
328
-			90+140 , 90
326
+			90-70 , 90 ,
327
+			90+20 , 90+90 ,
328
+			90 , 90-70
329 329
 		};
330 330
 		memcpy ( &offsetLeg, &offset, sizeof(offset) );
331 331
 		break;

+ 1
- 1
src/LARS.h View File

@@ -20,7 +20,7 @@ class LARS {
20 20
   public:
21 21
     LARS();
22 22
     void init();
23
-    void walk(int dir = 1, float steps = 1, float T = 400);
23
+    void walk(int dir = 1, float steps = 1, float T = 800); // T initial 400
24 24
     void omniWalk(float steps, float T, bool side, float turn_factor);
25 25
     void turnL(float steps, float period);
26 26
     void turnR(float steps, float period);

Loading…
Cancel
Save