NXPCup_Cachan / Mbed 2 deprecated NXPCup

Dependencies:   mbed

Committer:
Wael_H
Date:
Wed Mar 11 14:24:48 2020 +0000
Revision:
2:1103f5d61035
Parent:
1:a9af73d5abd4
Child:
3:07109a6bb472
publish IHM_bt pour ajout de commentaires

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wael_H 0:8743b606abc3 1 #ifndef NXPCAM_H
Wael_H 0:8743b606abc3 2 #define NXPCAM_H
Wael_H 0:8743b606abc3 3
Wael_H 0:8743b606abc3 4 #include "PIXY2.h"
Wael_H 0:8743b606abc3 5 #include "Vector.h"
Wael_H 0:8743b606abc3 6
Wael_H 2:1103f5d61035 7 #define SCREEN_CENTER 39 // resolution : 79 - 52
Wael_H 0:8743b606abc3 8 #define INFO_NON_EXPLOITABLE 404
Wael_H 0:8743b606abc3 9
Wael_H 2:1103f5d61035 10 #define COEFF_VIRAGE 80 // + il est élevé + on tourne dans les virages
Wael_H 2:1103f5d61035 11
Wael_H 0:8743b606abc3 12 class NXPCam
Wael_H 0:8743b606abc3 13 {
Wael_H 0:8743b606abc3 14 public:
Wael_H 0:8743b606abc3 15 NXPCam();
Wael_H 0:8743b606abc3 16
Wael_H 2:1103f5d61035 17 /// STRATEGIE 1 ///
Wael_H 2:1103f5d61035 18 void init();
Wael_H 0:8743b606abc3 19 /* Fonction qui renvoie une valeur entre -100 et 100 (à peu près)
Wael_H 0:8743b606abc3 20 * correspondant à l'écart de trajectoire entre la piste et
Wael_H 0:8743b606abc3 21 * le milieu de l'écran de la Pixy.
Wael_H 0:8743b606abc3 22 * La valeur est positive lorsque la voiture est trop à droite
Wael_H 0:8743b606abc3 23 * et négative lorsqu'elle est trop à gauche */
Wael_H 0:8743b606abc3 24 int getDeviationTrajectoire();
Wael_H 0:8743b606abc3 25 int getNormeVecteurs();
Wael_H 1:a9af73d5abd4 26
Wael_H 1:a9af73d5abd4 27 // Fonctions outils
Wael_H 1:a9af73d5abd4 28 int getXinutile(int x0, int x1, int x2);
Wael_H 1:a9af73d5abd4 29 int getXinutile(int x0, int x1, int x2, int x0past, int x1past);
Wael_H 0:8743b606abc3 30
Wael_H 2:1103f5d61035 31 /// STRATEGIE 2 ///
Wael_H 2:1103f5d61035 32 Point getPointDir(Vector& v1, Vector& v2);
Wael_H 2:1103f5d61035 33
Wael_H 2:1103f5d61035 34 void affVectors() const;
Wael_H 2:1103f5d61035 35 void affDiffs() const;
Wael_H 2:1103f5d61035 36
Wael_H 0:8743b606abc3 37 private:
Wael_H 0:8743b606abc3 38 PIXY2 pixy;
Wael_H 1:a9af73d5abd4 39 Vector v1, v2, v3;
Wael_H 2:1103f5d61035 40 Vector v1past, v2past;
Wael_H 0:8743b606abc3 41 };
Wael_H 0:8743b606abc3 42
Wael_H 0:8743b606abc3 43 #endif // NXPCAM_H