24 #include <interfaces/KickerInterface.h> 26 #include <core/exceptions/software.h> 45 KickerInterface::KickerInterface() : Interface()
47 data_size =
sizeof(KickerInterface_data_t);
49 data = (KickerInterface_data_t *)
data_ptr;
60 unsigned char tmp_hash[] = {0x96, 0x3d, 0x55, 0x60, 0xfd, 0x65, 0xf2, 0xfa, 0xa8, 0xfa, 0xfc, 0xaa, 0xb6, 0xfc, 0xc2, 0x81};
65 KickerInterface::~KickerInterface()
77 case GUIDE_BALL_LEFT:
return "GUIDE_BALL_LEFT";
78 case GUIDE_BALL_RIGHT:
return "GUIDE_BALL_RIGHT";
79 default:
return "UNKNOWN";
92 return data->num_kicks_left;
114 data->num_kicks_left = new_num_kicks_left;
127 return data->num_kicks_center;
149 data->num_kicks_center = new_num_kicks_center;
162 return data->num_kicks_right;
184 data->num_kicks_right = new_num_kicks_right;
217 data->guide_ball_side = new_guide_ball_side;
230 return data->current_intensity;
252 data->current_intensity = new_current_intensity;
260 if ( strncmp(
"KickMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
262 }
else if ( strncmp(
"ResetCounterMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
264 }
else if ( strncmp(
"GuideBallMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
268 "message type for this interface type.", type);
284 memcpy(data, oi->data,
sizeof(KickerInterface_data_t));
290 if (strcmp(enumtype,
"GuideBallSideEnum") == 0) {
315 data = (KickMessage_data_t *)
data_ptr;
317 data->left = ini_left;
318 data->center = ini_center;
319 data->right = ini_right;
320 data->intensity = ini_intensity;
332 data = (KickMessage_data_t *)
data_ptr;
354 data = (KickMessage_data_t *)
data_ptr;
386 data->left = new_left;
416 data->center = new_center;
446 data->right = new_right;
456 return data->intensity;
476 data->intensity = new_intensity;
499 data_size =
sizeof(ResetCounterMessage_data_t);
502 data = (ResetCounterMessage_data_t *)
data_ptr;
520 data = (ResetCounterMessage_data_t *)
data_ptr;
547 data_size =
sizeof(GuideBallMessage_data_t);
550 data = (GuideBallMessage_data_t *)
data_ptr;
552 data->guide_ball_side = ini_guide_ball_side;
558 data_size =
sizeof(GuideBallMessage_data_t);
561 data = (GuideBallMessage_data_t *)
data_ptr;
580 data = (GuideBallMessage_data_t *)
data_ptr;
612 data->guide_ball_side = new_guide_ball_side;
size_t maxlenof_center() const
Get maximum length of center value.
virtual Message * clone() const
Clone this message.
bool is_center() const
Get center value.
void * data_ptr
Pointer to memory that contains local data.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
size_t maxlenof_num_kicks_center() const
Get maximum length of num_kicks_center value.
GuideBallSideEnum guide_ball_side() const
Get guide_ball_side value.
size_t maxlenof_guide_ball_side() const
Get maximum length of guide_ball_side value.
void set_hash(unsigned char *ihash)
Set hash.
const char * type() const
Get message type.
virtual Message * clone() const
Clone this message.
Fawkes library namespace.
void set_num_kicks_left(const int32_t new_num_kicks_left)
Set num_kicks_left value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
GuideBallMessage()
Constructor.
size_t maxlenof_guide_ball_side() const
Get maximum length of guide_ball_side value.
bool is_left() const
Get left value.
void set_intensity(const uint32_t new_intensity)
Set intensity value.
Base class for all Fawkes BlackBoard interfaces.
void set_center(const bool new_center)
Set center value.
void set_guide_ball_side(const GuideBallSideEnum new_guide_ball_side)
Set guide_ball_side value.
GuideBallMessage Fawkes BlackBoard Interface Message.
void set_right(const bool new_right)
Set right value.
virtual Message * create_message(const char *type) const
Create message based on type name.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
void set_current_intensity(const uint32_t new_current_intensity)
Set current_intensity value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
virtual Message * clone() const
Clone this message.
void set_num_kicks_right(const int32_t new_num_kicks_right)
Set num_kicks_right value.
void set_num_kicks_center(const int32_t new_num_kicks_center)
Set num_kicks_center value.
bool data_changed
Indicator if data has changed.
size_t maxlenof_current_intensity() const
Get maximum length of current_intensity value.
KickMessage Fawkes BlackBoard Interface Message.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
int32_t num_kicks_center() const
Get num_kicks_center value.
int32_t num_kicks_left() const
Get num_kicks_left value.
size_t maxlenof_num_kicks_left() const
Get maximum length of num_kicks_left value.
void set_left(const bool new_left)
Set left value.
size_t maxlenof_intensity() const
Get maximum length of intensity value.
ResetCounterMessage()
Constructor.
~GuideBallMessage()
Destructor.
ResetCounterMessage Fawkes BlackBoard Interface Message.
uint32_t intensity() const
Get intensity value.
bool is_right() const
Get right value.
KickMessage()
Constructor.
~ResetCounterMessage()
Destructor.
GuideBallSideEnum guide_ball_side() const
Get guide_ball_side value.
KickerInterface Fawkes BlackBoard Interface.
~KickMessage()
Destructor.
uint32_t current_intensity() const
Get current_intensity value.
GuideBallSideEnum
Enumeration defining on which side of the robot the ball shall be guided (and thus on which side the ...
const char * tostring_GuideBallSideEnum(GuideBallSideEnum value) const
Convert GuideBallSideEnum constant to string.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0)
Add an entry to the info list.
virtual void copy_values(const Interface *other)
Copy values from other interface.
int32_t num_kicks_right() const
Get num_kicks_right value.
void set_guide_ball_side(const GuideBallSideEnum new_guide_ball_side)
Set guide_ball_side value.
size_t maxlenof_left() const
Get maximum length of left value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
const char * type() const
Get type of interface.
32 bit unsigned integer field
field with interface specific enum type
size_t maxlenof_num_kicks_right() const
Get maximum length of num_kicks_right value.
size_t maxlenof_right() const
Get maximum length of right value.