00001 /** 00002 * @file GT2004ObstaclesLocator.h 00003 * 00004 * This file contains a class for obstacle localization. 00005 * @author Jan Hoffmann 00006 * @author <a href="mailto:juengel@informatik.hu-berlin.de">Matthias Juengel</a> 00007 */ 00008 00009 #ifndef __GT2004ObstaclesLocator_h_ 00010 #define __GT2004ObstaclesLocator_h_ 00011 00012 #include "ObstaclesLocator.h" 00013 #include "Tools/Field.h" 00014 00015 /** 00016 * This class is a locator for obstacles. 00017 */ 00018 class GT2004ObstaclesLocator : public ObstaclesLocator 00019 { 00020 public: 00021 00022 enum { 00023 timeAfterWhichObstacleIsForgotten = 6000 00024 }; 00025 00026 /** 00027 * Constructor. 00028 * @param interfaces The paramters of the ObstaclesLocator module. 00029 */ 00030 GT2004ObstaclesLocator(const ObstaclesLocatorInterfaces& interfaces); 00031 00032 int relativeOrientation; 00033 00034 Field field; 00035 Vector2<double> obstacles[ObstaclesModel::numOfSectors]; 00036 ObstaclesPercept::ObstacleType obstacleTypes[ObstaclesModel::numOfSectors]; 00037 00038 unsigned long timestamps[ObstaclesModel::numOfSectors]; 00039 00040 double sectorWidth; 00041 OdometryData lastOdometry; 00042 Pose2D odometry; 00043 00044 /** head tilt angle below which psd percepts are ignored */ 00045 double headTiltClipPSD; 00046 00047 /** Executes the module */ 00048 virtual void execute(); 00049 00050 bool usePSD; 00051 bool useLinesPercept; 00052 bool useObstaclesPercept; 00053 bool useAging; 00054 00055 void setObstaclesModel(bool addWorldModel = true); 00056 void moveObstaclesByOdometry(); 00057 00058 void addLinesPercept(); 00059 void addObstaclesPercept(); 00060 void addPSDPercept(); 00061 enum UpdateMode{overwrite, extend, limit}; 00062 void addObstaclePoint(const Vector2<double>& obstaclePoint, UpdateMode mode); 00063 void addObstaclePoints( 00064 const Vector2<int>& nearPoint, 00065 const Vector2<int>& farPoint, 00066 bool farPointIsOnImageBorder, 00067 ObstaclesPercept::ObstacleType obstacleType 00068 ); 00069 00070 virtual bool handleMessage(InMessage& message); 00071 00072 private: 00073 void determineFreePartsOfGoals(); 00074 00075 void determineNextFreeTeammate(); 00076 00077 /** Last time a free part of a goal was detected*/ 00078 unsigned long lastTimeFreePartOfGoalWasDetermined[2]; 00079 00080 /** angle to a free part of the goal, updated by vision and turn(!) odometry*/ 00081 double angleToFreePartOfGoal[2]; 00082 00083 /** the width of the free part of goal*/ 00084 double widthOfFreePartOfGoal[2]; 00085 00086 /** the distance to the free part of the goal*/ 00087 double distanceToFreePartOfGoal[2]; 00088 00089 }; 00090 00091 #endif// __GT2004ObstaclesLocator_h_ 00092 00093 /* 00094 * Change log : 00095 * 00096 * $Log: GT2004ObstaclesLocator.h,v $ 00097 * Revision 1.1 2004/07/10 00:18:30 spranger 00098 * renamed (readded) for coderelease 00099 * 00100 * Revision 1.1.1.1 2004/05/22 17:20:38 cvsadm 00101 * created new repository GT2004_WM 00102 * 00103 * Revision 1.4 2004/03/16 14:00:21 juengel 00104 * Integrated Improvments from "Günne" 00105 * -ATH2004ERS7Behavior 00106 * -ATHHeadControl 00107 * -KickSelectionTable 00108 * -KickEditor 00109 * 00110 * Revision 1.3 2004/03/08 01:39:03 roefer 00111 * Interfaces should be const 00112 * 00113 * - added ATH2004HeadControl 00114 * - added ATH2004LEDControl 00115 * - headmotiontester shows "tilt2" 00116 * - motion process updates odometry while no new robotPose is received, added to motion request 00117 * - some ui adjustments 00118 * - added member function to "field" to find out if robot is in own penalty area for use in the obstacles locator 00119 * 00120 * 00121 * Revision 1.2 2004/03/01 11:42:48 juengel 00122 * Different types are handled. 00123 * 00124 * Revision 1.1 2003/10/06 14:10:14 cvsadm 00125 * Created GT2004 (M.J.) 00126 * 00127 * Revision 1.1.1.1 2003/07/02 09:40:24 cvsadm 00128 * created new repository for the competitions in Padova from the 00129 * tamara CVS (Tuesday 2:00 pm) 00130 * 00131 * removed unused solutions 00132 * 00133 * Revision 1.9 2003/06/25 18:45:10 juengel 00134 * Added nearPoints, farPoints[maxNumberOfPoints] and farPointIsOnImageBorder to ObstaclesPercept. 00135 * 00136 * Revision 1.8 2003/06/17 14:47:11 juengel 00137 * Added update mode. 00138 * 00139 * Revision 1.7 2003/06/13 14:52:12 juengel 00140 * Added addObstaclesPercept. 00141 * 00142 * Revision 1.6 2003/05/26 08:23:32 juengel 00143 * Added determineFreePartsOfGoals() and determineNextFreeTeammate(); 00144 * 00145 * Revision 1.5 2003/05/21 11:44:02 risler 00146 * added aging 00147 * some optimizations 00148 * 00149 * Revision 1.4 2003/05/14 13:08:38 risler 00150 * removed DefaultObstaclesLocator 00151 * renamed MicroSectorsObstaclesLocator to DefaultObstaclesLocator 00152 * ObstaclesModel contains increased number of sectors 00153 * DefaultObstaclesLocator clean up 00154 * 00155 * Revision 1.5 2003/04/06 21:37:39 juengel 00156 * Added some methods. 00157 * 00158 * Revision 1.4 2003/04/06 17:14:37 jhoffman 00159 * added headTilt to PSDpercept and added debugging capabilities to microsectors 00160 * 00161 * Revision 1.3 2003/04/06 12:14:58 jhoffman 00162 * bug removed and code consolidated 00163 * 00164 * Revision 1.2 2003/04/05 12:46:11 jhoffman 00165 * worked on obstacle model 00166 * 00167 * Revision 1.1 2003/04/04 09:03:18 jhoffman 00168 * no message 00169 * 00170 * 00171 * 00172 */