summaryrefslogtreecommitdiff
path: root/2005
diff options
context:
space:
mode:
authorhaller2005-05-03 23:28:11 +0000
committerhaller2005-05-03 23:28:11 +0000
commit994270d9db219b565fcf940c6214e046f91aba35 (patch)
treebc2568f7c39e367ae4e1f158a9c2bad074655f97 /2005
parentfbd622aa98531d674e26e7ee60d11b4dd7ed05cf (diff)
Implémentation des scheduler dans ai
Diffstat (limited to '2005')
-rw-r--r--2005/i/robert/src/ai/ai.cc11
-rw-r--r--2005/i/robert/src/ai/ai.hh4
2 files changed, 13 insertions, 2 deletions
diff --git a/2005/i/robert/src/ai/ai.cc b/2005/i/robert/src/ai/ai.cc
index 7331d8c..cdb9d4c 100644
--- a/2005/i/robert/src/ai/ai.cc
+++ b/2005/i/robert/src/ai/ai.cc
@@ -25,12 +25,21 @@
#include"ai.hh"
+static void
+callback (void)
+{
+}
+
/// Constructeur
Ai::Ai(const Config & config)
:motor_(config), es_(config),
roundDuration_(config.get<int>("ai.roundDuration")),
- vitesseAsc_(config.set<int>("ai.vitesseAsc"))
+ vitesseAsc_(config.set<int>("ai.vitesseAsc")),
+ schedulableMotor_ (callback, motor_.getFd ()),
+ schedulableEs_ (callback, es_.getFd ())
{
+ scheduler_.insert (schedulableMotor_);
+ scheduler_.insert (schedulableEs_);
}
/// Initialise le robot
diff --git a/2005/i/robert/src/ai/ai.hh b/2005/i/robert/src/ai/ai.hh
index 68a99b9..a349ca4 100644
--- a/2005/i/robert/src/ai/ai.hh
+++ b/2005/i/robert/src/ai/ai.hh
@@ -40,6 +40,8 @@ class Ai
ovision_ ov_;
// Scheduler du robot
scheduler::Scheduler scheduler_;
+ scheduler::SchedulableReadFd schedulableMotor_;
+ scheduler::SchedulableReadFd schedulableEs_;
// Paramètre de Ai
const int roundDuration_;
const int vitesseAsc_;
@@ -67,7 +69,7 @@ class Ai
/// Rotation.
void rotation (double a);
/// Monte(vrai) ou descend(faux) l'ascenceur
- void ascenceur (stateAsc monte);
+ void ascenceur (bool monte);
/// Désactive les ventouse
void ventouses (void);
/// Attend une mise à jour