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;
145 typedef struct __attribute__((packed)) {
146 int64_t timestamp_sec;
147 int64_t timestamp_usec;
157 } AcquireControlMessage_data_t;
159 AcquireControlMessage_data_t *data;
181 typedef struct __attribute__((packed)) {
182 int64_t timestamp_sec;
183 int64_t timestamp_usec;
184 } ResetOdometryMessage_data_t;
186 ResetOdometryMessage_data_t *data;
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);
222 void set_y(
const float new_y);
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);
258 void set_rear(
const float new_rear);
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);
289 void set_y(
const float new_y);
292 void set_phi(
const float new_phi);
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);
333 typedef struct __attribute__((packed)) {
334 int64_t timestamp_sec;
335 int64_t timestamp_usec;
339 RotMessage_data_t *data;
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);
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);
412 void set_py(
const float new_py);
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);
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;
~TransMessage()
Destructor.
void set_des_vx(const float new_des_vx)
Set des_vx value.
size_t maxlenof_motor_state() const
Get maximum length of motor_state value.
void set_vy(const float new_vy)
Set vy value.
OrbitMessage()
Constructor.
virtual Message * clone() const
Clone this message.
~ResetOdometryMessage()
Destructor.
void set_omega(const float new_omega)
Set omega value.
SetMotorStateMessage Fawkes BlackBoard Interface Message.
float vx() const
Get vx value.
static const uint32_t DRIVE_MODE_LINE_TRANS_ROT
DRIVE_MODE_LINE_TRANS_ROT constant.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
float px() const
Get px value.
size_t maxlenof_omega() const
Get maximum length of omega value.
DriveRPMMessage()
Constructor.
virtual Message * clone() const
Clone this message.
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.
size_t maxlenof_controller() const
Get maximum length of controller value.
float odometry_position_x() const
Get odometry_position_x value.
uint32_t controller() const
Get controller value.
size_t maxlenof_omega() const
Get maximum length of omega value.
virtual Message * clone() const
Clone this message.
void set_rear(const float new_rear)
Set rear value.
float vy() const
Get vy value.
static const uint32_t DRIVE_MODE_RPM
DRIVE_MODE_RPM constant.
virtual Message * clone() const
Clone this message.
void set_omega(const float new_omega)
Set omega value.
void set_vx(const float new_vx)
Set vx value.
TransRotMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_x() const
Get maximum length of x value.
float front_left() const
Get front_left value.
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.
float omega() const
Get omega value.
uint32_t controller() const
Get controller value.
~AcquireControlMessage()
Destructor.
Fawkes library namespace.
~SetOdometryMessage()
Destructor.
size_t maxlenof_rear_rpm() const
Get maximum length of rear_rpm value.
size_t maxlenof_vx() const
Get maximum length of vx value.
TransMessage()
Constructor.
void set_controller(const uint32_t new_controller)
Set controller value.
float y() const
Get y value.
void set_vy(const float new_vy)
Set vy value.
float vx() const
Get vx value.
void set_y(const float new_y)
Set y value.
int32_t left_rpm() const
Get left_rpm value.
void set_motor_state(const uint32_t new_motor_state)
Set motor_state value.
void set_vy(const float new_vy)
Set vy value.
float odometry_path_length() const
Get odometry_path_length value.
SetOdometryMessage()
Constructor.
virtual Message * create_message(const char *type) const
Create message based on type name.
~TransRotMessage()
Destructor.
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.
void set_front_right(const float new_front_right)
Set front_right value.
ResetOdometryMessage()
Constructor.
virtual Message * clone() const
Clone this message.
float x() const
Get x value.
OrbitMessage Fawkes BlackBoard Interface Message.
void set_motor_state(const uint32_t new_motor_state)
Set motor_state value.
size_t maxlenof_front_left() const
Get maximum length of front_left value.
uint32_t drive_mode() const
Get drive_mode value.
size_t maxlenof_right_rpm() const
Get maximum length of right_rpm value.
size_t maxlenof_phi() const
Get maximum length of phi 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.
AcquireControlMessage()
Constructor.
size_t maxlenof_odometry_orientation() const
Get maximum length of odometry_orientation value.
void set_time_sec(const float new_time_sec)
Set time_sec value.
size_t maxlenof_motor_state() const
Get maximum length of motor_state value.
void set_omega(const float new_omega)
Set omega value.
size_t maxlenof_odometry_orientation() const
Get maximum length of odometry_orientation value.
size_t maxlenof_front_right() const
Get maximum length of front_right 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.
float phi() const
Get phi value.
~SetMotorStateMessage()
Destructor.
ResetOdometryMessage Fawkes BlackBoard Interface Message.
void set_odometry_path_length(const float new_odometry_path_length)
Set odometry_path_length value.
virtual Message * clone() const
Clone this message.
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.
LinTransRotMessage()
Constructor.
float time_sec() const
Get time_sec value.
size_t maxlenof_px() const
Get maximum length of px value.
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.
size_t maxlenof_vy() const
Get maximum length of vy value.
static const uint32_t DRIVE_MODE_TRANS_ROT
DRIVE_MODE_TRANS_ROT constant.
void set_x(const float new_x)
Set x value.
~OrbitMessage()
Destructor.
void set_vy(const float new_vy)
Set vy value.
void set_phi(const float new_phi)
Set phi value.
void set_vx(const float new_vx)
Set vx value.
void set_omega(const float new_omega)
Set omega value.
float rear() const
Get rear value.
void set_py(const float new_py)
Set py value.
float omega() const
Get omega value.
static const uint32_t DRIVE_MODE_TRANS
DRIVE_MODE_TRANS constant.
float y() const
Get y value.
void set_omega(const float new_omega)
Set omega value.
size_t maxlenof_des_vy() const
Get maximum length of des_vy value.
void set_odometry_orientation(const float new_odometry_orientation)
Set odometry_orientation value.
size_t maxlenof_vx() const
Get maximum length of vx value.
void set_front_left(const float new_front_left)
Set front_left value.
float omega() const
Get omega value.
size_t maxlenof_y() const
Get maximum length of y value.
int32_t right_rpm() const
Get right_rpm value.
~LinTransRotMessage()
Destructor.
~DriveRPMMessage()
Destructor.
size_t maxlenof_rear() const
Get maximum length of rear value.
void set_controller_thread_name(const char *new_controller_thread_name)
Set controller_thread_name value.
LinTransRotMessage Fawkes BlackBoard Interface Message.
float vx() const
Get vx value.
GotoMessage()
Constructor.
void set_px(const float new_px)
Set px value.
float omega() const
Get omega value.
uint32_t motor_state() const
Get motor_state value.
SetMotorStateMessage()
Constructor.
size_t maxlenof_vx() const
Get maximum length of vx value.
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.
char * controller_thread_name() const
Get controller_thread_name value.
virtual Message * clone() const
Clone this message.
float des_vx() const
Get des_vx value.
DriveRPMMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_omega() const
Get maximum length of omega value.
size_t maxlenof_y() const
Get maximum length of y value.
float vy() const
Get vy value.
void set_drive_mode(const uint32_t new_drive_mode)
Set drive_mode value.
void set_vx(const float new_vx)
Set vx value.
float front_right() const
Get front_right value.
virtual Message * clone() const
Clone this message.
void set_vx(const float new_vx)
Set vx value.
size_t maxlenof_vy() const
Get maximum length of vy value.
size_t maxlenof_vx() const
Get maximum length of vx value.
float des_omega() const
Get des_omega value.
virtual Message * clone() const
Clone this message.
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_omega() const
Get maximum length of omega 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.
size_t maxlenof_controller_thread_name() const
Get maximum length of controller_thread_name value.
MotorInterface Fawkes BlackBoard Interface.
size_t maxlenof_time_sec() const
Get maximum length of time_sec value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
float py() const
Get py value.
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.
TransRotMessage()
Constructor.
float odometry_orientation() const
Get odometry_orientation value.
GotoMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_des_vx() const
Get maximum length of des_vx value.
SetOdometryMessage Fawkes BlackBoard Interface Message.
~GotoMessage()
Destructor.
size_t maxlenof_omega() const
Get maximum length of omega value.
float x() const
Get x value.
size_t maxlenof_vy() const
Get maximum length of vy value.
void set_controller_thread_name(const char *new_controller_thread_name)
Set controller_thread_name value.
void set_x(const float new_x)
Set x value.
uint32_t motor_state() const
Get motor_state value.
size_t maxlenof_py() const
Get maximum length of py value.
static const uint32_t DRIVE_MODE_ROT
DRIVE_MODE_ROT constant.
virtual void copy_values(const Interface *other)
Copy values from other interface.
float vy() const
Get vy value.
size_t maxlenof_x() const
Get maximum length of x value.
TransMessage Fawkes BlackBoard Interface Message.
float omega() const
Get omega value.
size_t maxlenof_vy() const
Get maximum length of vy value.
void set_y(const float new_y)
Set y value.