summaryrefslogtreecommitdiff
path: root/i/chuck/src/es/es.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/chuck/src/es/es.cc')
-rw-r--r--i/chuck/src/es/es.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/i/chuck/src/es/es.cc b/i/chuck/src/es/es.cc
index 237b7db..e1ea228 100644
--- a/i/chuck/src/es/es.cc
+++ b/i/chuck/src/es/es.cc
@@ -70,6 +70,8 @@ Es::loadConfig (const Config & config)
lcdKeyStat_ = config.get<int> ("es.lcd_key_stat");
thresholdFrontSensors_ = config.get<int> ("es.threshold_front_sensors");
thresholdHoleSensors_ = config.get<int> ("es.threshold_hole_sensors");
+ thresholdSharp_ = config.get<int> ("es.threshold_sharp");
+ freqSharp_ = config.get<int> ("es.freq_sharp");
}
void
@@ -83,6 +85,9 @@ Es::reset (void)
setAckStat (ackFreq_);
setOthersStat (othersStat_);
lcdGetKey (lcdKeyStat_);
+ // XXX Hardcoded value !
+ setSharpThreshold (1, thresholdSharp_, thresholdSharp_);
+ launchSharpDetection ();
log_ ("Es", Log::debug) << "Reset Es done.";
}
@@ -191,6 +196,11 @@ void Es::receive(char command, const Proto::Frame & frame)
log_ ("Ack", Log::debug) << "ErrCode :" << errCode;
switch (errCode)
{
+ // XXX Yerka hardcoded
+ case 1:
+ log_ ("Ack", Log::debug) << "Ack sharp has seen something";
+ ackSharp_ = true;
+ break;
}
shutUp ();
}
@@ -273,3 +283,11 @@ Es::roulo_tombe(void)
proto_.send('m',"bb",0x00,0x7b);
}
+
+/// Restart the detection of something front
+void
+Es::launchSharpDetection (void)
+{
+ setSharpUpdate (2, freqSharp_);
+}
+