summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/skittle.hh
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/ovision/see/skittle.hh')
-rw-r--r--2005/i/robert/src/ovision/see/skittle.hh16
1 files changed, 15 insertions, 1 deletions
diff --git a/2005/i/robert/src/ovision/see/skittle.hh b/2005/i/robert/src/ovision/see/skittle.hh
index d2c5dbe..ebdeb6f 100644
--- a/2005/i/robert/src/ovision/see/skittle.hh
+++ b/2005/i/robert/src/ovision/see/skittle.hh
@@ -24,6 +24,7 @@
#define skittle_h
#include <vector>
+#include <math.h>
#include "segm.hh"
#include "oconfig.hh"
@@ -39,6 +40,10 @@ class Skittle
OConfig *oconfig_;
/// Classe img
Img *img_;
+ /// Composante principale
+ double pcX_, pcY_;
+ /// Position
+ double bend_;
public:
/// debout/couché/erreur
@@ -48,7 +53,9 @@ class Skittle
/// Destructeur
~Skittle (void);
/// Analyse d'une zone
- bool analyse (Zone &zone);
+ bool analyse (Zone &zone, std::vector<Zone> &listReflectBand);
+ /// Affiche les infos sur la quille
+ void show () const;
private:
/// Recherche de la composante principale
@@ -57,10 +64,17 @@ class Skittle
BendType bend (Zone &zone);
/// Utilisé pour la recherche de la courbure, cherche le point le plus haut
int climb (const int startX, const int startY, const int color);
+ /// Vérifie qu'un catadiopre est à proximité
+ int isReflectBand (Zone &zone, std::vector<Zone> &listReflectBand);
/// Renvoie le minimum en fonction d'une bordure
inline int minWithBorder (int n, int min) {return n > min ? n : min;}
/// Renvoie le maximum en fonction d'une bordure
inline int maxWithBorder (int n, int max) {return n < max ? n : max;}
+ /// Distance cartésienne
+ inline double dist (double x1, double x2, double y1, double y2) {return sqrt (x1*x2 + y1*y2);}
+ /// Distance orthogonale à une droite
+ inline double orthoDist (double v1x, double v1y, double v2x, double v2y)
+ {return ((v1x*v2y - v2x*v1y) / sqrt (v2x*v2x + v2y*v2y));}
};
#endif // skittle_h