summaryrefslogtreecommitdiff
path: root/i/marvin/src/es/es.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/es/es.cc')
-rw-r--r--i/marvin/src/es/es.cc16
1 files changed, 14 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