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

# Modules/ObstaclesLocator/GT2005ObstaclesLocator.h

Go to the documentation of this file.

    00001 /**
    00002  * @file GT2005ObstaclesLocator.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 __GT2005ObstaclesLocator_h_
    00010 #define __GT2005ObstaclesLocator_h_
    00011
    00012 #include "ObstaclesLocator.h"
    00013 #include "Tools/Field.h"
    00014
    00015 /**
    00016  * This class is a locator for obstacles.
    00017  */
    00018 class GT2005ObstaclesLocator : 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   GT2005ObstaclesLocator(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 determineSeenGoals();
    00076
    00077   void determineNextFreeTeammate();
    00078
    00079   /** Last time a free part of a goal was detected*/
    00080   //unsigned long lastTimeFreePartOfGoalWasDetermined[2];
    00081
    00082   /** angle to a free part of the goal, updated by vision and turn(!) odometry*/
    00083   double angleToFreePartOfGoal[2];
    00084
    00085   /** angle to a seen goal, updated by vision and odometry*/
    00086   double angleToSeenGoal[2];
    00087
    00088   /** distance to a seen goal, updated by vision and odometry*/
    00089   double distanceToSeenGoal[2];
    00090
    00091   /** time since last seen goal*/
    00092   unsigned long timeOfSeenGoal[2];
    00093
    00094   /** the width of the free part of goal*/
    00095   double widthOfFreePartOfGoal[2];
    00096
    00097   /** the distance to the free part of the goal*/
    00098   double distanceToFreePartOfGoal[2];
    00099
    00100 };
    00101
    00102 #endif// __GT2005ObstaclesLocator_h_