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

# Modules/TeamBallLocator/GT2005Particles/GT2005ParticleContainerReceived.h

Go to the documentation of this file.

    00001 /**
    00002  * @file GT2005ParticleContainerReceived.h
    00003  *
    00004  * This file contains a Particle Container used by the GT2005TeamBallLocator.
    00005  *
    00006  * @author <a href="mailto:christinez@gmx.de">Christine Zarges</a>
    00007  * @author <a href="mailto:Thorsten.Kerkhof@gmx.de">Thorsten Kerkhof</a>
    00008  */
    00009
    00010 #ifndef __GT2005ParticleContainerReceived_h_
    00011 #define __GT2005ParticleContainerReceived_h_
    00012
    00013 #include "Tools/Debugging/GenericDebugData.h"
    00014 #include "Tools/Math/Common.h"
    00015 #include "Tools/Math/Vector2.h"
    00016 #include "Tools/Math/Pose2D.h"
    00017 #include "Tools/FieldDimensions.h"
    00018 #include "Representations/Cognition/RobotPose.h"
    00019 #include "Representations/Perception/ObstaclesPercept.h"
    00020 #include "Representations/Motion/OdometryData.h"
    00021 #include "Representations/Cognition/SampleSet.h"
    00022 #include "Modules/BallLocator/GT2005Particles/GT2005Particle.h"
    00023 #include "Modules/BallLocator/GT2005Particles/GT2005ParticleContainer.h"
    00024 #include <math.h>
    00025
    00026 /**
    00027 * @class GT2005ParticleContainerReceived
    00028 */
    00029 class GT2005ParticleContainerReceived
    00030 {
    00031 public:
    00032   // Constructor:
    00033   GT2005ParticleContainerReceived();
    00034   GT2005ParticleContainerReceived(int n);
    00035
    00036   //Destructor:
    00037   ~GT2005ParticleContainerReceived();
    00038
    00039   //The particles:
    00040   GT2005Particle* current;
    00041
    00042   //Number of particles:
    00043   int n;
    00044
    00045   //A cell in the grid:
    00046   class Cell
    00047   {
    00048     public:
    00049       //The sum of the probabilities of the particles in this cell:
    00050       double count;
    00051       //The first particle in this cell:
    00052       GT2005Particle* first;
    00053
    00054       //Constructor:
    00055       Cell()
    00056       {
    00057         count = 0;
    00058         first = 0;
    00059       }
    00060
    00061       void clear()
    00062       {
    00063         count = 0;
    00064         first = 0;
    00065       }
    00066   };
    00067
    00068   Cell cells[blMaxGrid][blMaxGrid];
    00069   double yMax,
    00070          xMax,
    00071          countMax;
    00072
    00073   //This funtion calculates out of the particles the actual estimated
    00074   //ball position:
    00075   void calculateEstimatedBallPosition(double& ballX,
    00076                                       double& ballY,
    00077                                       double& ballP);
    00078
    00079   //This funtion calculates out of the particles the actual estimated
    00080   //ball velocity:
    00081   void calculateEstimatedBallVelocity(double& ballVX,
    00082                                       double& ballVY);
    00083   void calculateEstimatedBallVelocity(double& ballVX,
    00084                                       double& ballVY,
    00085                                       double& ballVP);
    00086
    00087   /**
    00088   * The function returns the number of samples in the set.
    00089   * @return The number of samples.
    00090   */
    00091   int getNumberOfSamples() const {return n;}
    00092 };
    00093
    00094 #endif // __GT2005ParticleContainerReceived_h_