summaryrefslogtreecommitdiff
path: root/i/marvin/src/es
diff options
context:
space:
mode:
authordufourj2006-05-26 22:02:30 +0000
committerdufourj2006-05-26 22:02:30 +0000
commit526a70ea2f2505d512b6567ebf052ad0b65c2319 (patch)
tree743dc77b9f594d5b096169d38df3847bf9a879f3 /i/marvin/src/es
parente9a0712596a4d481ba4ecd5f4a25d55da462aaaa (diff)
Asserv :
- activation des stats pour savoir la position ; - correction d'un facteur de 256 ; Es : - correction du bug pour la détection de couleurs du trou. Ai : - amélioration de l'algo.
Diffstat (limited to 'i/marvin/src/es')
-rw-r--r--i/marvin/src/es/es.cc16
-rw-r--r--i/marvin/src/es/es.hh2
2 files changed, 16 insertions, 2 deletions
diff --git a/i/marvin/src/es/es.cc b/i/marvin/src/es/es.cc
index 03fa74b..66a8fc9 100644
--- a/i/marvin/src/es/es.cc
+++ b/i/marvin/src/es/es.cc
@@ -316,6 +316,7 @@ Es::deposeBalle(void)
barilletDebutLancement();
log_ ("Es::Barillet", Log::debug) << "DROP!! ";
frontTurbineIsFull_ = false;
+ wait (400);
barilletLancement();
}
@@ -497,6 +498,7 @@ void Es::receive(char command, const Proto::Frame & frame)
case 4:
// A ball has been by the sensor at the front of the barillet
enableAllSensors (true);
+ setRVBBallStat (5);
break;
}
shutUp ();
@@ -539,10 +541,13 @@ void Es::receive(char command, const Proto::Frame & frame)
case 'B':
if (proto_.decode (frame, "bb", stat1 /* Rear */, stat2 /* Front */))
{
- //log_ ("Stats RVB Ball", Log::debug) << "[" << decodeColor
- // (stat1) << "] [" << decodeColor (stat2) << "]";
+// log_ ("Stats RVB Ball", Log::debug) << "[" << decodeColor
+// (stat1) << "] [" << decodeColor (stat2) << "]";
updateAnalysisSensor (stat1, rearBallRVB_, thresholdBallSensors_);
updateAnalysisSensor (stat2, frontBallRVB_, thresholdBallSensors_);
+ log_ ("Ball") << "Devant : " << (colorSeen (frontBallRVB_) ==
+ whiteColor_ ? "white" : "black") << " Arr : " << (colorSeen
+ (rearBallRVB_) == whiteColor_ ? "white" : "black");
}
break;
/* Others */
@@ -585,6 +590,11 @@ void Es::receive(char command, const Proto::Frame & frame)
}
}
+void Es::setRVBHoleStat (int freq)
+{
+ proto_.send ('D', "b", freq);
+}
+
/// Decode a color into a string
std::string
Es::decodeColor (int color)
@@ -657,6 +667,7 @@ Es::newBallFront(void)
barilletLancement();
log_ ("Es::Barillet", Log::debug) << "gobage balle par l'avant.";
enableAllSensors (false);
+ setRVBBallStat (0);
}
/// Analyse une balle arrivant par derrière
@@ -696,6 +707,7 @@ Es::newBallRear(void)
}
log_ ("Es::Barillet", Log::debug) << "gobage balle par l'arriere.";
enableAllSensors (false);
+ setRVBBallStat (0);
}
/// Update system for one sensor
diff --git a/i/marvin/src/es/es.hh b/i/marvin/src/es/es.hh
index 94bb68d..0a53ff3 100644
--- a/i/marvin/src/es/es.hh
+++ b/i/marvin/src/es/es.hh
@@ -134,6 +134,8 @@ class Es : public Proto::Receiver
void setRVBSniffFrontStat (int freq);
/// Enable all the sensors or just the 4 and 1 near the ground
void enableAllSensors (bool enable);
+ //
+ void setRVBHoleStat (int freq);
/// Set frequency of jack, selectoul printed out function
/// Use this function with frequency 0 to disable this stat.