5 #ifndef WAK_GAME_MANAGER_H
6 #define WAK_GAME_MANAGER_H
9 #include <walk_and_kick/wak_common.h>
10 #include <walk_and_kick/wak_config.h>
11 #include <walk_and_kick/wak_game_vars.h>
12 #include <walk_and_kick/wak_sensor_vars.h>
13 #include <walk_and_kick/wak_actuator_vars.h>
14 #include <walk_and_kick/wak_ros_interface.h>
15 #include <walk_and_kick/wak_game_shared.h>
16 #include <walk_and_kick/wak_game_state.h>
19 #include <walk_and_kick/game_states/game_unknown_state.h>
20 #include <walk_and_kick/game_states/game_stopped.h>
21 #include <walk_and_kick/game_states/game_panic_attack.h>
22 #include <walk_and_kick/game_states/game_positioning.h>
23 #include <walk_and_kick/game_states/game_gaze_for_ball.h>
24 #include <walk_and_kick/game_states/game_wait_for_ball_in_play.h>
25 #include <walk_and_kick/game_states/game_default_ball_handling.h>
26 #include <walk_and_kick/game_states/game_penalty_ball_handling.h>
27 #include <walk_and_kick/game_states/game_default_goalie.h>
28 #include <walk_and_kick/game_states/game_penalty_goalie.h>
31 namespace walk_and_kick
49 GS_WAIT_FOR_BALL_IN_PLAY,
50 GS_DEFAULT_BALL_HANDLING,
51 GS_PENALTY_BALL_HANDLING,
56 static bool gameStateValid(
int GSI) {
return (GSI > GS_UNKNOWN && GSI < GS_COUNT); }
57 static bool gameStateValid(GameStateID GSI) {
return gameStateValid((
int) GSI); }
58 static const std::string& gameStateName(GameStateID GSI) {
return gameStateName((
int) GSI); }
59 static const std::string& gameStateName(
int GSI) {
if(gameStateValid(GSI))
return GameStateName[GSI];
else return GameStateName[GS_UNKNOWN]; }
61 static const std::string GameStateName[GS_COUNT];
71 void resetStateMachine();
74 void registerState(
WAKGameState* state,
int ID,
const std::string& name);
77 const WAKGameState* currentState()
const {
return m_curState; }
78 const GameStopped* stoppedState()
const {
return Stopped; }
82 const GameVars& GV()
const {
return m_GV; }
83 const GameVars& lastGV()
const {
return m_lastGV; }
84 cycle_t wakCycle()
const {
return m_wakCycle; }
85 cycle_t stateCycle()
const {
return m_stateCycle; }
88 void updateManager(cycle_t wakCycle);
126 std::string stateNameForID(
int ID);
127 std::map<int, WAKGameState*> m_stateMap;
128 std::map<int, std::string> m_stateNameMap;
140 cycle_t m_stateCycle;
143 PlayState m_lastPlayState;
Configuration struct for the walk and kick node.
Definition: wak_config.h:20
A walk and kick game state that forces the robot to the stopped behaviour state.
Definition: game_stopped.h:19
A walk and kick game state that implements default goalie behaviours for playing soccer.
Definition: game_default_goalie.h:20
A walk and kick game state that waits for the ball to be in play.
Definition: game_wait_for_ball_in_play.h:19
A walk and kick game state that implements goalie behaviours for defending a penalty kick...
Definition: game_penalty_goalie.h:19
An interface class for encapsulating all of the ROS input data to the walk and kick node...
Definition: wak_sensor_vars.h:29
A walk and kick game state that implements ball handling for taking a penalty kick.
Definition: game_penalty_ball_handling.h:19
A class that shares the required walk and kick variables amongst the game state classes.
Definition: wak_game_shared.h:31
A walk and kick game state that implements default ball handling for playing soccer.
Definition: game_default_ball_handling.h:19
The main walk and kick behaviour class.
Definition: walk_and_kick.h:34
The base class for all walk and kick game states.
Definition: wak_game_state.h:26
A walk and kick game state that forces the robot to the positioning behaviour state.
Definition: game_positioning.h:20
A walk and kick game state that induces a panic attack.
Definition: game_panic_attack.h:19
A class that manages and executes the walk and kick game states.
Definition: wak_game_manager.h:38
A walk and kick game state that stands in for an unknown state or ID.
Definition: game_unknown_state.h:19
An interface class for encapsulating all of the data that the walk and kick game states should comman...
Definition: wak_game_vars.h:21
A walk and kick game state that makes the robot look for the ball by gaze only.
Definition: game_gaze_for_ball.h:19
An interface class between the walk and kick and ROS worlds.
Definition: wak_ros_interface.h:54
A class that implements the worm, for making a live decision between two opposites.
Definition: wak_utils.h:83