src/BasicPlayer.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000-2003, Jelle Kok, University of Amsterdam
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007 
00008 1. Redistributions of source code must retain the above copyright notice, this
00009 list of conditions and the following disclaimer.
00010 
00011 2. Redistributions in binary form must reproduce the above copyright notice,
00012 this list of conditions and the following disclaimer in the documentation
00013 and/or other materials provided with the distribution.
00014 
00015 3. Neither the name of the University of Amsterdam nor the names of its
00016 contributors may be used to endorse or promote products derived from this
00017 software without specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00020 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00022 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00023 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00024 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00025 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00026 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00027 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 */
00030 
00048 #ifndef _BASICPLAYER_
00049 #define _BASICPLAYER_
00050 
00051 #include "ActHandler.h"
00052 
00053 #include "fuzzyobj.h"   // inkludujem fuzzy regulátor
00054 
00055 extern Logger Log; 
00061 class BasicPlayer
00062 {
00063 protected:
00064   ActHandler      *ACT; 
00065   WorldModel      *WM;  
00066   ServerSettings  *SS;  
00067   PlayerSettings  *PS;  
00069 
00070 
00071   SoccerCommand   alignNeckWithBody       (                                  );
00072   SoccerCommand   turnBodyToPoint         ( VecPosition   pos,
00073                                             int           iPos = 1           );
00074   SoccerCommand   turnBackToPoint         ( VecPosition   pos,
00075                                             int           iPos = 1           );
00076   SoccerCommand   turnNeckToPoint         ( VecPosition   pos,
00077                                             SoccerCommand com                );
00078   SoccerCommand   searchBall              (                                  );
00079   SoccerCommand   dashToPoint             ( VecPosition   pos,
00080                                             int           iCycles = 1        );
00081   SoccerCommand   freezeBall              (                                  );
00082   SoccerCommand   kickBallCloseToBody     ( AngDeg        ang,
00083                                             double        dKickRatio = 0.16  );
00084   SoccerCommand   accelerateBallToVelocity( VecPosition   vel                );
00085   SoccerCommand   catchBall               (                                  );
00086   SoccerCommand   communicate             ( char          *str               );
00087   SoccerCommand   teleportToPos           ( VecPosition   pos                );
00088   SoccerCommand   listenTo                ( ObjectT       obj                );
00089   SoccerCommand   tackle                  (                                  );
00090   SoccerCommand   adjustView                      ( double                distance,                      
00091                                             double        min = 1,      
00092                                             double        max = 20           );
00093   SoccerCommand   turnAround                      (                                                                      );
00094   void                    oscillateView                   (     SoccerCommand soc                );
00095 
00097 
00098   SoccerCommand   turnBodyToObject        ( ObjectT       o                  );
00099   SoccerCommand   turnNeckToObject        ( ObjectT       o,
00100                                             SoccerCommand com                );
00101   SoccerCommand   directTowards           ( VecPosition   posTo,
00102                                             AngDeg        angWhenToTurn,
00103                                             VecPosition   *pos = NULL,
00104                                             VecPosition   *vel = NULL,
00105                                             AngDeg        *angBody  = NULL   );
00106   SoccerCommand   moveToPos               ( VecPosition   posTo,
00107                                             AngDeg        angWhenToTurn,
00108                                             double        dDistDashBack = 0.0,
00109                                             bool          bMoveBack = false,
00110                                             int           iCycles = 1        );
00111   SoccerCommand   collideWithBall         (                                  );
00112   SoccerCommand   interceptClose          (                                  );
00113   SoccerCommand   interceptCloseGoalie    (                                  );
00114   SoccerCommand   kickTo                  ( VecPosition   posTarget,
00115                                             double        dEndSpeed          );
00116   SoccerCommand   turnWithBallTo          ( AngDeg        ang,
00117                                             AngDeg        angKickThr,
00118                                             double        dFreezeThr         );
00119   SoccerCommand   moveToPosAlongLine      ( VecPosition   pos,
00120                                             AngDeg        ang,
00121                                             double        dDistThr,
00122                                             int           iSign,
00123                                             AngDeg        angThr,
00124                                             AngDeg        angCorr            );
00125 
00126   int             canDribbleFast          (                                  );
00127   int             canDribbleSlow          (                                  );
00128   int             canDribbleWithBall      (                                  );
00129   SoccerCommand   dribbleFast             ( int           dDirection         );
00130   SoccerCommand   dribbleSlow             ( int           dDirection         );
00131   SoccerCommand   dribbleWithBall         ( int           dDirection         );
00132   int             getNrOfBarrierInCone    ( int           iType,
00133                                             double        dR                 );
00134   bool            isFreeCone              ( double        angle, 
00135                                             double        length             );
00136 
00138 
00139   SoccerCommand   intercept               ( bool          isGoalie           );
00140   SoccerCommand   dribble                 ( AngDeg        ang,
00141                                             DribbleT      d                  );
00142   SoccerCommand   handleWithBall          (                                  );                                            
00143   SoccerCommand   directPass              ( VecPosition   pos,
00144                                             PassT         passType           );
00145   SoccerCommand   leadingPass             ( ObjectT       o,
00146                                             double        dDist,
00147                                             DirectionT    dir = DIR_NORTH    );
00148   SoccerCommand   throughPass             ( ObjectT       o,
00149                                             VecPosition   posEnd,
00150                                             AngDeg        *angMax = NULL     );
00151   SoccerCommand   outplayOpponent         ( ObjectT       o,
00152                                             VecPosition   pos,
00153                                             VecPosition   *posTo = NULL      );
00154   SoccerCommand   clearBall               ( ClearBallT    type,
00155                                             SideT         s = SIDE_ILLEGAL,
00156                                             AngDeg        *angMax = NULL     );
00157   SoccerCommand   mark                    ( ObjectT       o,
00158                                             double        dDist,
00159                                             MarkT         mark               );
00160   SoccerCommand   defendGoalLine          ( double        dDist              );
00161   SoccerCommand   interceptScoringAttempt (                                  );
00162   SoccerCommand   holdBall                (                                  );
00163 
00165 
00166   VecPosition     getThroughPassShootingPoint( ObjectT       objTeam,
00167                                                VecPosition   posEnd,
00168                                                AngDeg        *angMax         );
00169   VecPosition     getInterceptionPointBall(    int           *iCyclesBall,
00170                                                bool          isGoalie        );
00171   VecPosition     getActiveInterceptionPointBall
00172                                           ( int           *iCyclesBall,
00173                                             bool          isGoalie           );
00174   VecPosition     getDribblePoint         ( DribbleT      dribble,
00175                                             double        *dDist             );
00176   VecPosition     getShootPositionOnLine  ( VecPosition   p1,
00177                                             VecPosition   p2,
00178                                             AngDeg        *angLargest = NULL );
00179   double          getEndSpeedForPass      ( ObjectT       o,
00180                                             VecPosition   posPass            );
00181   VecPosition     getMarkingPosition      ( ObjectT       o,
00182                                             double        dDist,
00183                                             MarkT         mark               );
00184   double          getInterestRadius       ( double        dDist              );
00185   
00186 } ;
00187 
00188 #endif

Generated on Thu Apr 26 22:45:26 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1