l

Dependencies:   mbed Asser2

Committer:
GuillaumeCH
Date:
Thu May 16 09:10:16 2019 +0000
Revision:
4:eac6746544fb
Parent:
3:d38aa400d5e7
Child:
5:3638d7e7c5c1
oui

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GuillaumeCH 2:3066e614372f 1 #ifndef DEPLACEMENT_H
GuillaumeCH 2:3066e614372f 2 #define DEPLACEMENT_H
GuillaumeCH 2:3066e614372f 3
GuillaumeCH 2:3066e614372f 4 #define TAILLE_TAB 250
GuillaumeCH 4:eac6746544fb 5 struct Coordonnees
GuillaumeCH 4:eac6746544fb 6 {
GuillaumeCH 4:eac6746544fb 7 double x;
GuillaumeCH 4:eac6746544fb 8 double y;
GuillaumeCH 4:eac6746544fb 9 };
GuillaumeCH 2:3066e614372f 10 class deplacement{
GuillaumeCH 2:3066e614372f 11 public:
GuillaumeCH 2:3066e614372f 12 deplacement();
GuillaumeCH 3:d38aa400d5e7 13 void initialisation(void);//init
GuillaumeCH 3:d38aa400d5e7 14
GuillaumeCH 3:d38aa400d5e7 15 void rotation_rel(double angle_vise); // rotation relative angle positif pour tourner vers la gauche
GuillaumeCH 3:d38aa400d5e7 16 void rotation_abs(double angle_vise); //rotation absolue du robot
GuillaumeCH 3:d38aa400d5e7 17
GuillaumeCH 3:d38aa400d5e7 18 void commande_vitesse(float vitesse_G, float vitesse_D); //set_PWM avec des vitesses flottantes.
GuillaumeCH 3:d38aa400d5e7 19
GuillaumeCH 3:d38aa400d5e7 20 void vitesse_nulle_D(int zero); //coupe moteur droit
GuillaumeCH 3:d38aa400d5e7 21 void vitesse_nulle_G(int zero); //coupe moteur gauche
GuillaumeCH 3:d38aa400d5e7 22
GuillaumeCH 3:d38aa400d5e7 23 void marche_arriere(int distance); // ligne droite en marche arriere, argument entier NEGATIF
GuillaumeCH 3:d38aa400d5e7 24 void ligne_droite(long int distance); // ligne droite en marche avant, argument entier POSITIF
GuillaumeCH 3:d38aa400d5e7 25
GuillaumeCH 3:d38aa400d5e7 26 void asservissement(void); // asservissement en vitesse à ne pas utiliser avec les fonctions de déplacement séquentiel
GuillaumeCH 2:3066e614372f 27 void printftab(void);
GuillaumeCH 2:3066e614372f 28 void test(void);
GuillaumeCH 2:3066e614372f 29 void changement_consigne(int cons_D, int cons_G);
GuillaumeCH 3:d38aa400d5e7 30
GuillaumeCH 3:d38aa400d5e7 31
GuillaumeCH 3:d38aa400d5e7 32 void poussette(); // set PWM 150 pendant 1.5s
GuillaumeCH 4:eac6746544fb 33 void arc(Coordonnees p1, Coordonnees p2);//p2 point final p1 point intermediaire
GuillaumeCH 4:eac6746544fb 34 int cercle(Coordonnees a,Coordonnees b, Coordonnees c);
GuillaumeCH 4:eac6746544fb 35 double int_ext_cercle(double x, double y);
GuillaumeCH 4:eac6746544fb 36 void va_au_point(double x,double y, double cap);
GuillaumeCH 4:eac6746544fb 37 double recup_angle_entre_trois_points_213(double x1,double y1,double x2,double y2,double x3,double y3);
GuillaumeCH 2:3066e614372f 38
GuillaumeCH 2:3066e614372f 39
GuillaumeCH 2:3066e614372f 40 private:
GuillaumeCH 2:3066e614372f 41 float consigne;
GuillaumeCH 2:3066e614372f 42 int consigne_D;
GuillaumeCH 2:3066e614372f 43 int consigne_G;
GuillaumeCH 2:3066e614372f 44 float somme_erreur_D;
GuillaumeCH 2:3066e614372f 45 float somme_erreur_G;
GuillaumeCH 2:3066e614372f 46 float erreur_precedente_D;
GuillaumeCH 2:3066e614372f 47 float erreur_precedente_G;
GuillaumeCH 2:3066e614372f 48 float erreur_glissee_D[5];
GuillaumeCH 2:3066e614372f 49 float erreur_glissee_G[5];
GuillaumeCH 2:3066e614372f 50 int compteur_glisse;
GuillaumeCH 2:3066e614372f 51 float Kp_D;
GuillaumeCH 2:3066e614372f 52 float Ki_D;
GuillaumeCH 2:3066e614372f 53 float Kd_D;
GuillaumeCH 2:3066e614372f 54 float Kp_G;
GuillaumeCH 2:3066e614372f 55 float Ki_G;
GuillaumeCH 2:3066e614372f 56 float Kd_G;
GuillaumeCH 2:3066e614372f 57 long int tick_prec_D;
GuillaumeCH 2:3066e614372f 58 long int tick_prec_G;
GuillaumeCH 2:3066e614372f 59 float tab_cmd_D[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 60 float tab_cmd_G[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 61 float vtab_D[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 62 float vtab_G[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 63 float erreur_tab_G[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 64 float erreur_tab_D[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 65 float somme_erreur_tab_G[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 66 float somme_erreur_tab_D[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 67 float c_D[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 68 float c_G[TAILLE_TAB];
GuillaumeCH 2:3066e614372f 69 int dix_ms;
GuillaumeCH 2:3066e614372f 70 int consigne_tab[20][2];
GuillaumeCH 2:3066e614372f 71 int compteur_asser;
GuillaumeCH 2:3066e614372f 72 double somme_y;
GuillaumeCH 4:eac6746544fb 73 double point[3];
GuillaumeCH 2:3066e614372f 74 };
GuillaumeCH 2:3066e614372f 75
GuillaumeCH 2:3066e614372f 76
GuillaumeCH 2:3066e614372f 77 #endif