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

# Representations/WLan/BehaviorTeamMessage.h

Go to the documentation of this file.

    00001 /**
    00002 * @file BehaviorTeamMessage.h
    00003 *
    00004 * Declaration of class BehaviorTeamMessage
    00005 *
    00006 * @author Martin Lötzsch
    00007 */
    00008
    00009 #ifndef __BehaviorTeamMessage_h_
    00010 #define __BehaviorTeamMessage_h_
    00011
    00012 #include "Tools/Streams/InOut.h"
    00013 #include "Tools/Player.h"
    00014
    00015
    00016
    00017
    00018 /**
    00019 * @class BehaviorTeamMessage
    00020 *
    00021 * Represents a message that is exchanged between the behaviors of different robots.
    00022 *
    00023 * @author Martin Loetzsch
    00024 */
    00025 class BehaviorTeamMessage
    00026 {
    00027 public:
    00028 /**
    00029 * Constructor.
    00030   */
    00031   BehaviorTeamMessage();
    00032
    00033   /** The time that the sender of the message estimates for reaching the ball */
    00034   double estimatedTimeToReachBall;
    00035
    00036   /** The time that the sender of the message estimates for reaching the kickoff pos */
    00037   enum Kickoff
    00038   {
    00039     sizeofKickoff = 3
    00040   };
    00041   double estimatedTimeToReachKickoff[sizeofKickoff];
    00042
    00043   /* This var holds the playernumber of the choosen pass partner
    00044    * It only relevant if a pass is prepared or executed
    00045    */
    00046   int numberOfTheChoosenPassPartner;
    00047   /**
    00048   * Different discrete messages that can be exchanged.
    00049   * Used by XabslBehaviorControl.
    00050   */
    00051   enum Message
    00052   {
    00053     none, /*!< no message */
    00054
    00055       justPerformedAKick, /*!< The player performed a kick. Used by GT2003BehaviorControl */
    00056       performingAKick, /*!< The player performes a kick. Used by GT2003BehaviorControl */
    00057       preparingAKick, /*!< The player prepares a kick. Used by GT2003BehaviorControl */
    00058       dribbleBall,
    00059       preparingAPass, /*!< The player prepare a pass to an other teammate */
    00060       passing,        /*!< The player passes the ball towards the teammate */
    00061       sync,            /*!< The player sends a sync signal. Used to synchronise behavior */
    00062     moveForward, /*!< Tells the team to move forward. Used for Open Challenge 2005 (Blind Dog)*/
    00063     turn /*!< Tells the team to turn on a point */
    00064   };
    00065
    00066   /** the message */
    00067   Message message;
    00068
    00069   /**
    00070   * The game state of the sender.
    00071   * Used by Humboldt2003BehaviorControl and GT2003BehaviorControl.
    00072   */
    00073   enum GameState { sleep, initial, ready, set, playing, penalized, finished } gameState;
    00074
    00075   /**
    00076   * The dynamic role of the sender.
    00077   * Used by DDD2003BehaviorControl and GT2003BehaviorControl.
    00078   */
    00079   enum DynamicRole { goalie, striker, offensiveSupporter, defensiveSupporter } dynamicRole;
    00080
    00081   unsigned long timeSinceRoleChange;
    00082
    00083 /*  typedef struct WalkR
    00084   {
    00085     double type;
    00086     double x;
    00087     double y;
    00088     double rotation;
    00089   } WalkRequest;
    00090 */
    00091   /**
    00092   * the MothionRequest from the Dog at the bridge.
    00093   * Used by OpenChallange04
    00094   */
    00095  // WalkR walkRequest;
    00096
    00097   /** the status of the open challenge */
    00098 //  int ocStatus;
    00099
    00100   /**
    00101   * Command from the Striker for the offensive Supporter.
    00102   */
    00103
    00104   enum StrikerCommand
    00105   {
    00106     noCommand,
    00107     goToPosition,
    00108     wingman
    00109   } strikerCommand ;
    00110
    00111   enum {numberOfStrikerCommandParameters = 3};
    00112
    00113   double strikerCommandParameter[numberOfStrikerCommandParameters];
    00114
    00115   const char* getRoleAsString() const { return getRoleString(dynamicRole); } ;
    00116
    00117   static const char* getRoleString(DynamicRole role)
    00118   {
    00119     switch(role) {
    00120       case goalie: return ("Goalie");
    00121       case striker: return ("Striker");
    00122       case offensiveSupporter: return ("OffensiveSupporter");
    00123       case defensiveSupporter: return ("DefensiveSupporter");
    00124     }
    00125     return "Undefined player Role";
    00126   }
    00127
    00128 };
    00129
    00130
    00131
    00132
    00133
    00134
    00135 /**
    00136 * Streaming operator that reads a BehaviorTeamMessage from a stream.
    00137 * @param stream The stream from which is read.
    00138 * @param behaviorTeamMessage The BehaviorTeamMessage object.
    00139 * @return The stream.
    00140 */
    00141 In& operator>>(In& stream,BehaviorTeamMessage& behaviorTeamMessage);
    00142
    00143 /**
    00144 * Streaming operator that writes a BehaviorTeamMessage to a stream.
    00145 * @param stream The stream to write on.
    00146 * @param behaviorTeamMessage The BehaviorTeamMessage object.
    00147 * @return The stream.
    00148 */
    00149 Out& operator<<(Out& stream, const BehaviorTeamMessage& behaviorTeamMessage);
    00150
    00151 #endif //__BehaviorTeamMessage_h_
    00152