Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Master.cpp
- Revision:
- 56:7015e2e79ea7
- Parent:
- 55:ff84fbdfd1d1
- Child:
- 57:dfea5d24d650
--- a/Master.cpp Mon Dec 02 23:15:15 2013 +0000 +++ b/Master.cpp Tue Dec 03 02:49:30 2013 +0000 @@ -31,12 +31,9 @@ int ks = 0.5; //float mag = (initLen-length)*ks; //Apply Forward Kinematics - kankan.setPoint(Point((1+ks)*x,(1+ks)*y,0)); - //Point output = Point(-mag*x/length,-mag*y/length,0); - //Point output((1+ks)*x,(1+ks)*y,0); //try just position scaling for slip - //Joints dtheta = invKinBody(output); - //m1.setPos(dtheta.t1); - //m2.setPos(dtheta.t2); + Point slip_p = Point((1+ks)*x,(1+ks)*y,0); + kankan.setPoint(slip_p); + return 1; } int FLIGHT(float initM1, float initM2){ @@ -50,17 +47,6 @@ kankan.start(); kankan.zero(); - Point p1(0,-.1,0); - Point p2(0,-.6,0); - Point p3(0,-.1,0); - Point p[3]={p1, p2, p3}; - BezCurve curve(p, 3); - curve.startCurve(); - - - //kankan.start(); - /* - //Initalize Control Varialbes int Phase = 0;//Flight Phase int initLen = 0.08;//0.17; @@ -84,7 +70,8 @@ led1=1; //landing detected //Uses SLIP Model to Control - SLIP(initLen); + kankan.slip(1000,Point(.05,-.18,0), pc); + //kankan.testEncoders(pc); //m1.setPos(-1); if(!kankan.landDetection()){ //Lift Up going to Phase 0 @@ -93,17 +80,6 @@ } } - wait(3); - */ - while(!curve.isDone()){ - //kankan.testEncoders(pc); - curve.incrementAlpha(); - Point end = curve.getPoint(); - - kankan.setPoint(end); - - wait(.05); - } m1.stop();