24 #ifndef __INTERFACES_KATANAINTERFACE_H_ 25 #define __INTERFACES_KATANAINTERFACE_H_ 27 #include <interface/interface.h> 28 #include <interface/message.h> 29 #include <interface/field_iterator.h> 65 typedef struct __attribute__((packed)) {
66 int64_t timestamp_sec;
67 int64_t timestamp_usec;
92 } KatanaInterface_data_t;
94 KatanaInterface_data_t *data;
102 typedef struct __attribute__((packed)) {
103 int64_t timestamp_sec;
104 int64_t timestamp_usec;
105 } StopMessage_data_t;
107 StopMessage_data_t *data;
115 virtual Message * clone()
const;
122 typedef struct __attribute__((packed)) {
123 int64_t timestamp_sec;
124 int64_t timestamp_usec;
125 } FlushMessage_data_t;
127 FlushMessage_data_t *data;
135 virtual Message * clone()
const;
142 typedef struct __attribute__((packed)) {
143 int64_t timestamp_sec;
144 int64_t timestamp_usec;
145 } ParkMessage_data_t;
147 ParkMessage_data_t *data;
155 virtual Message * clone()
const;
162 typedef struct __attribute__((packed)) {
163 int64_t timestamp_sec;
164 int64_t timestamp_usec;
169 char trans_frame[32];
182 } LinearGotoMessage_data_t;
184 LinearGotoMessage_data_t *data;
187 LinearGotoMessage(
const float ini_theta_error,
const float ini_offset_xy,
const bool ini_straight,
const char * ini_trans_frame,
const char * ini_rot_frame,
const float ini_x,
const float ini_y,
const float ini_z,
const float ini_phi,
const float ini_theta,
const float ini_psi);
193 float theta_error()
const;
194 void set_theta_error(
const float new_theta_error);
195 size_t maxlenof_theta_error()
const;
196 float offset_xy()
const;
197 void set_offset_xy(
const float new_offset_xy);
198 size_t maxlenof_offset_xy()
const;
199 bool is_straight()
const;
200 void set_straight(
const bool new_straight);
201 size_t maxlenof_straight()
const;
202 char * trans_frame()
const;
203 void set_trans_frame(
const char * new_trans_frame);
204 size_t maxlenof_trans_frame()
const;
205 char * rot_frame()
const;
206 void set_rot_frame(
const char * new_rot_frame);
207 size_t maxlenof_rot_frame()
const;
209 void set_x(
const float new_x);
212 void set_y(
const float new_y);
215 void set_z(
const float new_z);
218 void set_phi(
const float new_phi);
224 void set_psi(
const float new_psi);
226 virtual Message * clone()
const;
233 typedef struct __attribute__((packed)) {
234 int64_t timestamp_sec;
235 int64_t timestamp_usec;
245 } LinearGotoKniMessage_data_t;
247 LinearGotoKniMessage_data_t *data;
250 LinearGotoKniMessage(
const float ini_x,
const float ini_y,
const float ini_z,
const float ini_phi,
const float ini_theta,
const float ini_psi);
257 void set_x(
const float new_x);
260 void set_y(
const float new_y);
263 void set_z(
const float new_z);
266 void set_phi(
const float new_phi);
272 void set_psi(
const float new_psi);
274 virtual Message * clone()
const;
281 typedef struct __attribute__((packed)) {
282 int64_t timestamp_sec;
283 int64_t timestamp_usec;
286 } ObjectGotoMessage_data_t;
288 ObjectGotoMessage_data_t *data;
297 char * object()
const;
298 void set_object(
const char * new_object);
299 size_t maxlenof_object()
const;
301 void set_rot_x(
const float new_rot_x);
302 size_t maxlenof_rot_x()
const;
303 virtual Message * clone()
const;
310 typedef struct __attribute__((packed)) {
311 int64_t timestamp_sec;
312 int64_t timestamp_usec;
313 } CalibrateMessage_data_t;
315 CalibrateMessage_data_t *data;
323 virtual Message * clone()
const;
330 typedef struct __attribute__((packed)) {
331 int64_t timestamp_sec;
332 int64_t timestamp_usec;
333 } OpenGripperMessage_data_t;
335 OpenGripperMessage_data_t *data;
343 virtual Message * clone()
const;
350 typedef struct __attribute__((packed)) {
351 int64_t timestamp_sec;
352 int64_t timestamp_usec;
353 } CloseGripperMessage_data_t;
355 CloseGripperMessage_data_t *data;
363 virtual Message * clone()
const;
370 typedef struct __attribute__((packed)) {
371 int64_t timestamp_sec;
372 int64_t timestamp_usec;
374 } SetEnabledMessage_data_t;
376 SetEnabledMessage_data_t *data;
388 virtual Message * clone()
const;
395 typedef struct __attribute__((packed)) {
396 int64_t timestamp_sec;
397 int64_t timestamp_usec;
399 } SetMaxVelocityMessage_data_t;
401 SetMaxVelocityMessage_data_t *data;
413 virtual Message * clone()
const;
420 typedef struct __attribute__((packed)) {
421 int64_t timestamp_sec;
422 int64_t timestamp_usec;
423 char plannerparams[1024];
425 } SetPlannerParamsMessage_data_t;
427 SetPlannerParamsMessage_data_t *data;
436 char * plannerparams()
const;
437 void set_plannerparams(
const char * new_plannerparams);
438 size_t maxlenof_plannerparams()
const;
439 bool is_straight()
const;
440 void set_straight(
const bool new_straight);
441 size_t maxlenof_straight()
const;
442 virtual Message * clone()
const;
449 typedef struct __attribute__((packed)) {
450 int64_t timestamp_sec;
451 int64_t timestamp_usec;
454 } SetMotorEncoderMessage_data_t;
456 SetMotorEncoderMessage_data_t *data;
466 void set_nr(
const uint32_t new_nr);
467 size_t maxlenof_nr()
const;
468 uint32_t enc()
const;
469 void set_enc(
const uint32_t new_enc);
470 size_t maxlenof_enc()
const;
471 virtual Message * clone()
const;
478 typedef struct __attribute__((packed)) {
479 int64_t timestamp_sec;
480 int64_t timestamp_usec;
483 } MoveMotorEncoderMessage_data_t;
485 MoveMotorEncoderMessage_data_t *data;
495 void set_nr(
const uint32_t new_nr);
496 size_t maxlenof_nr()
const;
497 uint32_t enc()
const;
498 void set_enc(
const uint32_t new_enc);
499 size_t maxlenof_enc()
const;
500 virtual Message * clone()
const;
507 typedef struct __attribute__((packed)) {
508 int64_t timestamp_sec;
509 int64_t timestamp_usec;
512 } SetMotorAngleMessage_data_t;
514 SetMotorAngleMessage_data_t *data;
524 void set_nr(
const uint32_t new_nr);
525 size_t maxlenof_nr()
const;
527 void set_angle(
const float new_angle);
528 size_t maxlenof_angle()
const;
529 virtual Message * clone()
const;
536 typedef struct __attribute__((packed)) {
537 int64_t timestamp_sec;
538 int64_t timestamp_usec;
541 } MoveMotorAngleMessage_data_t;
543 MoveMotorAngleMessage_data_t *data;
553 void set_nr(
const uint32_t new_nr);
554 size_t maxlenof_nr()
const;
556 void set_angle(
const float new_angle);
557 size_t maxlenof_angle()
const;
558 virtual Message * clone()
const;
574 void set_x(
const float new_x);
577 void set_y(
const float new_y);
580 void set_z(
const float new_z);
583 void set_phi(
const float new_phi);
589 void set_psi(
const float new_psi);
592 int32_t
encoders(
unsigned int index)
const;
593 void set_encoders(
unsigned int index,
const int32_t new_encoders);
597 float angles(
unsigned int index)
const;
598 void set_angles(
unsigned int index,
const float new_angles);
601 uint32_t
msgid()
const;
602 void set_msgid(
const uint32_t new_msgid);
625 virtual const char *
enum_tostring(
const char *enumtype,
int val)
const;
static const uint32_t SENSOR_IR_LEFT_INNER_FRONT
SENSOR_IR_LEFT_INNER_FRONT constant.
int32_t * encoders() const
Get encoders value.
static const uint32_t ERROR_NO_SOLUTION
ERROR_NO_SOLUTION constant.
static const uint32_t SENSOR_IR_RIGHT_INNER_FRONT
SENSOR_IR_RIGHT_INNER_FRONT constant.
void set_enabled(const bool new_enabled)
Set enabled value.
void set_sensor_value(unsigned int index, const uint8_t new_sensor_value)
Set sensor_value value at given index.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void set_z(const float new_z)
Set z value.
size_t maxlenof_final() const
Get maximum length of final value.
static const uint32_t SENSOR_IR_CENTER_GRIPPER
SENSOR_IR_CENTER_GRIPPER constant.
LinearGotoKniMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_y() const
Get maximum length of y value.
void set_num_motors(const uint8_t new_num_motors)
Set num_motors value.
void set_y(const float new_y)
Set y value.
Fawkes library namespace.
size_t maxlenof_encoders() const
Get maximum length of encoders value.
CalibrateMessage Fawkes BlackBoard Interface Message.
float theta() const
Get theta value.
static const uint32_t SENSOR_IR_LEFT_INNER_MIDDLE
SENSOR_IR_LEFT_INNER_MIDDLE constant.
uint8_t max_velocity() const
Get max_velocity value.
void set_final(const bool new_final)
Set final value.
SetMotorEncoderMessage Fawkes BlackBoard Interface Message.
static const uint32_t SENSOR_IR_RIGHT_BOTTOM_FRONT
SENSOR_IR_RIGHT_BOTTOM_FRONT constant.
void set_calibrated(const bool new_calibrated)
Set calibrated value.
static const uint32_t SENSOR_IR_LEFT_OUTER_FRONT
SENSOR_IR_LEFT_OUTER_FRONT constant.
size_t maxlenof_theta() const
Get maximum length of theta value.
static const uint32_t SENSOR_FORCE_LEFT_FRONT
SENSOR_FORCE_LEFT_FRONT constant.
size_t maxlenof_phi() const
Get maximum length of phi value.
size_t maxlenof_max_velocity() const
Get maximum length of max_velocity value.
SetMotorAngleMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_psi() const
Get maximum length of psi value.
void set_phi(const float new_phi)
Set phi value.
Base class for all Fawkes BlackBoard interfaces.
void set_psi(const float new_psi)
Set psi value.
static const uint32_t SENSOR_COND_BOTH
SENSOR_COND_BOTH constant.
void set_theta(const float new_theta)
Set theta value.
static const uint32_t ERROR_UNSPECIFIC
ERROR_UNSPECIFIC constant.
size_t maxlenof_num_motors() const
Get maximum length of num_motors value.
static const uint32_t SENSOR_FORCE_RIGHT_REAR
SENSOR_FORCE_RIGHT_REAR constant.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
ObjectGotoMessage Fawkes BlackBoard Interface Message.
static const uint32_t SENSOR_RESERVED_2
SENSOR_RESERVED_2 constant.
float * angles() const
Get angles value.
uint32_t error_code() const
Get error_code value.
bool is_enabled() const
Get enabled value.
static const uint32_t ERROR_COMMUNICATION
ERROR_COMMUNICATION constant.
virtual Message * create_message(const char *type) const
Create message based on type name.
OpenGripperMessage Fawkes BlackBoard Interface Message.
virtual void copy_values(const Interface *other)
Copy values from other interface.
const char * type() const
Get type of interface.
KatanaInterface Fawkes BlackBoard Interface.
static const uint32_t SENSOR_IR_RIGHT_OUTER_FRONT
SENSOR_IR_RIGHT_OUTER_FRONT constant.
float x() const
Get x value.
LinearGotoMessage Fawkes BlackBoard Interface Message.
float z() const
Get z value.
SetPlannerParamsMessage Fawkes BlackBoard Interface Message.
static const uint32_t ERROR_NONE
ERROR_NONE constant.
size_t maxlenof_angles() const
Get maximum length of angles value.
SetMaxVelocityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
void set_error_code(const uint32_t new_error_code)
Set error_code value.
static const uint32_t ERROR_MOTOR_CRASHED
ERROR_MOTOR_CRASHED constant.
void set_angles(unsigned int index, const float new_angles)
Set angles value at given index.
CloseGripperMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
static const uint32_t SENSOR_FORCE_LEFT_REAR
SENSOR_FORCE_LEFT_REAR constant.
uint8_t num_motors() const
Get num_motors value.
float psi() const
Get psi value.
void set_x(const float new_x)
Set x value.
size_t maxlenof_x() const
Get maximum length of x value.
StopMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_sensor_value() const
Get maximum length of sensor_value value.
MoveMotorAngleMessage Fawkes BlackBoard Interface Message.
void set_encoders(unsigned int index, const int32_t new_encoders)
Set encoders value at given index.
uint8_t * sensor_value() const
Get sensor_value value.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
float y() const
Get y value.
static const uint32_t SENSOR_FORCE_RIGHT_FRONT
SENSOR_FORCE_RIGHT_FRONT constant.
static const uint32_t SENSOR_IR_RIGHT_INNER_MIDDLE
SENSOR_IR_RIGHT_INNER_MIDDLE constant.
MoveMotorEncoderMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_calibrated() const
Get maximum length of calibrated value.
static const uint32_t SENSOR_IR_LEFT_BOTTOM_FRONT
SENSOR_IR_LEFT_BOTTOM_FRONT constant.
ParkMessage Fawkes BlackBoard Interface Message.
void set_max_velocity(const uint8_t new_max_velocity)
Set max_velocity value.
float phi() const
Get phi value.
FlushMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_z() const
Get maximum length of z value.
bool is_final() const
Get final value.
uint32_t msgid() const
Get msgid value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
static const uint32_t SENSOR_RESERVED_10
SENSOR_RESERVED_10 constant.
bool is_calibrated() const
Get calibrated value.
SetEnabledMessage Fawkes BlackBoard Interface Message.
static const uint32_t ERROR_CMD_START_FAILED
ERROR_CMD_START_FAILED constant.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.