Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/SelfLocator/GT2005SelfLocator/GT2005LineCrossingsTable.h

Go to the documentation of this file.

    00001 /*
    00002 * position and type of line crossings on the field
    00003 *
    00004 * @author <A href=mailto:c_rohde@web.de>Carsten Rohde</A>
    00005 * @author <A href=mailto:judith-winter@web.de>Judith Winter</A>
    00006 * @author Max Risler
    00007 */
    00008
    00009
    00010 #ifndef GT2005LineCrossingsTable_h
    00011 #define GT2005LineCrossingsTable_h
    00012
    00013
    00014 #include "Tools/Boundary.h"
    00015 #include "Tools/FieldDimensions.h"
    00016 #include "Tools/Debugging/DebugDrawings.h"
    00017 #include "Tools/Math/Pose2D.h"
    00018 #include "Representations/Perception/LinesPercept.h"
    00019
    00020 class GT2005LineCrossingsTable
    00021 {
    00022 public:
    00023   enum CrossingClass{
    00024     virtualCrossing,
    00025     lCrossing,
    00026     tCrossing,
    00027     xCrossing,
    00028     outerLCrossing,
    00029     outerTCrossing,
    00030     outerVirtualCrossing,
    00031     falseCrossing,
    00032       numOfCrossingClasses
    00033   };
    00034
    00035   GT2005LineCrossingsTable();
    00036   Vector2<double> getClosestPoint(const Vector2<double>& point, CrossingClass crossingClass, int orientation) const;
    00037   Vector2<double> getClosestPoint(const Pose2D& pose, const LinesPercept::LineCrossingPoint& crossingPoint, CrossingClass& crossingClass) const;
    00038
    00039   static int NO_POINT_DISTANCE;
    00040
    00041 private:
    00042
    00043   enum{
    00044     maxNumOfCrossings = 6
    00045   };
    00046
    00047   int numOfCrossings[numOfCrossingClasses][4];
    00048   Vector2<double> crossings[numOfCrossingClasses][4][maxNumOfCrossings];
    00049
    00050   // private methods
    00051   void addCrossing(CrossingClass crossingClass, int orientation, double x, double y)
    00052   {
    00053     int& num = numOfCrossings[crossingClass][orientation];
    00054     crossings[crossingClass][orientation][num].x = x;
    00055     crossings[crossingClass][orientation][num].y = y;
    00056     num++;
    00057   }
    00058
    00059   void initVirtualCrossings();
    00060   void initTCrossings();
    00061   void initLCrossings();
    00062   void initXCrossings();
    00063   void initFalseCrossings();
    00064
    00065   void updateClosestPoint(Vector2<double>& minimum, double& minDist, const Vector2<double>& pose, CrossingClass crossingClass, int orientation, CrossingClass& minCrossingClass) const;
    00066 };
    00067 #endif