![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All the lab works are here!
Dependencies: ISR_Mini-explorer mbed
Fork of VirtualForces by
Diff: main.cpp
- Revision:
- 7:c94070f9af78
- Parent:
- 6:afde4b08166b
- Child:
- 8:109314be5b68
--- a/main.cpp Fri Mar 24 17:39:24 2017 +0000 +++ b/main.cpp Fri Mar 24 18:02:57 2017 +0000 @@ -12,13 +12,14 @@ pc.baud(9600); // baud for the pc communication //Target example x,y values - float target_x=46.8, target_y=78.6, target_angle=0; + float target_x=46.8, target_y=78.6, target_angle=1.7; float alpha; //angle error float rho; //distance from target float beta; //float k_linear=10, k_angular=200; - float kRho=12, ka=25, kb=-15; + //kb = -15 and ka = 30 tabom + float kRho=12, ka=30, kb=-13; float linear, angular, angular_left, angular_right; float dt=0.5; float temp; @@ -102,10 +103,10 @@ leftMotor(1,angular_left); rightMotor(1,angular_right); - wait(0.5); + wait(0.2); //Timer stuff t.stop(); - } while(d2>2); + } while(d2>1); //Stop at the end leftMotor(1,0);