summaryrefslogtreecommitdiff
path: root/i/marvin/src/es/es.hh
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/es/es.hh')
-rw-r--r--i/marvin/src/es/es.hh19
1 files changed, 16 insertions, 3 deletions
diff --git a/i/marvin/src/es/es.hh b/i/marvin/src/es/es.hh
index cbf989e..600a480 100644
--- a/i/marvin/src/es/es.hh
+++ b/i/marvin/src/es/es.hh
@@ -36,6 +36,7 @@ class Config;
class Es : public Proto::Receiver
{
typedef std::vector<int> Sharps;
+
private:
// Objet Proto de communication vers la carte es
Proto proto_;
@@ -44,7 +45,7 @@ class Es : public Proto::Receiver
/// Système de log
Log log_;
/// For LCD communication
- char lcd_mess_char_[32];
+ char lcd_mess_char_[16];
/// Key pressed by the LCD Keyboard
int lcdKeyPressed_, lcdKeyStat_;
/// Frontal choc !
@@ -63,8 +64,6 @@ class Es : public Proto::Receiver
int rvbSniffMaskStat_, rvbSniffStat_;
/// RVB Sensors raw stats
int rvbBallStat_;
- /// Balls RVB
- int rvbBall_[2];
/// Sharps
Sharps sharps_;
/// Others module, jack & colour
@@ -72,8 +71,18 @@ class Es : public Proto::Receiver
int othersStat_;
/// Stat of front sensors
int rvbSniffFrontStat_;
+ int thresholdFrontSensors_, thresholdBallSensors_, thresholdHoleSensors_;
+
+
+ /// System for analyse a ball
+ int seenColors_[5], lastSeenColors_[5], comptSeenColors_[5];
public:
+ // Some fucking defines !
+ const int unknownColor_, redColor_, blueColor_, greenColor_, whiteColor_,
+ blackColor_;
+ const int leftFrontRVB_, rightFrontRVB_, holeRVB_, frontBallRVB_,
+ rearBallRVB_;
/// Constructeur
Es (const Config & config);
/// On attend ...
@@ -157,9 +166,13 @@ class Es : public Proto::Receiver
void rotationBarillet(int posFinal);
/// Empty everything in the barillet
void barilletEmpty (void);
+ /// What color do you see my lord ?
+ int colorSeen (int sensor_num);
private:
/// Decode a color into a string
std::string decodeColor (int color);
+ /// Update system for one sensor
+ void updateAnalysisSensor (int value, int index, int threshold);
};
#endif // es_hh