Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
SoccerPenaltyInterface.h
1
2
/***************************************************************************
3
* SoccerPenaltyInterface.h - Fawkes BlackBoard Interface - SoccerPenaltyInterface
4
*
5
* Templated created: Thu Oct 12 10:49:19 2006
6
* Copyright 2008-2010 Tim Niemueller
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef __INTERFACES_SOCCERPENALTYINTERFACE_H_
25
#define __INTERFACES_SOCCERPENALTYINTERFACE_H_
26
27
#include <interface/interface.h>
28
#include <interface/message.h>
29
#include <interface/field_iterator.h>
30
31
namespace
fawkes {
32
33
class
SoccerPenaltyInterface
:
public
Interface
34
{
35
/// @cond INTERNALS
36
INTERFACE_MGMT_FRIENDS(
SoccerPenaltyInterface
)
37
/// @endcond
38
public
:
39
/* constants */
40
static
const
uint16_t
SPL_PENALTY_NONE
;
41
static
const
uint16_t
SPL_PENALTY_BALL_HOLDING
;
42
static
const
uint16_t
SPL_PENALTY_PLAYER_PUSHING
;
43
static
const
uint16_t
SPL_PENALTY_OBSTRUCTION
;
44
static
const
uint16_t
SPL_PENALTY_INACTIVE_PLAYER
;
45
static
const
uint16_t
SPL_PENALTY_ILLEGAL_DEFENDER
;
46
static
const
uint16_t
SPL_PENALTY_LEAVING_THE_FIELD
;
47
static
const
uint16_t
SPL_PENALTY_PLAYING_WITH_HANDS
;
48
static
const
uint16_t
SPL_PENALTY_REQ_FOR_PICKUP
;
49
static
const
uint16_t
SPL_PENALTY_MANUAL
;
50
51
private
:
52
#pragma pack(push,4)
53
/** Internal data storage, do NOT modify! */
54
typedef
struct
{
55
int64_t timestamp_sec;
/**< Interface Unix timestamp, seconds */
56
int64_t timestamp_usec;
/**< Interface Unix timestamp, micro-seconds */
57
uint16_t
penalty
;
/**< Current penalty code. */
58
uint16_t
remaining
;
/**< Estimated time in seconds until the robot is unpenalized. */
59
} SoccerPenaltyInterface_data_t;
60
#pragma pack(pop)
61
62
SoccerPenaltyInterface_data_t *data;
63
64
public
:
65
/* messages */
66
class
SetPenaltyMessage
:
public
Message
67
{
68
private
:
69
#pragma pack(push,4)
70
/** Internal data storage, do NOT modify! */
71
typedef
struct
{
72
int64_t timestamp_sec;
/**< Interface Unix timestamp, seconds */
73
int64_t timestamp_usec;
/**< Interface Unix timestamp, micro-seconds */
74
uint16_t
penalty
;
/**< Current penalty code. */
75
} SetPenaltyMessage_data_t;
76
#pragma pack(pop)
77
78
SetPenaltyMessage_data_t *data;
79
80
public
:
81
SetPenaltyMessage
(
const
uint16_t ini_penalty);
82
SetPenaltyMessage
();
83
~SetPenaltyMessage
();
84
85
SetPenaltyMessage
(
const
SetPenaltyMessage
*m);
86
/* Methods */
87
uint16_t
penalty
()
const
;
88
void
set_penalty
(
const
uint16_t new_penalty);
89
size_t
maxlenof_penalty
()
const
;
90
virtual
Message
*
clone
()
const
;
91
};
92
93
virtual
bool
message_valid
(
const
Message
*message)
const
;
94
private
:
95
SoccerPenaltyInterface
();
96
~
SoccerPenaltyInterface
();
97
98
public
:
99
/* Methods */
100
uint16_t
penalty
()
const
;
101
void
set_penalty
(
const
uint16_t new_penalty);
102
size_t
maxlenof_penalty
()
const
;
103
uint16_t
remaining
()
const
;
104
void
set_remaining
(
const
uint16_t new_remaining);
105
size_t
maxlenof_remaining
()
const
;
106
virtual
Message
*
create_message
(
const
char
*
type
)
const
;
107
108
virtual
void
copy_values
(
const
Interface
*other);
109
virtual
const
char
*
enum_tostring
(
const
char
*enumtype,
int
val)
const
;
110
111
};
112
113
}
// end namespace fawkes
114
115
#endif
src
libs
interfaces
SoccerPenaltyInterface.h
Generated by
1.8.1.1