summaryrefslogtreecommitdiff
path: root/2005/i
diff options
context:
space:
mode:
authordufourj2005-06-05 17:17:44 +0000
committerdufourj2005-06-05 17:17:44 +0000
commite2f75a35e64344bd275a7a3cad7b82eafeefc9a4 (patch)
tree7e0b484e3e273624083a5ba12c5d577161da02f7 /2005/i
parente43ca926f4afb158a998498558e4ec43b2ebaca8 (diff)
Correction de la segfault dans OVision (variable non initialisé).
Correction des chemins de libz.a dans les Makefiles. Activation de la vision (à tester). Problèmes de test des seconds arguments des commandes dans test_ai
Diffstat (limited to '2005/i')
-rw-r--r--2005/i/robert/src/ai/Makefile.defs2
-rw-r--r--2005/i/robert/src/ai/ai.cc14
-rw-r--r--2005/i/robert/src/ai/ai.hh2
-rw-r--r--2005/i/robert/src/ai/test_ai.cc1
4 files changed, 10 insertions, 9 deletions
diff --git a/2005/i/robert/src/ai/Makefile.defs b/2005/i/robert/src/ai/Makefile.defs
index e64ce6e..29e958a 100644
--- a/2005/i/robert/src/ai/Makefile.defs
+++ b/2005/i/robert/src/ai/Makefile.defs
@@ -9,4 +9,4 @@ $(ovision_OBJECTS) $(video4linux_OBJECTS) $(image_OBJECTS)
test_ai: $(test_ai_OBJECTS)
-test_ai: LDFLAGS += -static
+#test_ai: LDFLAGS += -static
diff --git a/2005/i/robert/src/ai/ai.cc b/2005/i/robert/src/ai/ai.cc
index b3b4f09..958aa78 100644
--- a/2005/i/robert/src/ai/ai.cc
+++ b/2005/i/robert/src/ai/ai.cc
@@ -74,8 +74,8 @@ void Ai::init(void)
// initialise la carte es
es_.init();
// on init la vision
-// oVision_.init(motor_.colorState() ? Group::redSkittle :
-// Group::greenSkittle);
+ oVision_.init(motor_.colorState() ? Group::redSkittle :
+ Group::greenSkittle);
while (!update());
}
@@ -437,11 +437,11 @@ void Ai::scanVision (bool followLine) /// XXX mettre un argument
for (int i = 0; i < (followLine ? 1 : 4) ; i++)
{
// On prend la photo
-// oVision_.takeShoot();
-// // On analyse la photo
-// oVision_.update();
+ oVision_.takeShoot();
+ // On analyse la photo
+ oVision_.update();
// On mets la liste brute dans le vector
-// skittles.push_back(oVision_.getSkittles());
+ skittles.push_back(oVision_.getSkittles());
// on tournicote
motor_.rotation(angleDepart + ((i + 1) * M_PI/4));
}
@@ -479,7 +479,7 @@ void Ai::remonteWithCam(void)
{
int x, y , angle, dist;
Zone zeSkittles = goodSkittles_.back();
-// oVision_.getLoc(zeSkittles, x, y, angle, dist);
+ oVision_.getLoc(zeSkittles, x, y, angle, dist);
dist -= 9;
rotation(motor_.getA() + angle);
setMaxSpeed(2,1);
diff --git a/2005/i/robert/src/ai/ai.hh b/2005/i/robert/src/ai/ai.hh
index 6867031..bf89910 100644
--- a/2005/i/robert/src/ai/ai.hh
+++ b/2005/i/robert/src/ai/ai.hh
@@ -40,7 +40,7 @@ class Ai
// Modules de controle du robot
Motor motor_;
Es es_;
-// OVision oVision_;
+ OVision oVision_;
// Scheduler du robot
scheduler::Scheduler scheduler_;
scheduler::SchedulableReadFd schedulableMotor_;
diff --git a/2005/i/robert/src/ai/test_ai.cc b/2005/i/robert/src/ai/test_ai.cc
index 03a1642..129ed44 100644
--- a/2005/i/robert/src/ai/test_ai.cc
+++ b/2005/i/robert/src/ai/test_ai.cc
@@ -161,6 +161,7 @@ main (int argc, char **argv)
if(++i > argc)
throw std::runtime_error("syntax error");
ai_.temporisation (argv[i][0]);
+ break;
case 'o':
if(++i > argc)
throw std::runtime_error("syntax error");