Nathaniel Honka / initExoVars

Fork of initExoVars by HEL's Angels

Revision:
12:3a5a9bbf1c93
Parent:
11:7b7d30293fb7
--- a/initExoVars.cpp	Tue Jun 30 04:44:30 2015 +0000
+++ b/initExoVars.cpp	Tue Jun 30 05:04:17 2015 +0000
@@ -111,11 +111,9 @@
 // zero_enc_offset_R should be negative
 //float zero_enc_offset_R = -135.17;
 //float bob_dole=-135.17;
-//extern float 
-float zero_enc_offset_L=EncOffset_L;
-//extern float 
-//float zero_enc_offset_Right=EncOffset_R;
-float bob_dole=EncOffset_R;
+float zero_enc_offset_L;//=LeftCalib;
+float zero_enc_offset_R;//=RightCalib;
+//float bob_dole;//=RightCalib;
 
 
 //Offset for Test Rig
@@ -151,32 +149,18 @@
 LinearBlend blend_left;
 LinearBlend blend_right;
 
-/*void readCalib()
-{
-    char A[10];
-    LocalFileSystem local("local");               // Create the local filesystem under the name "local"
-    FILE *set = fopen("/local/calib.txt", "r");  // Open "setup.txt" on the local file system for read
-    fscanf(set,"%s %f",A,&zero_enc_offset_L); // read offset
-    fscanf(set,"%s %f",A,&zero_enc_offset_R); // read offset
-    fclose(set);
-    wait(1); //TODO(Cashdollar): reduce this time after testing
-    pc.printf("\r\nLeft Offset is: %f, \r\nRight Offset is: %f\r\n", zero_enc_offset_L, zero_enc_offset_R);//, zero_enc_offset_R);
-    wait(1); //TODO(Cashdollar): Delete after testing, this is to make it easier to see what is happening
-}*/
 
 void initializeExoIOs()
 {
     // Putting various comm pins high
     DB_cs = 1; // Setting SPI CS pin high (so low selects the slave)
-    //pc.baud(921600);
-    //pc.baud(921600);
-    //readCalib();
+
     localRead();
-    pc.printf("I read the local file!");
-    pc.printf("\r\nNew left offset:%f, New left offset:%f", zero_enc_offset_L, zero_enc_offset_R);
+    zero_enc_offset_L=LeftCalib;
+    zero_enc_offset_R=RightCalib;
+    
     zero_ang_L=zero_enc_offset_L+stand_adjust;
     zero_ang_R=zero_enc_offset_R+stand_adjust;
-    pc.printf("\r\nzero ang assigned");
 
     // initialize both knees
     knee_L.init();
@@ -197,7 +181,6 @@
     encoder_L.rangeCheck();
     encoder_R.rangeCheck();
     fsm.init();
-    pc.printf("Test2 \r\n");
 
 
     dataBedSPI.frequency(10000000);
@@ -217,8 +200,6 @@
     gait_params.max_angle=30;
     gait_params.max_fs_angle=mm_gait_params.max_angle*1.16;
 
-    //swing.set(mm_gait_params);
-    //stance.set(mm_gait_params);
     swing.set(gait_params);
     stance.set(gait_params);
     fsSwing.set(mm_gait_params);
@@ -229,9 +210,7 @@
 
 
     // print each knee status
-
-    pc.printf("knee_L: %x, knee_R:%x\r\n,", knee_L.status(), knee_R.status());
-
+    pc.printf("knee_L: %x, knee_R:%x\r\n", knee_L.status(), knee_R.status());
 
 }