Robot's source code

Dependencies:   mbed

Committer:
Jagang
Date:
Mon May 11 20:32:11 2015 +0000
Revision:
123:55e5e9acc541
Parent:
121:0cc17ba879cb
Maj AI; Repositionnement du d?part (1000,177); Ajout de l'action sur les claps

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 117:f8c147141a0c 16 void stop(void);
sype 108:890094ee202a 17 bool isArrived(void) {return arrived;}
sype 85:8e95432d99d3 18 float carre(float x) {return x*x;}
sype 106:05096985d1b2 19 float Kp_angle, Kd_angle, Ki_angle;
sype 85:8e95432d99d3 20 float Kp_distance, Ki_distance, Kd_distance;
sype 64:6489bcfc1173 21
sype 64:6489bcfc1173 22 private:
Jagang 71:95d76c181b22 23 Odometry2 &m_odometry;
Jagang 62:454cd844fe1e 24 Motor &m_motorL;
Jagang 62:454cd844fe1e 25 Motor &m_motorR;
sype 64:6489bcfc1173 26
sype 116:73d7d87e0299 27 float cmd;
sype 64:6489bcfc1173 28 float cmd_g, cmd_d;
sype 116:73d7d87e0299 29 float limite;
sype 121:0cc17ba879cb 30 float lim_min, lim_max;
sype 116:73d7d87e0299 31
sype 116:73d7d87e0299 32 float somme_erreur_theta, somme_erreur_distance;
sype 116:73d7d87e0299 33 float delta_erreur_theta, delta_erreur_distance;
sype 116:73d7d87e0299 34 float erreur_precedente_theta, erreur_precedente_distance;
sype 106:05096985d1b2 35 float distanceGoal, distance;
sype 85:8e95432d99d3 36 float thetaGoal;
sype 116:73d7d87e0299 37
sype 116:73d7d87e0299 38 float m_goalX, m_goalY, m_goalPhi;
sype 116:73d7d87e0299 39
sype 108:890094ee202a 40 bool arrived, squip;
sype 79:d97090bb6470 41 int N;
Jagang 71:95d76c181b22 42
Jagang 71:95d76c181b22 43 char state;
sype 79:d97090bb6470 44 //char etat_angle;
sype 106:05096985d1b2 45 };
sype 106:05096985d1b2 46
Jagang 110:7e71e5cd8197 47
Jagang 109:53918ba98306 48 #endif