24 #include <interfaces/NavigatorInterface.h>
26 #include <core/exceptions/software.h>
76 NavigatorInterface::NavigatorInterface() : Interface()
78 data_size =
sizeof(NavigatorInterface_data_t);
80 data = (NavigatorInterface_data_t *)
data_ptr;
106 unsigned char tmp_hash[] = {0x90, 0x6b, 0x4d, 0xeb, 0x52, 0x4d, 0x53, 0x73, 0x4c, 0xbc, 0x82, 0x5, 0x80, 0x81, 0xf1, 0x39};
111 NavigatorInterface::~NavigatorInterface()
145 data->flags = new_flags;
238 data->dest_x = new_dest_x;
269 data->dest_y = new_dest_y;
280 return data->dest_ori;
300 data->dest_ori = new_dest_ori;
311 return data->dest_dist;
331 data->dest_dist = new_dest_dist;
364 data->msgid = new_msgid;
397 data->final = new_final;
410 return data->error_code;
432 data->error_code = new_error_code;
443 return data->max_velocity;
463 data->max_velocity = new_max_velocity;
475 return data->security_distance;
496 data->security_distance = new_security_distance;
510 return data->escaping_enabled;
533 data->escaping_enabled = new_escaping_enabled;
541 if ( strncmp(
"StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
543 }
else if ( strncmp(
"TurnMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
545 }
else if ( strncmp(
"CartesianGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
547 }
else if ( strncmp(
"PolarGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
549 }
else if ( strncmp(
"PlaceGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
551 }
else if ( strncmp(
"ObstacleMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
553 }
else if ( strncmp(
"ResetOdometryMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
555 }
else if ( strncmp(
"SetMaxVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
557 }
else if ( strncmp(
"SetEscapingMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
559 }
else if ( strncmp(
"SetSecurityDistanceMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
563 "message type for this interface type.", type);
579 memcpy(data, oi->data,
sizeof(NavigatorInterface_data_t));
602 data = (StopMessage_data_t *)
data_ptr;
620 data = (StopMessage_data_t *)
data_ptr;
651 data = (TurnMessage_data_t *)
data_ptr;
653 data->angle = ini_angle;
654 data->velocity = ini_velocity;
664 data = (TurnMessage_data_t *)
data_ptr;
684 data = (TurnMessage_data_t *)
data_ptr;
716 data->angle = new_angle;
727 return data->velocity;
748 data->velocity = new_velocity;
775 data_size =
sizeof(CartesianGotoMessage_data_t);
778 data = (CartesianGotoMessage_data_t *)
data_ptr;
782 data->orientation = ini_orientation;
790 data_size =
sizeof(CartesianGotoMessage_data_t);
793 data = (CartesianGotoMessage_data_t *)
data_ptr;
814 data = (CartesianGotoMessage_data_t *)
data_ptr;
886 return data->orientation;
906 data->orientation = new_orientation;
933 data_size =
sizeof(PolarGotoMessage_data_t);
936 data = (PolarGotoMessage_data_t *)
data_ptr;
939 data->dist = ini_dist;
940 data->orientation = ini_orientation;
948 data_size =
sizeof(PolarGotoMessage_data_t);
951 data = (PolarGotoMessage_data_t *)
data_ptr;
972 data = (PolarGotoMessage_data_t *)
data_ptr;
1004 data->phi = new_phi;
1034 data->dist = new_dist;
1044 return data->orientation;
1064 data->orientation = new_orientation;
1089 data_size =
sizeof(PlaceGotoMessage_data_t);
1092 data = (PlaceGotoMessage_data_t *)
data_ptr;
1094 strncpy(data->place, ini_place, 64);
1100 data_size =
sizeof(PlaceGotoMessage_data_t);
1103 data = (PlaceGotoMessage_data_t *)
data_ptr;
1122 data = (PlaceGotoMessage_data_t *)
data_ptr;
1154 strncpy(data->place, new_place,
sizeof(data->place));
1181 data_size =
sizeof(ObstacleMessage_data_t);
1184 data = (ObstacleMessage_data_t *)
data_ptr;
1188 data->width = ini_width;
1196 data_size =
sizeof(ObstacleMessage_data_t);
1199 data = (ObstacleMessage_data_t *)
data_ptr;
1220 data = (ObstacleMessage_data_t *)
data_ptr;
1312 data->width = new_width;
1335 data_size =
sizeof(ResetOdometryMessage_data_t);
1338 data = (ResetOdometryMessage_data_t *)
data_ptr;
1356 data = (ResetOdometryMessage_data_t *)
data_ptr;
1383 data_size =
sizeof(SetMaxVelocityMessage_data_t);
1386 data = (SetMaxVelocityMessage_data_t *)
data_ptr;
1388 data->max_velocity = ini_max_velocity;
1394 data_size =
sizeof(SetMaxVelocityMessage_data_t);
1397 data = (SetMaxVelocityMessage_data_t *)
data_ptr;
1416 data = (SetMaxVelocityMessage_data_t *)
data_ptr;
1428 return data->max_velocity;
1448 data->max_velocity = new_max_velocity;
1473 data_size =
sizeof(SetEscapingMessage_data_t);
1476 data = (SetEscapingMessage_data_t *)
data_ptr;
1478 data->escaping_enabled = ini_escaping_enabled;
1484 data_size =
sizeof(SetEscapingMessage_data_t);
1487 data = (SetEscapingMessage_data_t *)
data_ptr;
1506 data = (SetEscapingMessage_data_t *)
data_ptr;
1521 return data->escaping_enabled;
1544 data->escaping_enabled = new_escaping_enabled;
1569 data_size =
sizeof(SetSecurityDistanceMessage_data_t);
1572 data = (SetSecurityDistanceMessage_data_t *)
data_ptr;
1574 data->security_distance = ini_security_distance;
1580 data_size =
sizeof(SetSecurityDistanceMessage_data_t);
1583 data = (SetSecurityDistanceMessage_data_t *)
data_ptr;
1602 data = (SetSecurityDistanceMessage_data_t *)
data_ptr;
1615 return data->security_distance;
1636 data->security_distance = new_security_distance;
~CartesianGotoMessage()
Destructor.
~ResetOdometryMessage()
Destructor.
size_t maxlenof_y() const
Get maximum length of y value.
size_t maxlenof_security_distance() const
Get maximum length of security_distance value.
~StopMessage()
Destructor.
size_t maxlenof_escaping_enabled() const
Get maximum length of escaping_enabled value.
void * data_ptr
Pointer to memory that contains local data.
size_t maxlenof_width() const
Get maximum length of width value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
float max_velocity() const
Get max_velocity value.
size_t maxlenof_security_distance() const
Get maximum length of security_distance value.
void set_dist(const float new_dist)
Set dist value.
virtual Message * clone() const
Clone this message.
void set_angle(const float new_angle)
Set angle value.
void set_escaping_enabled(const bool new_escaping_enabled)
Set escaping_enabled value.
virtual Message * clone() const
Clone this message.
float y() const
Get y value.
uint32_t flags() const
Get flags value.
size_t maxlenof_dest_ori() const
Get maximum length of dest_ori value.
void set_hash(unsigned char *ihash)
Set hash.
SetMaxVelocityMessage()
Constructor.
~SetEscapingMessage()
Destructor.
void set_max_velocity(const float new_max_velocity)
Set max_velocity value.
ObstacleMessage Fawkes BlackBoard Interface Message.
void set_final(const bool new_final)
Set final value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
float dest_y() const
Get dest_y value.
char * place() const
Get place value.
static const uint32_t ERROR_MOTOR
ERROR_MOTOR constant.
float security_distance() const
Get security_distance value.
float width() const
Get width value.
SetEscapingMessage()
Constructor.
SetSecurityDistanceMessage Fawkes BlackBoard Interface Message.
~TurnMessage()
Destructor.
void set_place(const char *new_place)
Set place value.
static const uint32_t FLAG_CART_GOTO
FLAG_CART_GOTO constant.
float x() const
Get x value.
void set_escaping_enabled(const bool new_escaping_enabled)
Set escaping_enabled value.
size_t maxlenof_dest_dist() const
Get maximum length of dest_dist value.
uint32_t msgid() const
Get msgid value.
bool is_final() const
Get final value.
uint32_t error_code() const
Get error_code value.
size_t maxlenof_y() const
Get maximum length of y value.
PolarGotoMessage Fawkes BlackBoard Interface Message.
float x() const
Get x value.
static const uint32_t ERROR_UNKNOWN_PLACE
ERROR_UNKNOWN_PLACE constant.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
float phi() const
Get phi value.
float orientation() const
Get orientation value.
Base class for all Fawkes BlackBoard interfaces.
SetSecurityDistanceMessage()
Constructor.
float dest_ori() const
Get dest_ori value.
size_t maxlenof_max_velocity() const
Get maximum length of max_velocity value.
void set_phi(const float new_phi)
Set phi value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_x() const
Get maximum length of x value.
size_t maxlenof_phi() const
Get maximum length of phi value.
size_t maxlenof_max_velocity() const
Get maximum length of max_velocity value.
static const uint32_t FLAG_POLAR_GOTO
FLAG_POLAR_GOTO constant.
void set_security_distance(const float new_security_distance)
Set security_distance value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
SetEscapingMessage Fawkes BlackBoard Interface Message.
virtual Message * create_message(const char *type) const
Create message based on type name.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
float dest_x() const
Get dest_x value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_orientation() const
Get maximum length of orientation value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
void set_orientation(const float new_orientation)
Set orientation value.
size_t maxlenof_orientation() const
Get maximum length of orientation value.
bool is_escaping_enabled() const
Get escaping_enabled value.
size_t maxlenof_y() const
Get maximum length of y value.
size_t maxlenof_dest_y() const
Get maximum length of dest_y value.
size_t maxlenof_velocity() const
Get maximum length of velocity value.
bool data_changed
Indicator if data has changed.
PlaceGotoMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_place() const
Get maximum length of place value.
size_t maxlenof_dist() const
Get maximum length of dist value.
ObstacleMessage()
Constructor.
void * data_ptr
Pointer to local memory storage.
float velocity() const
Get velocity value.
size_t maxlenof_angle() const
Get maximum length of angle value.
size_t maxlenof_flags() const
Get maximum length of flags value.
CartesianGotoMessage Fawkes BlackBoard Interface Message.
void set_flags(const uint32_t new_flags)
Set flags value.
float y() const
Get y value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
CartesianGotoMessage()
Constructor.
bool is_escaping_enabled() const
Get escaping_enabled value.
float dist() const
Get dist value.
~PolarGotoMessage()
Destructor.
float security_distance() const
Get security_distance value.
virtual Message * clone() const
Clone this message.
void set_y(const float new_y)
Set y value.
~SetSecurityDistanceMessage()
Destructor.
void set_max_velocity(const float new_max_velocity)
Set max_velocity value.
void set_y(const float new_y)
Set y value.
void set_width(const float new_width)
Set width value.
float max_velocity() const
Get max_velocity value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
PolarGotoMessage()
Constructor.
size_t maxlenof_final() const
Get maximum length of final value.
void set_error_code(const uint32_t new_error_code)
Set error_code value.
~ObstacleMessage()
Destructor.
virtual Message * clone() const
Clone this message.
PlaceGotoMessage()
Constructor.
static const uint32_t FLAG_ESCAPING
FLAG_ESCAPING constant.
static const uint32_t ERROR_OBSTRUCTION
ERROR_OBSTRUCTION constant.
size_t maxlenof_escaping_enabled() const
Get maximum length of escaping_enabled value.
float x() const
Get x value.
void set_dest_ori(const float new_dest_ori)
Set dest_ori value.
void set_y(const float new_y)
Set y value.
TurnMessage Fawkes BlackBoard Interface Message.
void set_velocity(const float new_velocity)
Set velocity value.
static const uint32_t FLAG_SECURITY_DISTANCE
FLAG_SECURITY_DISTANCE constant.
void set_security_distance(const float new_security_distance)
Set security_distance value.
void set_dest_dist(const float new_dest_dist)
Set dest_dist value.
void set_orientation(const float new_orientation)
Set orientation value.
float y() const
Get y value.
void set_dest_x(const float new_dest_x)
Set dest_x value.
void set_x(const float new_x)
Set x value.
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.
static const uint32_t ERROR_NONE
ERROR_NONE constant.
ResetOdometryMessage()
Constructor.
~PlaceGotoMessage()
Destructor.
static const uint32_t FLAG_UPDATES_DEST_DIST
FLAG_UPDATES_DEST_DIST constant.
virtual Message * clone() const
Clone this message.
void set_x(const float new_x)
Set x value.
void set_dest_y(const float new_dest_y)
Set dest_y value.
~SetMaxVelocityMessage()
Destructor.
static const uint32_t FLAG_NONE
FLAG_NONE constant.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
TurnMessage()
Constructor.
size_t maxlenof_x() const
Get maximum length of x value.
size_t maxlenof_x() const
Get maximum length of x value.
const char * type() const
Get type of interface.
float orientation() const
Get orientation value.
float dest_dist() const
Get dest_dist value.
void set_x(const float new_x)
Set x value.
float angle() const
Get angle value.
32 bit unsigned integer field
size_t maxlenof_msgid() const
Get maximum length of msgid value.
SetMaxVelocityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_dest_x() const
Get maximum length of dest_x value.
ResetOdometryMessage Fawkes BlackBoard Interface Message.
static const uint32_t FLAG_PLACE_GOTO
FLAG_PLACE_GOTO constant.
StopMessage Fawkes BlackBoard Interface Message.
NavigatorInterface Fawkes BlackBoard Interface.
StopMessage()
Constructor.