Robot's source code
Dependencies: mbed
Diff: main.cpp
- Revision:
- 62:454cd844fe1e
- Parent:
- 60:546d7b43333b
- Child:
- 63:fd9af0693e50
diff -r 0e99df5f29b0 -r 454cd844fe1e main.cpp --- a/main.cpp Thu Apr 09 16:54:15 2015 +0000 +++ b/main.cpp Thu Apr 09 17:05:06 2015 +0000 @@ -9,6 +9,7 @@ #include "Odometry.h" //#include "Asserv.h" +#include "planB.h" #include "Motor.h" /*----------------------------------------------------------------------------------------------*/ /*Serial*/ @@ -84,14 +85,21 @@ //Asserv<float> instanceAsserv(&odometry); /*----------------------------------------------------------------------------------------------*/ - //instanceAsserv.setGoal( (float)0,(float)0, (float)PI/2); + //instanceAsserv.setGoal( (float)0,(float)0, (float)PI/2); + + aserv_planB asserv(odometry,motorL,motorR); + + t.start(); while(!testOdo) { //Asservissement : - t.start(); + + asserv.update(t.read()); + t.reset(); + //instanceAsserv.update((float)t.read()); //Mat<float> X( instanceAsserv.getX() ); //float phi_r = (float)instanceAsserv.getPhiR(); @@ -112,13 +120,7 @@ //z.afficherMblue(); //motorR.setSpeed(0.08+(phi_r/phi_max) ); - //motorL.setSpeed(0.06+(phi_l/phi_max) ); - - //Timer Handling : - t.stop(); - //logger.printf("%f s ecoulee.\n\r", t.read()); - t.reset(); - t.start(); + //motorL.setSpeed(0.06+(phi_l/phi_max) ); }