24 #ifndef __INTERFACES_MOTORINTERFACE_H_ 25 #define __INTERFACES_MOTORINTERFACE_H_ 27 #include <interface/interface.h> 28 #include <interface/message.h> 29 #include <interface/field_iterator.h> 51 typedef struct __attribute__((packed)) {
52 int64_t timestamp_sec;
53 int64_t timestamp_usec;
108 } MotorInterface_data_t;
110 MotorInterface_data_t *data;
118 typedef struct __attribute__((packed)) {
119 int64_t timestamp_sec;
120 int64_t timestamp_usec;
124 } SetMotorStateMessage_data_t;
126 SetMotorStateMessage_data_t *data;
138 virtual Message * clone()
const;
145 typedef struct __attribute__((packed)) {
146 int64_t timestamp_sec;
147 int64_t timestamp_usec;
157 } AcquireControlMessage_data_t;
159 AcquireControlMessage_data_t *data;
174 virtual Message * clone()
const;
181 typedef struct __attribute__((packed)) {
182 int64_t timestamp_sec;
183 int64_t timestamp_usec;
184 } ResetOdometryMessage_data_t;
186 ResetOdometryMessage_data_t *data;
194 virtual Message * clone()
const;
201 typedef struct __attribute__((packed)) {
202 int64_t timestamp_sec;
203 int64_t timestamp_usec;
207 } SetOdometryMessage_data_t;
209 SetOdometryMessage_data_t *data;
212 SetOdometryMessage(
const float ini_x,
const float ini_y,
const float ini_odometry_orientation);
219 void set_x(
const float new_x);
220 size_t maxlenof_x()
const;
222 void set_y(
const float new_y);
223 size_t maxlenof_y()
const;
227 virtual Message * clone()
const;
234 typedef struct __attribute__((packed)) {
235 int64_t timestamp_sec;
236 int64_t timestamp_usec;
240 } DriveRPMMessage_data_t;
242 DriveRPMMessage_data_t *data;
245 DriveRPMMessage(
const float ini_front_right,
const float ini_front_left,
const float ini_rear);
251 float front_right()
const;
252 void set_front_right(
const float new_front_right);
253 size_t maxlenof_front_right()
const;
254 float front_left()
const;
255 void set_front_left(
const float new_front_left);
256 size_t maxlenof_front_left()
const;
258 void set_rear(
const float new_rear);
259 size_t maxlenof_rear()
const;
260 virtual Message * clone()
const;
267 typedef struct __attribute__((packed)) {
268 int64_t timestamp_sec;
269 int64_t timestamp_usec;
274 } GotoMessage_data_t;
276 GotoMessage_data_t *data;
279 GotoMessage(
const float ini_x,
const float ini_y,
const float ini_phi,
const float ini_time_sec);
286 void set_x(
const float new_x);
287 size_t maxlenof_x()
const;
289 void set_y(
const float new_y);
290 size_t maxlenof_y()
const;
292 void set_phi(
const float new_phi);
293 size_t maxlenof_phi()
const;
294 float time_sec()
const;
295 void set_time_sec(
const float new_time_sec);
296 size_t maxlenof_time_sec()
const;
297 virtual Message * clone()
const;
304 typedef struct __attribute__((packed)) {
305 int64_t timestamp_sec;
306 int64_t timestamp_usec;
309 } TransMessage_data_t;
311 TransMessage_data_t *data;
321 void set_vx(
const float new_vx);
324 void set_vy(
const float new_vy);
326 virtual Message * clone()
const;
333 typedef struct __attribute__((packed)) {
334 int64_t timestamp_sec;
335 int64_t timestamp_usec;
339 RotMessage_data_t *data;
351 virtual Message * clone()
const;
358 typedef struct __attribute__((packed)) {
359 int64_t timestamp_sec;
360 int64_t timestamp_usec;
364 } TransRotMessage_data_t;
366 TransRotMessage_data_t *data;
369 TransRotMessage(
const float ini_vx,
const float ini_vy,
const float ini_omega);
376 void set_vx(
const float new_vx);
379 void set_vy(
const float new_vy);
384 virtual Message * clone()
const;
391 typedef struct __attribute__((packed)) {
392 int64_t timestamp_sec;
393 int64_t timestamp_usec;
397 } OrbitMessage_data_t;
399 OrbitMessage_data_t *data;
402 OrbitMessage(
const float ini_px,
const float ini_py,
const float ini_omega);
409 void set_px(
const float new_px);
410 size_t maxlenof_px()
const;
412 void set_py(
const float new_py);
413 size_t maxlenof_py()
const;
417 virtual Message * clone()
const;
424 typedef struct __attribute__((packed)) {
425 int64_t timestamp_sec;
426 int64_t timestamp_usec;
430 } LinTransRotMessage_data_t;
432 LinTransRotMessage_data_t *data;
442 void set_vx(
const float new_vx);
445 void set_vy(
const float new_vy);
450 virtual Message * clone()
const;
488 void set_vx(
const float new_vx);
491 void set_vy(
const float new_vy);
514 virtual const char *
enum_tostring(
const char *enumtype,
int val)
const;
void set_des_vx(const float new_des_vx)
Set des_vx value.
SetMotorStateMessage Fawkes BlackBoard Interface Message.
static const uint32_t DRIVE_MODE_LINE_TRANS_ROT
DRIVE_MODE_LINE_TRANS_ROT constant.
size_t maxlenof_omega() const
Get maximum length of omega value.
RotMessage Fawkes BlackBoard Interface Message.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
static const uint32_t MOTOR_ENABLED
MOTOR_ENABLED constant.
float odometry_position_x() const
Get odometry_position_x value.
static const uint32_t DRIVE_MODE_RPM
DRIVE_MODE_RPM constant.
TransRotMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_odometry_position_x() const
Get maximum length of odometry_position_x value.
void set_odometry_position_y(const float new_odometry_position_y)
Set odometry_position_y value.
uint32_t controller() const
Get controller value.
Fawkes library namespace.
size_t maxlenof_rear_rpm() const
Get maximum length of rear_rpm value.
size_t maxlenof_vx() const
Get maximum length of vx value.
int32_t left_rpm() const
Get left_rpm value.
void set_motor_state(const uint32_t new_motor_state)
Set motor_state value.
float odometry_path_length() const
Get odometry_path_length value.
virtual Message * create_message(const char *type) const
Create message based on type name.
void set_controller(const uint32_t new_controller)
Set controller value.
void set_odometry_orientation(const float new_odometry_orientation)
Set odometry_orientation value.
void set_rear_rpm(const int32_t new_rear_rpm)
Set rear_rpm value.
OrbitMessage Fawkes BlackBoard Interface Message.
uint32_t drive_mode() const
Get drive_mode value.
size_t maxlenof_right_rpm() const
Get maximum length of right_rpm value.
Base class for all Fawkes BlackBoard interfaces.
size_t maxlenof_controller() const
Get maximum length of controller value.
int32_t rear_rpm() const
Get rear_rpm value.
size_t maxlenof_motor_state() const
Get maximum length of motor_state value.
size_t maxlenof_odometry_orientation() const
Get maximum length of odometry_orientation value.
void set_right_rpm(const int32_t new_right_rpm)
Set right_rpm value.
void set_left_rpm(const int32_t new_left_rpm)
Set left_rpm value.
float vx() const
Get vx value.
void set_des_omega(const float new_des_omega)
Set des_omega value.
ResetOdometryMessage Fawkes BlackBoard Interface Message.
void set_odometry_path_length(const float new_odometry_path_length)
Set odometry_path_length value.
size_t maxlenof_drive_mode() const
Get maximum length of drive_mode value.
float odometry_orientation() const
Get odometry_orientation value.
float odometry_position_y() const
Get odometry_position_y value.
AcquireControlMessage Fawkes BlackBoard Interface Message.
void set_des_vy(const float new_des_vy)
Set des_vy value.
float vy() const
Get vy value.
const char * type() const
Get type of interface.
static const uint32_t DRIVE_MODE_TRANS_ROT
DRIVE_MODE_TRANS_ROT constant.
void set_vy(const float new_vy)
Set vy value.
void set_vx(const float new_vx)
Set vx value.
static const uint32_t DRIVE_MODE_TRANS
DRIVE_MODE_TRANS constant.
void set_omega(const float new_omega)
Set omega value.
size_t maxlenof_des_vy() const
Get maximum length of des_vy value.
float omega() const
Get omega value.
int32_t right_rpm() const
Get right_rpm value.
void set_controller_thread_name(const char *new_controller_thread_name)
Set controller_thread_name value.
LinTransRotMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_controller_thread_name() const
Get maximum length of controller_thread_name value.
char * controller_thread_name() const
Get controller_thread_name value.
float des_vx() const
Get des_vx value.
DriveRPMMessage Fawkes BlackBoard Interface Message.
void set_drive_mode(const uint32_t new_drive_mode)
Set drive_mode value.
float des_omega() const
Get des_omega value.
static const uint32_t MOTOR_DISABLED
MOTOR_DISABLED constant.
void set_odometry_position_x(const float new_odometry_position_x)
Set odometry_position_x value.
float des_vy() const
Get des_vy value.
size_t maxlenof_left_rpm() const
Get maximum length of left_rpm value.
size_t maxlenof_odometry_position_y() const
Get maximum length of odometry_position_y value.
static const uint32_t DRIVE_MODE_ORBIT
DRIVE_MODE_ORBIT constant.
MotorInterface Fawkes BlackBoard Interface.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
size_t maxlenof_des_omega() const
Get maximum length of des_omega value.
size_t maxlenof_odometry_path_length() const
Get maximum length of odometry_path_length value.
GotoMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_des_vx() const
Get maximum length of des_vx value.
SetOdometryMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_vy() const
Get maximum length of vy value.
uint32_t motor_state() const
Get motor_state value.
static const uint32_t DRIVE_MODE_ROT
DRIVE_MODE_ROT constant.
virtual void copy_values(const Interface *other)
Copy values from other interface.
TransMessage Fawkes BlackBoard Interface Message.