2.s994 Project

Dependencies:   QEI mbed

Files at this revision

API Documentation at this revision

Comitter:
calamaridudeman
Date:
Wed Dec 04 02:58:18 2013 +0000
Parent:
57:dfea5d24d650
Commit message:
KANKAN CAN DO STUFF!!!!

Changed in this revision

Master.cpp Show annotated file Show diff for this revision Revisions of this file
src/kangaroo.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Master.cpp	Tue Dec 03 10:01:18 2013 +0000
+++ b/Master.cpp	Wed Dec 04 02:58:18 2013 +0000
@@ -46,13 +46,14 @@
 int main() {
        kankan.start();
        kankan.zero();
-       /*m1.stop();
+       /*
+       m1.stop();
        m2.stop();
        while(1){
         kankan.testEncoders(pc);
         wait(.1);
-       }*/
-
+       }
+*/
         //Initalize Control Varialbes
         int Phase = 0;//Flight Phase
         
@@ -62,7 +63,7 @@
                 //FLIGHT(initM1, initM2);
                 //m1.setPos(-0.5);
                 led1=0;
-                kankan.setPoint(Point(0.12,-.15,0));
+                kankan.setPoint(Point(0.12,-.12,0));
                 if(kankan.landDetection()){
                     //Landed going to Phase 1
                     //Record initial Length.                   
@@ -72,7 +73,7 @@
             led1=1; //landing detected
             //Uses SLIP Model to Control
           
-                kankan.slip(1000,Point(-.08,-1.0,0), pc);
+                kankan.slip(750,Point(-.08,-1.5,0), pc);
                 //kankan.testEncoders(pc);
                 //m1.setPos(-1);
                 if(!kankan.landDetection()){
--- a/src/kangaroo.cpp	Tue Dec 03 10:01:18 2013 +0000
+++ b/src/kangaroo.cpp	Wed Dec 04 02:58:18 2013 +0000
@@ -24,7 +24,7 @@
     //m1.zero();
     //m2.zero();
     m1.calibAngle(0.0);
-    m2.calibAngle(2.44);
+    m2.calibAngle(2.25);//2.44
     
     wait(.1);
     
@@ -62,9 +62,9 @@
 
 void Kangaroo::testEncoders(Serial &pc){
     //pc.printf("hello world\n");
-    //pc.printf("x: %f   y: %f\n", getPoint().x, getPoint().y);
+    pc.printf("x: %f   y: %f  b: %f\n", getPoint().x, getPoint().y, getAngle2());
     
-    pc.printf("t1: %f  t2: %f b1: %f  b2: %f \n",m1.getAngle(), m2.getAngle(), getAngle1(), getAngle2());
+    //pc.printf("t1: %f  t2: %f b1: %f  b2: %f \n",m1.getAngle(), m2.getAngle(), getAngle1(), getAngle2());
     
     //pc.printf("m1: %f  m2:  %f\n",dt1, dt2);
 }
@@ -77,7 +77,7 @@
     joint_h = lg*sin(th3)+h;
     float th4 = getAngle2();
     leg_y = -1*(-l1+getPoint().y)*cos(th4);
-    return joint_h<(leg_y+.013);
+    return joint_h<(leg_y+.021);//.013
 }
 
 Point Kangaroo::getPoint(){
@@ -88,7 +88,7 @@
 }
 
 float Kangaroo::getAngle2(){
-    return (enc2.getAngle())-1.65;//-1.65
+    return (enc2.getAngle())-1.45;//-1.65
 }