24 #include <interfaces/JacoBimanualInterface.h> 26 #include <core/exceptions/software.h> 54 JacoBimanualInterface::JacoBimanualInterface() : Interface()
56 data_size =
sizeof(JacoBimanualInterface_data_t);
57 data_ptr = malloc(data_size);
58 data = (JacoBimanualInterface_data_t *)data_ptr;
59 data_ts = (interface_data_ts_t *)data_ptr;
60 memset(data_ptr, 0, data_size);
61 add_fieldinfo(IFT_UINT32,
"msgid", 1, &data->msgid);
62 add_fieldinfo(IFT_BOOL,
"final", 1, &data->final);
63 add_fieldinfo(IFT_UINT32,
"error_code", 1, &data->error_code);
64 add_fieldinfo(IFT_BOOL,
"constrained", 1, &data->constrained);
65 add_messageinfo(
"CartesianGotoMessage");
66 add_messageinfo(
"MoveGripperMessage");
67 add_messageinfo(
"SetPlannerParamsMessage");
68 add_messageinfo(
"SetConstrainedMessage");
69 unsigned char tmp_hash[] = {0x7c, 0x62, 0x7a, 0x5a, 0xc6, 0xc1, 0xb4, 0x12, 0x6f, 0xa4, 0x89, 0x89, 0xb8, 0xe5, 0x1, 0x66};
74 JacoBimanualInterface::~JacoBimanualInterface()
85 JacoBimanualInterface::msgid()
const 95 JacoBimanualInterface::maxlenof_msgid()
const 106 JacoBimanualInterface::set_msgid(
const uint32_t new_msgid)
108 data->msgid = new_msgid;
118 JacoBimanualInterface::is_final()
const 128 JacoBimanualInterface::maxlenof_final()
const 139 JacoBimanualInterface::set_final(
const bool new_final)
141 data->final = new_final;
152 JacoBimanualInterface::error_code()
const 154 return data->error_code;
162 JacoBimanualInterface::maxlenof_error_code()
const 174 JacoBimanualInterface::set_error_code(
const uint32_t new_error_code)
176 data->error_code = new_error_code;
186 JacoBimanualInterface::is_constrained()
const 188 return data->constrained;
196 JacoBimanualInterface::maxlenof_constrained()
const 207 JacoBimanualInterface::set_constrained(
const bool new_constrained)
209 data->constrained = new_constrained;
215 JacoBimanualInterface::create_message(
const char *type)
const 217 if ( strncmp(
"CartesianGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
219 }
else if ( strncmp(
"MoveGripperMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
221 }
else if ( strncmp(
"SetPlannerParamsMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
223 }
else if ( strncmp(
"SetConstrainedMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
227 "message type for this interface type.", type);
236 JacoBimanualInterface::copy_values(
const Interface *other)
241 type(), other->
type());
243 memcpy(data, oi->data,
sizeof(JacoBimanualInterface_data_t));
247 JacoBimanualInterface::enum_tostring(
const char *enumtype,
int val)
const 274 JacoBimanualInterface::CartesianGotoMessage::CartesianGotoMessage(
const float ini_l_x,
const float ini_l_y,
const float ini_l_z,
const float ini_l_e1,
const float ini_l_e2,
const float ini_l_e3,
const float ini_r_x,
const float ini_r_y,
const float ini_r_z,
const float ini_r_e1,
const float ini_r_e2,
const float ini_r_e3) :
Message(
"CartesianGotoMessage")
276 data_size =
sizeof(CartesianGotoMessage_data_t);
279 data = (CartesianGotoMessage_data_t *)
data_ptr;
284 data->l_e1 = ini_l_e1;
285 data->l_e2 = ini_l_e2;
286 data->l_e3 = ini_l_e3;
290 data->r_e1 = ini_r_e1;
291 data->r_e2 = ini_r_e2;
292 data->r_e3 = ini_r_e3;
309 data_size =
sizeof(CartesianGotoMessage_data_t);
312 data = (CartesianGotoMessage_data_t *)
data_ptr;
342 data = (CartesianGotoMessage_data_t *)
data_ptr;
464 data->l_e1 = new_l_e1;
494 data->l_e2 = new_l_e2;
524 data->l_e3 = new_l_e3;
644 data->r_e1 = new_r_e1;
674 data->r_e2 = new_r_e2;
704 data->r_e3 = new_r_e3;
734 data_size =
sizeof(MoveGripperMessage_data_t);
737 data = (MoveGripperMessage_data_t *)
data_ptr;
739 data->l_finger1 = ini_l_finger1;
740 data->l_finger2 = ini_l_finger2;
741 data->l_finger3 = ini_l_finger3;
742 data->r_finger1 = ini_r_finger1;
743 data->r_finger2 = ini_r_finger2;
744 data->r_finger3 = ini_r_finger3;
755 data_size =
sizeof(MoveGripperMessage_data_t);
758 data = (MoveGripperMessage_data_t *)
data_ptr;
782 data = (MoveGripperMessage_data_t *)
data_ptr;
794 return data->l_finger1;
814 data->l_finger1 = new_l_finger1;
824 return data->l_finger2;
844 data->l_finger2 = new_l_finger2;
854 return data->l_finger3;
874 data->l_finger3 = new_l_finger3;
884 return data->r_finger1;
904 data->r_finger1 = new_r_finger1;
914 return data->r_finger2;
934 data->r_finger2 = new_r_finger2;
944 return data->r_finger3;
964 data->r_finger3 = new_r_finger3;
989 data_size =
sizeof(SetPlannerParamsMessage_data_t);
992 data = (SetPlannerParamsMessage_data_t *)
data_ptr;
994 strncpy(data->params, ini_params, 1024);
1000 data_size =
sizeof(SetPlannerParamsMessage_data_t);
1003 data = (SetPlannerParamsMessage_data_t *)
data_ptr;
1022 data = (SetPlannerParamsMessage_data_t *)
data_ptr;
1034 return data->params;
1054 strncpy(data->params, new_params,
sizeof(data->params));
1079 data_size =
sizeof(SetConstrainedMessage_data_t);
1082 data = (SetConstrainedMessage_data_t *)
data_ptr;
1084 data->constrained = ini_constrained;
1090 data_size =
sizeof(SetConstrainedMessage_data_t);
1093 data = (SetConstrainedMessage_data_t *)
data_ptr;
1112 data = (SetConstrainedMessage_data_t *)
data_ptr;
1125 return data->constrained;
1146 data->constrained = new_constrained;
void set_l_x(const float new_l_x)
Set l_x value.
static const uint32_t ERROR_NONE
ERROR_NONE constant.
void set_l_y(const float new_l_y)
Set l_y value.
void set_r_finger3(const float new_r_finger3)
Set r_finger3 value.
MoveGripperMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_l_y() const
Get maximum length of l_y value.
void set_r_z(const float new_r_z)
Set r_z value.
void * data_ptr
Pointer to memory that contains local data.
float l_y() const
Get l_y value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
SetPlannerParamsMessage()
Constructor.
void set_l_finger1(const float new_l_finger1)
Set l_finger1 value.
void set_r_x(const float new_r_x)
Set r_x value.
size_t maxlenof_r_z() const
Get maximum length of r_z value.
size_t maxlenof_r_x() const
Get maximum length of r_x value.
float r_e3() const
Get r_e3 value.
float l_finger1() const
Get l_finger1 value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
size_t maxlenof_r_y() const
Get maximum length of r_y value.
size_t maxlenof_r_e3() const
Get maximum length of r_e3 value.
Fawkes library namespace.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
JacoBimanualInterface Fawkes BlackBoard Interface.
virtual Message * clone() const
Clone this message.
void set_r_y(const float new_r_y)
Set r_y value.
void set_constrained(const bool new_constrained)
Set constrained value.
SetPlannerParamsMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_l_x() const
Get maximum length of l_x value.
void set_l_finger2(const float new_l_finger2)
Set l_finger2 value.
size_t maxlenof_l_e2() const
Get maximum length of l_e2 value.
size_t maxlenof_l_finger2() const
Get maximum length of l_finger2 value.
Base class for all Fawkes BlackBoard interfaces.
size_t maxlenof_l_e3() const
Get maximum length of l_e3 value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
float l_x() const
Get l_x value.
size_t maxlenof_r_finger2() const
Get maximum length of r_finger2 value.
size_t maxlenof_r_e2() const
Get maximum length of r_e2 value.
size_t maxlenof_r_finger3() const
Get maximum length of r_finger3 value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
void set_r_e2(const float new_r_e2)
Set r_e2 value.
float l_e1() const
Get l_e1 value.
void set_r_e3(const float new_r_e3)
Set r_e3 value.
size_t maxlenof_constrained() const
Get maximum length of constrained value.
float r_finger2() const
Get r_finger2 value.
void set_r_finger2(const float new_r_finger2)
Set r_finger2 value.
static const uint32_t ERROR_NO_IK
ERROR_NO_IK constant.
SetConstrainedMessage Fawkes BlackBoard Interface Message.
const char * type() const
Get type of interface.
MoveGripperMessage()
Constructor.
CartesianGotoMessage()
Constructor.
float r_e1() const
Get r_e1 value.
void set_r_e1(const float new_r_e1)
Set r_e1 value.
float l_e2() const
Get l_e2 value.
void set_l_e1(const float new_l_e1)
Set l_e1 value.
~MoveGripperMessage()
Destructor.
void set_l_e2(const float new_l_e2)
Set l_e2 value.
void set_l_finger3(const float new_l_finger3)
Set l_finger3 value.
SetConstrainedMessage()
Constructor.
size_t maxlenof_l_z() const
Get maximum length of l_z value.
~SetPlannerParamsMessage()
Destructor.
bool is_constrained() const
Get constrained value.
static const uint32_t ERROR_UNSPECIFIC
ERROR_UNSPECIFIC constant.
void set_params(const char *new_params)
Set params value.
size_t maxlenof_l_finger3() const
Get maximum length of l_finger3 value.
float r_y() const
Get r_y value.
void set_r_finger1(const float new_r_finger1)
Set r_finger1 value.
size_t maxlenof_r_e1() const
Get maximum length of r_e1 value.
float l_finger3() const
Get l_finger3 value.
float l_finger2() const
Get l_finger2 value.
float r_e2() const
Get r_e2 value.
float r_z() const
Get r_z value.
float l_z() const
Get l_z value.
float r_finger3() const
Get r_finger3 value.
virtual Message * clone() const
Clone this message.
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_params() const
Get maximum length of params value.
~CartesianGotoMessage()
Destructor.
float r_finger1() const
Get r_finger1 value.
void set_l_z(const float new_l_z)
Set l_z value.
size_t maxlenof_r_finger1() const
Get maximum length of r_finger1 value.
CartesianGotoMessage Fawkes BlackBoard Interface Message.
float l_e3() const
Get l_e3 value.
size_t maxlenof_l_finger1() const
Get maximum length of l_finger1 value.
float r_x() const
Get r_x value.
static const uint32_t ERROR_PLANNING
ERROR_PLANNING constant.
void set_l_e3(const float new_l_e3)
Set l_e3 value.
size_t maxlenof_l_e1() const
Get maximum length of l_e1 value.
~SetConstrainedMessage()
Destructor.
char * params() const
Get params value.