Fawkes API
Fawkes Development Version
|
24 #include <interfaces/JacoInterface.h>
26 #include <core/exceptions/software.h>
54 JacoInterface::JacoInterface() : Interface()
58 data = (JacoInterface_data_t *)
data_ptr;
85 unsigned char tmp_hash[] = {0xff, 0x31, 0x58, 0x1c, 0x31, 0x7a, 0xc5, 0xb4, 0x2a, 0x56, 0x87, 0x5, 0x34, 0xfe, 0x6, 0x93};
90 JacoInterface::~JacoInterface()
102 return data->connected;
132 return data->initialized;
355 throw Exception(
"Index value %u out of bounds (0..5)", index);
357 return data->joints[index];
397 return data->finger1;
427 return data->finger2;
457 return data->finger3;
553 return data->error_code;
582 if ( strncmp(
"CalibrateMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
584 }
else if ( strncmp(
"RetractMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
586 }
else if ( strncmp(
"StopMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
588 }
else if ( strncmp(
"CartesianGotoMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
590 }
else if ( strncmp(
"AngularGotoMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
592 }
else if ( strncmp(
"MoveGripperMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
594 }
else if ( strncmp(
"SetPlannerParamsMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
596 }
else if ( strncmp(
"JoystickPushMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
598 }
else if ( strncmp(
"JoystickReleaseMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
602 "message type for this interface type.",
type);
618 memcpy(data, oi->data,
sizeof(JacoInterface_data_t));
638 data_size =
sizeof(CalibrateMessage_data_t);
641 data = (CalibrateMessage_data_t *)
data_ptr;
659 data = (CalibrateMessage_data_t *)
data_ptr;
684 data_size =
sizeof(RetractMessage_data_t);
687 data = (RetractMessage_data_t *)
data_ptr;
705 data = (RetractMessage_data_t *)
data_ptr;
733 data = (StopMessage_data_t *)
data_ptr;
751 data = (StopMessage_data_t *)
data_ptr;
783 data_size =
sizeof(CartesianGotoMessage_data_t);
786 data = (CartesianGotoMessage_data_t *)
data_ptr;
804 data_size =
sizeof(CartesianGotoMessage_data_t);
807 data = (CartesianGotoMessage_data_t *)
data_ptr;
831 data = (CartesianGotoMessage_data_t *)
data_ptr;
1043 data_size =
sizeof(AngularGotoMessage_data_t);
1046 data = (AngularGotoMessage_data_t *)
data_ptr;
1064 data_size =
sizeof(AngularGotoMessage_data_t);
1067 data = (AngularGotoMessage_data_t *)
data_ptr;
1091 data = (AngularGotoMessage_data_t *)
data_ptr;
1300 data_size =
sizeof(MoveGripperMessage_data_t);
1303 data = (MoveGripperMessage_data_t *)
data_ptr;
1305 data->finger1 = ini_finger1;
1306 data->finger2 = ini_finger2;
1307 data->finger3 = ini_finger3;
1315 data_size =
sizeof(MoveGripperMessage_data_t);
1318 data = (MoveGripperMessage_data_t *)
data_ptr;
1339 data = (MoveGripperMessage_data_t *)
data_ptr;
1351 return data->finger1;
1381 return data->finger2;
1411 return data->finger3;
1456 data_size =
sizeof(SetPlannerParamsMessage_data_t);
1459 data = (SetPlannerParamsMessage_data_t *)
data_ptr;
1461 strncpy(data->params, ini_params, 1024-1);
1462 data->params[1024-1] = 0;
1468 data_size =
sizeof(SetPlannerParamsMessage_data_t);
1471 data = (SetPlannerParamsMessage_data_t *)
data_ptr;
1490 data = (SetPlannerParamsMessage_data_t *)
data_ptr;
1502 return data->params;
1547 data_size =
sizeof(JoystickPushMessage_data_t);
1550 data = (JoystickPushMessage_data_t *)
data_ptr;
1552 data->button = ini_button;
1558 data_size =
sizeof(JoystickPushMessage_data_t);
1561 data = (JoystickPushMessage_data_t *)
data_ptr;
1580 data = (JoystickPushMessage_data_t *)
data_ptr;
1592 return data->button;
1635 data_size =
sizeof(JoystickReleaseMessage_data_t);
1638 data = (JoystickReleaseMessage_data_t *)
data_ptr;
1656 data = (JoystickReleaseMessage_data_t *)
data_ptr;
size_t maxlenof_euler3() const
Get maximum length of euler3 value.
JoystickPushMessage Fawkes BlackBoard Interface Message.
AngularGotoMessage Fawkes BlackBoard Interface Message.
void * data_ptr
Pointer to local memory storage.
void set_y(const float new_y)
Set y value.
bool is_connected() const
Get connected value.
void set_finger1(const float new_finger1)
Set finger1 value.
float finger3() const
Get finger3 value.
bool is_final() const
Get final value.
~CartesianGotoMessage()
Destructor.
SetPlannerParamsMessage()
Constructor.
~MoveGripperMessage()
Destructor.
size_t maxlenof_j6() const
Get maximum length of j6 value.
virtual Message * clone() const
Clone this message.
float y() const
Get y value.
StopMessage Fawkes BlackBoard Interface Message.
virtual Message * create_message(const char *type) const
Create message based on type name.
void set_x(const float new_x)
Set x value.
size_t maxlenof_finger2() const
Get maximum length of finger2 value.
~AngularGotoMessage()
Destructor.
size_t maxlenof_j3() const
Get maximum length of j3 value.
void set_connected(const bool new_connected)
Set connected value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
float z() const
Get z value.
uint32_t error_code() const
Get error_code value.
void set_finger1(const float new_finger1)
Set finger1 value.
void set_j2(const float new_j2)
Set j2 value.
size_t maxlenof_e3() const
Get maximum length of e3 value.
void * data_ptr
Pointer to memory that contains local data.
void set_y(const float new_y)
Set y value.
float e1() const
Get e1 value.
CartesianGotoMessage()
Constructor.
size_t maxlenof_euler2() const
Get maximum length of euler2 value.
size_t maxlenof_e1() const
Get maximum length of e1 value.
MoveGripperMessage()
Constructor.
message_data_ts_t * data_ts
data timestamp aliasing pointer
float j4() const
Get j4 value.
~SetPlannerParamsMessage()
Destructor.
uint32_t msgid() const
Get msgid value.
float euler3() const
Get euler3 value.
@ IFT_UINT32
32 bit unsigned integer field
void set_x(const float new_x)
Set x value.
static const uint32_t ERROR_NONE
ERROR_NONE constant.
~StopMessage()
Destructor.
size_t maxlenof_initialized() const
Get maximum length of initialized value.
size_t maxlenof_z() const
Get maximum length of z value.
size_t maxlenof_finger3() const
Get maximum length of finger3 value.
RetractMessage Fawkes BlackBoard Interface Message.
const char * type() const
Get type of interface.
void set_j5(const float new_j5)
Set j5 value.
float z() const
Get z value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the field info list.
JoystickReleaseMessage()
Constructor.
void set_e2(const float new_e2)
Set e2 value.
float finger1() const
Get finger1 value.
float j1() const
Get j1 value.
size_t maxlenof_y() const
Get maximum length of y value.
float x() const
Get x value.
float * joints() const
Get joints value.
float j5() const
Get j5 value.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
size_t maxlenof_z() const
Get maximum length of z value.
void set_z(const float new_z)
Set z value.
size_t maxlenof_j4() const
Get maximum length of j4 value.
RetractMessage()
Constructor.
float j3() const
Get j3 value.
size_t maxlenof_e2() const
Get maximum length of e2 value.
Timestamp data, must be present and first entries for each interface data structs!...
size_t maxlenof_finger3() const
Get maximum length of finger3 value.
void set_e1(const float new_e1)
Set e1 value.
bool is_initialized() const
Get initialized value.
bool data_changed
Indicator if data has changed.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void set_finger3(const float new_finger3)
Set finger3 value.
virtual Message * clone() const
Clone this message.
float finger1() const
Get finger1 value.
virtual Message * clone() const
Clone this message.
void set_j1(const float new_j1)
Set j1 value.
size_t maxlenof_j5() const
Get maximum length of j5 value.
MoveGripperMessage Fawkes BlackBoard Interface Message.
void set_euler3(const float new_euler3)
Set euler3 value.
static const uint32_t ERROR_NO_IK
ERROR_NO_IK constant.
~JoystickPushMessage()
Destructor.
float e2() const
Get e2 value.
Fawkes library namespace.
void set_joints(unsigned int index, const float new_joints)
Set joints value at given index.
CartesianGotoMessage Fawkes BlackBoard Interface Message.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
void set_hash(unsigned char *ihash)
Set hash.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
StopMessage()
Constructor.
unsigned int data_size
Size of memory needed to hold all data.
float y() const
Get y value.
size_t maxlenof_finger2() const
Get maximum length of finger2 value.
virtual Message * clone() const
Clone this message.
uint32_t button() const
Get button value.
size_t maxlenof_finger1() const
Get maximum length of finger1 value.
float euler2() const
Get euler2 value.
Base class for all Fawkes BlackBoard interfaces.
virtual Message * clone() const
Clone this message.
void set_z(const float new_z)
Set z value.
virtual Message * clone() const
Clone this message.
void set_euler1(const float new_euler1)
Set euler1 value.
float finger3() const
Get finger3 value.
size_t maxlenof_j2() const
Get maximum length of j2 value.
float j6() const
Get j6 value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
~CalibrateMessage()
Destructor.
void set_finger2(const float new_finger2)
Set finger2 value.
JoystickPushMessage()
Constructor.
size_t maxlenof_x() const
Get maximum length of x value.
size_t maxlenof_y() const
Get maximum length of y value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
size_t maxlenof_final() const
Get maximum length of final value.
size_t maxlenof_euler1() const
Get maximum length of euler1 value.
size_t maxlenof_j1() const
Get maximum length of j1 value.
static const uint32_t ERROR_UNSPECIFIC
ERROR_UNSPECIFIC constant.
unsigned int data_size
Minimal data size to hold data storage.
virtual Message * clone() const
Clone this message.
void set_error_code(const uint32_t new_error_code)
Set error_code value.
size_t maxlenof_params() const
Get maximum length of params value.
static const uint32_t ERROR_PLANNING
ERROR_PLANNING constant.
size_t maxlenof_finger1() const
Get maximum length of finger1 value.
size_t maxlenof_joints() const
Get maximum length of joints value.
size_t maxlenof_x() const
Get maximum length of x value.
char * params() const
Get params value.
float finger2() const
Get finger2 value.
size_t maxlenof_button() const
Get maximum length of button value.
void set_euler2(const float new_euler2)
Set euler2 value.
~RetractMessage()
Destructor.
float j2() const
Get j2 value.
void set_params(const char *new_params)
Set params value.
void set_finger2(const float new_finger2)
Set finger2 value.
virtual Message * clone() const
Clone this message.
float e3() const
Get e3 value.
size_t maxlenof_connected() const
Get maximum length of connected value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
CalibrateMessage Fawkes BlackBoard Interface Message.
void set_button(const uint32_t new_button)
Set button value.
void set_j4(const float new_j4)
Set j4 value.
void set_initialized(const bool new_initialized)
Set initialized value.
JacoInterface Fawkes BlackBoard Interface.
void set_final(const bool new_final)
Set final value.
SetPlannerParamsMessage Fawkes BlackBoard Interface Message.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
float euler1() const
Get euler1 value.
void set_j3(const float new_j3)
Set j3 value.
float finger2() const
Get finger2 value.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
void set_finger3(const float new_finger3)
Set finger3 value.
void set_j6(const float new_j6)
Set j6 value.
void set_e3(const float new_e3)
Set e3 value.
CalibrateMessage()
Constructor.
JoystickReleaseMessage Fawkes BlackBoard Interface Message.
float x() const
Get x value.
AngularGotoMessage()
Constructor.
virtual Message * clone() const
Clone this message.
~JoystickReleaseMessage()
Destructor.
Base class for exceptions in Fawkes.