From c60d987228c653e19ce9f9386b3fef7fc28cb396 Mon Sep 17 00:00:00 2001 From: dufourj Date: Wed, 24 May 2006 23:24:17 +0000 Subject: Es : - analysis system for seen color. ES : - add stat function for hole RVB sensor. --- i/marvin/src/es/es.hh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'i/marvin/src/es/es.hh') 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 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 -- cgit v1.2.3