From 098033352f64f814b6e8586624319855a5982b99 Mon Sep 17 00:00:00 2001 From: gaillaro Date: Fri, 6 May 2005 16:41:01 +0000 Subject: correction de bugs suir l'intégration de la caméra --- 2005/i/robert/src/ovision/see/ovision.cc | 22 +++++++++++----------- 2005/i/robert/src/ovision/see/ovision.hh | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) (limited to '2005/i/robert/src') diff --git a/2005/i/robert/src/ovision/see/ovision.cc b/2005/i/robert/src/ovision/see/ovision.cc index 5dd7c51..8b7b28d 100644 --- a/2005/i/robert/src/ovision/see/ovision.cc +++ b/2005/i/robert/src/ovision/see/ovision.cc @@ -31,24 +31,24 @@ OVision::init (const Group::ZoneType aim) // Initialisation des classes if (aim == Group::redSkittle) { - colorTab_ = new ColorTable ("../runtime/rc/colorTableGreen.z"); - //oconfig_->nnInfluLum = ; + colorTab_ = new ColorTable ("../runtime/rc/colortableGreen.z"); + oconfig_->nnInfluLum = 0.4; oconfig_->groupColor.clear (); ObjectColor tmp; tmp.label = "redSkittle"; - tmp.color = 4; - tmp.type = Group::redSkittle; + tmp.color = 0; + tmp.type = aim; oconfig_->groupColor.push_back (tmp); } else { - colorTab_ = new ColorTable ("../runtime/rc/colorTableRed.z"); - //oconfig_->nnInfluLum = ; + colorTab_ = new ColorTable ("../runtime/rc/colortableRed.z"); + oconfig_->nnInfluLum = 0.4; ObjectColor tmp; oconfig_->groupColor.clear (); tmp.label = "greenSkittle"; - tmp.color = 4; - tmp.type = Group::greenSkittle; + tmp.color = 0; + tmp.type = aim; oconfig_->groupColor.push_back (tmp); } @@ -132,11 +132,11 @@ OVision::getLoc (Zone &zone, int &x, int &y, int &angle, int &dist) newPcY = zone.pcY; } int tmpX = (int)((zone.xmax - zone.centerx) * newPcX + zone.centerx); - int tmpY = (int)((zone.ymax - zone.centery) *newPcY + zone.centery); + int tmpY = (int)((zone.ymax - zone.centery) * newPcY + zone.centery); int newX, newY; space_->getLoc (tmpX, tmpY, newX, newY); - angle = (int)(atan (tmpX / (tmpY+9))); - dist = tmpY; + angle = (int)(atan (newX / (newY + 9))); + dist = newY; } /// Renvoie la liste des quilles diff --git a/2005/i/robert/src/ovision/see/ovision.hh b/2005/i/robert/src/ovision/see/ovision.hh index bc722ef..28ba4c3 100644 --- a/2005/i/robert/src/ovision/see/ovision.hh +++ b/2005/i/robert/src/ovision/see/ovision.hh @@ -72,6 +72,7 @@ class OVision /// Renvoie le pointeur sur Video4Linux Video4Linux &getVideo4Linux () const; /// Renvoie la position de la quille dans le référentiel robot + /// Donne l'angle du robot par rapport à la balle + distance void getLoc (Zone &zone, int &x, int &y, int &angle, int &dist); }; -- cgit v1.2.3