Robot's source code

Dependencies:   mbed

Committer:
Jagang
Date:
Tue May 05 16:35:53 2015 +0000
Revision:
109:53918ba98306
Parent:
93:4d5664e9188a
Child:
110:7e71e5cd8197
IA

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jagang 109:53918ba98306 1 #ifndef PLAN_H
Jagang 109:53918ba98306 2 #define PLAN_H
Jagang 109:53918ba98306 3
sype 59:67e0d6ed44b6 4 #include "mbed.h"
Jagang 71:95d76c181b22 5 #include "Odometry2.h"
Jagang 62:454cd844fe1e 6 #include "Motor.h"
sype 59:67e0d6ed44b6 7
Jagang 62:454cd844fe1e 8 class aserv_planB
Jagang 62:454cd844fe1e 9 {
sype 64:6489bcfc1173 10 public:
Jagang 71:95d76c181b22 11 aserv_planB(Odometry2 &odometry,Motor &motorL,Motor &motorR);
Jagang 62:454cd844fe1e 12 void update(float dt);
sype 64:6489bcfc1173 13 void control_speed();
Jagang 71:95d76c181b22 14 void setGoal(float x, float y, float theta);
Jagang 93:4d5664e9188a 15 bool isArrived(void) {return done;}
sype 85:8e95432d99d3 16 float carre(float x) {return x*x;}
sype 85:8e95432d99d3 17 float Kp_angle, Kd_angle;
sype 85:8e95432d99d3 18 float Kp_distance, Ki_distance, Kd_distance;
sype 64:6489bcfc1173 19
sype 64:6489bcfc1173 20 private:
Jagang 71:95d76c181b22 21 Odometry2 &m_odometry;
Jagang 62:454cd844fe1e 22 Motor &m_motorL;
Jagang 62:454cd844fe1e 23 Motor &m_motorR;
sype 64:6489bcfc1173 24
sype 64:6489bcfc1173 25 float erreur_g, vitesse_g;
sype 64:6489bcfc1173 26 float erreur_d, vitesse_d;
sype 64:6489bcfc1173 27 float cmd_g, cmd_d;
sype 64:6489bcfc1173 28 float consigne_g, consigne_d;
sype 79:d97090bb6470 29 float somme_erreur, somme_erreur_d;
sype 79:d97090bb6470 30 float erreur_precedente;
Jagang 71:95d76c181b22 31 float m_goalX, m_goalY, m_goalTheta;
sype 85:8e95432d99d3 32 float distance_g, distance_d;
sype 85:8e95432d99d3 33 float thetaGoal;
sype 85:8e95432d99d3 34 float memo_g, memo_d;
sype 79:d97090bb6470 35 bool done;
sype 79:d97090bb6470 36 int N;
Jagang 71:95d76c181b22 37
Jagang 71:95d76c181b22 38 char state;
sype 79:d97090bb6470 39 //char etat_angle;
Jagang 71:95d76c181b22 40
sype 79:d97090bb6470 41 float cmd;
sype 70:56086a37f31f 42 float erreur_position_g, position_g;
sype 70:56086a37f31f 43 float erreur_position_d, position_d;
sype 70:56086a37f31f 44 float consigne_position_g, consigne_position_d;
sype 64:6489bcfc1173 45
Jagang 109:53918ba98306 46 };
Jagang 109:53918ba98306 47
Jagang 109:53918ba98306 48 #endif