summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision
diff options
context:
space:
mode:
authordufourj2005-06-22 08:24:48 +0000
committerdufourj2005-06-22 08:24:48 +0000
commit58c6fc6fa7beb2e8a57f49b94e95c9c0eb3e08b8 (patch)
tree6149b4d1731a24202653cd84e3cb6dd9e7d75215 /2005/i/robert/src/ovision
parentcc275044597eef4136ebc48090510da365368d0f (diff)
Correction du calcul de la position de la quille et ajout de log
Diffstat (limited to '2005/i/robert/src/ovision')
-rw-r--r--2005/i/robert/src/ovision/see/ovision.cc6
-rw-r--r--2005/i/robert/src/ovision/see/test_ovision.cc7
2 files changed, 11 insertions, 2 deletions
diff --git a/2005/i/robert/src/ovision/see/ovision.cc b/2005/i/robert/src/ovision/see/ovision.cc
index a316306..2cbb4a1 100644
--- a/2005/i/robert/src/ovision/see/ovision.cc
+++ b/2005/i/robert/src/ovision/see/ovision.cc
@@ -136,8 +136,10 @@ OVision::getLoc (Zone &zone, int &x, int &y, int &angle, int &dist)
int tmpY = (int)((zone.ymax - zone.centery) * newPcY + zone.centery);
int newX, newY;
space_->getLoc (tmpX, tmpY, newX, newY);
- angle = (int)(atan (newX / (newY + 9)));
- dist = newY;
+ angle = (int)(atan ((double)newX / ((double)newY + 90)));
+ x = newX; y = newY;
+ dist = (int)sqrt (y*y + x*x);
+ std::cout << "<OVision::getLoc> " << " " << newX << " " << newY << " " << angle << " " << dist << "\n";
}
/// Renvoie la liste des quilles
diff --git a/2005/i/robert/src/ovision/see/test_ovision.cc b/2005/i/robert/src/ovision/see/test_ovision.cc
index 25e7e88..c86c37d 100644
--- a/2005/i/robert/src/ovision/see/test_ovision.cc
+++ b/2005/i/robert/src/ovision/see/test_ovision.cc
@@ -38,6 +38,13 @@ main(int argv, char **argc)
// double x, y;
// if (ovision.getBall (x, y))
// std::cout << x <<"----" << y << std::endl;
+
+ std::vector<Zone> &z = ovision.getSkittles ();
+ for (unsigned i=0; i < z.size (); ++i)
+ {
+ int x, y, dist, angle;
+ ovision.getLoc (z[i], x, y, dist, angle);
+ }
usleep (500000);
}
return 0;