24 #ifndef __INTERFACES_GAMESTATEINTERFACE_H_ 25 #define __INTERFACES_GAMESTATEINTERFACE_H_ 27 #include <interface/interface.h> 28 #include <interface/message.h> 29 #include <interface/field_iterator.h> 103 typedef struct __attribute__((packed)) {
104 int64_t timestamp_sec;
105 int64_t timestamp_usec;
115 } GameStateInterface_data_t;
117 GameStateInterface_data_t *data;
129 typedef struct __attribute__((packed)) {
130 int64_t timestamp_sec;
131 int64_t timestamp_usec;
133 } SetTeamColorMessage_data_t;
135 SetTeamColorMessage_data_t *data;
148 if_gamestate_team_t
our_team()
const;
149 void set_our_team(
const if_gamestate_team_t new_our_team);
151 virtual Message * clone()
const;
158 typedef struct __attribute__((packed)) {
159 int64_t timestamp_sec;
160 int64_t timestamp_usec;
162 } SetKickoffMessage_data_t;
164 SetKickoffMessage_data_t *data;
180 virtual Message * clone()
const;
187 typedef struct __attribute__((packed)) {
188 int64_t timestamp_sec;
189 int64_t timestamp_usec;
191 } SetStateTeamMessage_data_t;
193 SetStateTeamMessage_data_t *data;
209 virtual Message * clone()
const;
225 if_gamestate_team_t
our_team()
const;
226 void set_our_team(
const if_gamestate_team_t new_our_team);
231 if_gamestate_half_t
half()
const;
232 void set_half(
const if_gamestate_half_t new_half);
237 if_gamestate_role_t
role()
const;
238 void set_role(
const if_gamestate_role_t new_role);
249 virtual const char *
enum_tostring(
const char *enumtype,
int val)
const;
bool is_kickoff() const
Get kickoff value.
static const uint32_t GS_FROZEN
GS_FROZEN constant.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_game_state(const uint32_t new_game_state)
Set game_state value.
void set_score_cyan(const uint32_t new_score_cyan)
Set score_cyan value.
if_gamestate_role_t role() const
Get role value.
static const uint32_t GS_DROP_BALL
GS_DROP_BALL constant.
size_t maxlenof_role() const
Get maximum length of role value.
void set_our_goal_color(const if_gamestate_goalcolor_t new_our_goal_color)
Set our_goal_color value.
if_gamestate_team_t our_team() const
Get our_team value.
static const uint32_t GS_THROW_IN
GS_THROW_IN constant.
Fawkes library namespace.
void set_state_team(const if_gamestate_team_t new_state_team)
Set state_team value.
size_t maxlenof_score_cyan() const
Get maximum length of score_cyan value.
virtual Message * create_message(const char *type) const
Create message based on type name.
Base class for all Fawkes BlackBoard interfaces.
void set_role(const if_gamestate_role_t new_role)
Set role value.
const char * tostring_if_gamestate_half_t(if_gamestate_half_t value) const
Convert if_gamestate_half_t constant to string.
const char * tostring_if_gamestate_team_t(if_gamestate_team_t value) const
Convert if_gamestate_team_t constant to string.
if_gamestate_role_t
Enumeration defining the different robot roles.
static const uint32_t GS_SPL_READY
GS_SPL_READY constant.
const char * tostring_if_gamestate_role_t(if_gamestate_role_t value) const
Convert if_gamestate_role_t constant to string.
size_t maxlenof_our_goal_color() const
Get maximum length of our_goal_color value.
const char * type() const
Get type of interface.
uint32_t score_cyan() const
Get score_cyan value.
static const uint32_t GS_SPL_PLAY
GS_SPL_PLAY constant.
SetTeamColorMessage Fawkes BlackBoard Interface Message.
static const uint32_t GS_FREE_KICK
GS_FREE_KICK constant.
if_gamestate_half_t
Enumeration defining the different teams.
size_t maxlenof_our_team() const
Get maximum length of our_team value.
const char * tostring_if_gamestate_goalcolor_t(if_gamestate_goalcolor_t value) const
Convert if_gamestate_goalcolor_t constant to string.
static const uint32_t GS_SPL_FINISHED
GS_SPL_FINISHED constant.
if_gamestate_goalcolor_t our_goal_color() const
Get our_goal_color value.
if_gamestate_goalcolor_t
Enumeration defining the different teams.
static const uint32_t GS_KICK_OFF
GS_KICK_OFF constant.
SetKickoffMessage Fawkes BlackBoard Interface Message.
static const uint32_t GS_PLAY
GS_PLAY constant.
if_gamestate_half_t half() const
Get half value.
static const uint32_t GS_HALF_TIME
GS_HALF_TIME constant.
SetStateTeamMessage Fawkes BlackBoard Interface Message.
virtual void copy_values(const Interface *other)
Copy values from other interface.
size_t maxlenof_state_team() const
Get maximum length of state_team value.
if_gamestate_team_t state_team() const
Get state_team value.
uint32_t game_state() const
Get game_state value.
static const uint32_t GS_CORNER_KICK
GS_CORNER_KICK constant.
size_t maxlenof_game_state() const
Get maximum length of game_state value.
GameStateInterface Fawkes BlackBoard Interface.
static const uint32_t GS_GOAL_KICK
GS_GOAL_KICK constant.
size_t maxlenof_score_magenta() const
Get maximum length of score_magenta value.
size_t maxlenof_half() const
Get maximum length of half value.
void set_score_magenta(const uint32_t new_score_magenta)
Set score_magenta value.
size_t maxlenof_kickoff() const
Get maximum length of kickoff value.
if_gamestate_team_t
Enumeration defining the different teams.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
static const uint32_t GS_SPL_SET
GS_SPL_SET constant.
static const uint32_t GS_SPL_INITIAL
GS_SPL_INITIAL constant.
No team, not team-specific.
void set_kickoff(const bool new_kickoff)
Set kickoff value.
static const uint32_t GS_PENALTY
GS_PENALTY constant.
void set_half(const if_gamestate_half_t new_half)
Set half value.
void set_our_team(const if_gamestate_team_t new_our_team)
Set our_team value.
uint32_t score_magenta() const
Get score_magenta value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.