Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Classes/NXPCam.h@3:07109a6bb472, 2020-03-12 (annotated)
- Committer:
- EISR
- Date:
- Thu Mar 12 15:22:02 2020 +0000
- Revision:
- 3:07109a6bb472
- Parent:
- 2:1103f5d61035
commentaires de la partie bluetooth;
Who changed what in which revision?
| User | Revision | Line number | New 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 | |
| EISR | 3:07109a6bb472 | 34 | int xG,xD; |
| EISR | 3:07109a6bb472 | 35 | |
| Wael_H | 2:1103f5d61035 | 36 | void affVectors() const; |
| Wael_H | 2:1103f5d61035 | 37 | void affDiffs() const; |
| Wael_H | 2:1103f5d61035 | 38 | |
| Wael_H | 0:8743b606abc3 | 39 | private: |
| Wael_H | 0:8743b606abc3 | 40 | PIXY2 pixy; |
| Wael_H | 1:a9af73d5abd4 | 41 | Vector v1, v2, v3; |
| Wael_H | 2:1103f5d61035 | 42 | Vector v1past, v2past; |
| Wael_H | 0:8743b606abc3 | 43 | }; |
| Wael_H | 0:8743b606abc3 | 44 | |
| Wael_H | 0:8743b606abc3 | 45 | #endif // NXPCAM_H |