summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/space.cc
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/ovision/see/space.cc')
-rw-r--r--2005/i/robert/src/ovision/see/space.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/2005/i/robert/src/ovision/see/space.cc b/2005/i/robert/src/ovision/see/space.cc
index efba67b..4133830 100644
--- a/2005/i/robert/src/ovision/see/space.cc
+++ b/2005/i/robert/src/ovision/see/space.cc
@@ -163,7 +163,7 @@ Space::getPos (const double locX, const double locY, const double posRobotX, con
/// Give Real Location dist and angle
void
-Space::getRealLoc (Zone &zone, int &x, int &y, int &angle, int &dist)
+Space::getRealLoc (Zone &zone, int &x, int &y, double &angle, int &dist)
{
// we want a pcY positive to sub it to centery
double newPcX, newPcY;
@@ -180,10 +180,15 @@ Space::getRealLoc (Zone &zone, int &x, int &y, int &angle, int &dist)
// we are looking for the bottom of the object
int tmpX = (int)((zone.xmax - zone.centerx) * newPcX + zone.centerx);
int tmpY = (int)((zone.ymax - zone.centery) * newPcY + zone.centery);
- std::cout << "<Space::getRealLoc> : "<< tmpX << " " << tmpY << "\n";
int newX, newY;
getLoc (tmpX, tmpY, newX, newY);
- angle = (int)(atan ((double)newX / ((double)newY + 90)));
+ newY += 90;
+ angle = (atan ((double)newX / ((double)newY)));
+ // correction de la calibration a l'arrache
+ angle += .174;
+ newX = (int)(newX * cos (.174));
+ newY = (int)(newY * cos (.174));
x = newX; y = newY;
dist = (int)sqrt (y*y + x*x);
+ std::cout << "<Space::getRealLoc> : "<< x << " " << y << " " << dist << " " << angle*360.0f/3.1415f/2.0f << "\n";
}