Robot's source code

Dependencies:   mbed

Committer:
sype
Date:
Tue May 05 05:05:07 2015 +0000
Revision:
106:05096985d1b2
Parent:
93:4d5664e9188a
Child:
108:890094ee202a
Asserv B

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sype 106:05096985d1b2 1 #ifndef PLANB_H
sype 106:05096985d1b2 2 #define PLANB_H
sype 106:05096985d1b2 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);
sype 106:05096985d1b2 15 void setGoal(float x, float y);
Jagang 93:4d5664e9188a 16 bool isArrived(void) {return done;}
sype 85:8e95432d99d3 17 float carre(float x) {return x*x;}
sype 106:05096985d1b2 18 float Kp_angle, Kd_angle, Ki_angle;
sype 85:8e95432d99d3 19 float Kp_distance, Ki_distance, Kd_distance;
sype 64:6489bcfc1173 20
sype 64:6489bcfc1173 21 private:
Jagang 71:95d76c181b22 22 Odometry2 &m_odometry;
Jagang 62:454cd844fe1e 23 Motor &m_motorL;
Jagang 62:454cd844fe1e 24 Motor &m_motorR;
sype 64:6489bcfc1173 25
sype 64:6489bcfc1173 26 float erreur_g, vitesse_g;
sype 64:6489bcfc1173 27 float erreur_d, vitesse_d;
sype 64:6489bcfc1173 28 float cmd_g, cmd_d;
sype 64:6489bcfc1173 29 float consigne_g, consigne_d;
sype 79:d97090bb6470 30 float somme_erreur, somme_erreur_d;
sype 79:d97090bb6470 31 float erreur_precedente;
sype 106:05096985d1b2 32 float m_goalX, m_goalY, m_goalPhi;
sype 106:05096985d1b2 33 float distanceGoal, distance;
sype 85:8e95432d99d3 34 float thetaGoal;
sype 85:8e95432d99d3 35 float memo_g, memo_d;
sype 106:05096985d1b2 36 bool done, squip;
sype 79:d97090bb6470 37 int N;
Jagang 71:95d76c181b22 38
Jagang 71:95d76c181b22 39 char state;
sype 79:d97090bb6470 40 //char etat_angle;
Jagang 71:95d76c181b22 41
sype 79:d97090bb6470 42 float cmd;
sype 70:56086a37f31f 43 float erreur_position_g, position_g;
sype 70:56086a37f31f 44 float erreur_position_d, position_d;
sype 70:56086a37f31f 45 float consigne_position_g, consigne_position_d;
sype 64:6489bcfc1173 46
sype 106:05096985d1b2 47 };
sype 106:05096985d1b2 48
sype 106:05096985d1b2 49 #endif