24 #include <interfaces/JointInterface.h>
26 #include <core/exceptions/software.h>
46 JointInterface::JointInterface() : Interface()
48 data_size =
sizeof(JointInterface_data_t);
49 data_ptr = malloc(data_size);
50 data = (JointInterface_data_t *)data_ptr;
51 data_ts = (interface_data_ts_t *)data_ptr;
52 memset(data_ptr, 0, data_size);
53 add_fieldinfo(IFT_FLOAT,
"position", 1, &data->position);
54 add_fieldinfo(IFT_FLOAT,
"velocity", 1, &data->velocity);
55 unsigned char tmp_hash[] = {0xd2, 0x74, 0x1b, 0x6a, 0x5b, 0xf, 0xa9, 0xe1, 0xb0, 0xa8, 0x47, 0x84, 0x6f, 0x8f, 0x1c, 0xab};
60 JointInterface::~JointInterface()
72 JointInterface::position()
const
74 return data->position;
82 JointInterface::maxlenof_position()
const
94 JointInterface::set_position(
const float new_position)
96 data_changed |=
change_field(data->position, new_position);
106 JointInterface::velocity()
const
108 return data->velocity;
116 JointInterface::maxlenof_velocity()
const
128 JointInterface::set_velocity(
const float new_velocity)
130 data_changed |=
change_field(data->velocity, new_velocity);
135 JointInterface::create_message(
const char *type)
const
138 "message type for this interface type.", type);
151 type(), other->
type());
153 memcpy(data, oi->data,
sizeof(JointInterface_data_t));
157 JointInterface::enum_tostring(
const char *enumtype,
int val)
const
168 JointInterface::message_valid(
const Message *message)
const
Base class for all Fawkes BlackBoard interfaces.
const char * type() const
Get type of interface.
JointInterface Fawkes BlackBoard Interface.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Fawkes library namespace.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.