fawkes::MotorInterface Class Reference
[Fawkes Interfaces]

MotorInterface Fawkes BlackBoard Interface. More...

#include <interfaces/MotorInterface.h>

Inheritance diagram for fawkes::MotorInterface:

[legend]
List of all members.

Public Member Functions

virtual bool message_valid (const Message *message) const
 Check if message is valid and can be enqueued.
uint32_t motor_state () const
 Get motor_state value.
void set_motor_state (const uint32_t new_motor_state)
 Set motor_state value.
size_t maxlenof_motor_state () const
 Get maximum length of motor_state value.
uint32_t drive_mode () const
 Get drive_mode value.
void set_drive_mode (const uint32_t new_drive_mode)
 Set drive_mode value.
size_t maxlenof_drive_mode () const
 Get maximum length of drive_mode value.
int32_t right_rpm () const
 Get right_rpm value.
void set_right_rpm (const int32_t new_right_rpm)
 Set right_rpm value.
size_t maxlenof_right_rpm () const
 Get maximum length of right_rpm value.
int32_t rear_rpm () const
 Get rear_rpm value.
void set_rear_rpm (const int32_t new_rear_rpm)
 Set rear_rpm value.
size_t maxlenof_rear_rpm () const
 Get maximum length of rear_rpm value.
int32_t left_rpm () const
 Get left_rpm value.
void set_left_rpm (const int32_t new_left_rpm)
 Set left_rpm value.
size_t maxlenof_left_rpm () const
 Get maximum length of left_rpm value.
float odometry_path_length () const
 Get odometry_path_length value.
void set_odometry_path_length (const float new_odometry_path_length)
 Set odometry_path_length value.
size_t maxlenof_odometry_path_length () const
 Get maximum length of odometry_path_length value.
float odometry_position_x () const
 Get odometry_position_x value.
void set_odometry_position_x (const float new_odometry_position_x)
 Set odometry_position_x value.
size_t maxlenof_odometry_position_x () const
 Get maximum length of odometry_position_x value.
float odometry_position_y () const
 Get odometry_position_y value.
void set_odometry_position_y (const float new_odometry_position_y)
 Set odometry_position_y value.
size_t maxlenof_odometry_position_y () const
 Get maximum length of odometry_position_y value.
float odometry_orientation () const
 Get odometry_orientation value.
void set_odometry_orientation (const float new_odometry_orientation)
 Set odometry_orientation value.
size_t maxlenof_odometry_orientation () const
 Get maximum length of odometry_orientation value.
float vx () const
 Get vx value.
void set_vx (const float new_vx)
 Set vx value.
size_t maxlenof_vx () const
 Get maximum length of vx value.
float vy () const
 Get vy value.
void set_vy (const float new_vy)
 Set vy value.
size_t maxlenof_vy () const
 Get maximum length of vy value.
float omega () const
 Get omega value.
void set_omega (const float new_omega)
 Set omega value.
size_t maxlenof_omega () const
 Get maximum length of omega value.
uint32_t controller () const
 Get controller value.
void set_controller (const uint32_t new_controller)
 Set controller value.
size_t maxlenof_controller () const
 Get maximum length of controller value.
char * controller_thread_name () const
 Get controller_thread_name value.
void set_controller_thread_name (const char *new_controller_thread_name)
 Set controller_thread_name value.
size_t maxlenof_controller_thread_name () const
 Get maximum length of controller_thread_name value.
virtual Messagecreate_message (const char *type) const
 Create message based on type name.
virtual void copy_values (const Interface *other)
 Copy values from other interface.
virtual const char * enum_tostring (const char *enumtype, int val) const
 Convert arbitrary enum value to string.

Static Public Attributes

static const uint32_t MOTOR_ENABLED = 0u
 MOTOR_ENABLED constant.
static const uint32_t MOTOR_DISABLED = 1u
 MOTOR_DISABLED constant.
static const uint32_t DRIVE_MODE_RPM = 1u
 DRIVE_MODE_RPM constant.
static const uint32_t DRIVE_MODE_TRANS = 2u
 DRIVE_MODE_TRANS constant.
static const uint32_t DRIVE_MODE_ROT = 3u
 DRIVE_MODE_ROT constant.
static const uint32_t DRIVE_MODE_TRANS_ROT = 4u
 DRIVE_MODE_TRANS_ROT constant.
static const uint32_t DRIVE_MODE_ORBIT = 5u
 DRIVE_MODE_ORBIT constant.
static const uint32_t DRIVE_MODE_LINE_TRANS_ROT = 6u
 DRIVE_MODE_LINE_TRANS_ROT constant.

Classes

class  AcquireControlMessage
 AcquireControlMessage Fawkes BlackBoard Interface Message. More...
class  DriveRPMMessage
 DriveRPMMessage Fawkes BlackBoard Interface Message. More...
class  GotoMessage
 GotoMessage Fawkes BlackBoard Interface Message. More...
class  LinTransRotMessage
 LinTransRotMessage Fawkes BlackBoard Interface Message. More...
struct  MotorInterface_data_t
 Internal data storage, do NOT modify!
class  OrbitMessage
 OrbitMessage Fawkes BlackBoard Interface Message. More...
class  ResetOdometryMessage
 ResetOdometryMessage Fawkes BlackBoard Interface Message. More...
class  RotMessage
 RotMessage Fawkes BlackBoard Interface Message. More...
class  SetMotorStateMessage
 SetMotorStateMessage Fawkes BlackBoard Interface Message. More...
class  TransMessage
 TransMessage Fawkes BlackBoard Interface Message. More...
class  TransRotMessage
 TransRotMessage Fawkes BlackBoard Interface Message. More...

Detailed Description

MotorInterface Fawkes BlackBoard Interface.

This interface is currently prepared best for a holonomic robot. It will need modifications or a split to support differential drives.

Definition at line 33 of file MotorInterface.h.


Member Function Documentation

uint32_t fawkes::MotorInterface::controller (  )  const

Get controller value.

The ID of the controller. The controller ID is the instance serial of the sending interface. Only from this interface instance command messages are accepted.

Returns:
controller value

Definition at line 529 of file MotorInterface.cpp.

char * fawkes::MotorInterface::controller_thread_name (  )  const

Get controller_thread_name value.

The name of the controlling thread, for easier debugging. This is informative only and actually two threads may share an interface instance (although this should be avoided since the interface locking has to be reproduced for these threads then).

Returns:
controller_thread_name value

Definition at line 567 of file MotorInterface.cpp.

void fawkes::MotorInterface::copy_values ( const Interface other  )  [virtual]

Copy values from other interface.

Parameters:
other other interface to copy values from

Implements fawkes::Interface.

Definition at line 632 of file MotorInterface.cpp.

References data, and fawkes::Interface::type().

Message * fawkes::MotorInterface::create_message ( const char *  type  )  const [virtual]

Create message based on type name.

This will create a new message of the given type. The type must be given without the InterfaceName:: prefix but just the plain class name of the message.

Parameters:
type message type
Returns:
message of the given type, empty
Exceptions:
UnknownTypeException thrown if this interface cannot create a message of the given type.

Implements fawkes::Interface.

Definition at line 599 of file MotorInterface.cpp.

uint32_t fawkes::MotorInterface::drive_mode (  )  const

Get drive_mode value.

The current drive mode of the motor.

Returns:
drive_mode value

Definition at line 143 of file MotorInterface.cpp.

const char * fawkes::MotorInterface::enum_tostring ( const char *  enumtype,
int  val 
) const [virtual]

Convert arbitrary enum value to string.

Given the string representation of the enum type and the value this method returns the string representation of the specific value, or the string UNKNOWN if the value is not defined. An exception is thrown if the enum type is invalid.

Parameters:
enumtype enum type as string
val value to convert
Returns:
string representation of value
Exceptions:
UnknownTypeException thrown if enumtype is not specified for interface.

Implements fawkes::Interface.

Definition at line 643 of file MotorInterface.cpp.

int32_t fawkes::MotorInterface::left_rpm (  )  const

Get left_rpm value.

RPM of the motor on the left front of the robot.

Returns:
left_rpm value

Definition at line 248 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_controller (  )  const

Get maximum length of controller value.

Returns:
length of controller value, can be length of the array or number of maximum number of characters for a string

Definition at line 539 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_controller_thread_name (  )  const

Get maximum length of controller_thread_name value.

Returns:
length of controller_thread_name value, can be length of the array or number of maximum number of characters for a string

Definition at line 577 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_drive_mode (  )  const

Get maximum length of drive_mode value.

Returns:
length of drive_mode value, can be length of the array or number of maximum number of characters for a string

Definition at line 153 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_left_rpm (  )  const

Get maximum length of left_rpm value.

Returns:
length of left_rpm value, can be length of the array or number of maximum number of characters for a string

Definition at line 258 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_motor_state (  )  const

Get maximum length of motor_state value.

Returns:
length of motor_state value, can be length of the array or number of maximum number of characters for a string

Definition at line 118 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_odometry_orientation (  )  const

Get maximum length of odometry_orientation value.

Returns:
length of odometry_orientation value, can be length of the array or number of maximum number of characters for a string

Definition at line 398 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_odometry_path_length (  )  const

Get maximum length of odometry_path_length value.

Returns:
length of odometry_path_length value, can be length of the array or number of maximum number of characters for a string

Definition at line 293 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_odometry_position_x (  )  const

Get maximum length of odometry_position_x value.

Returns:
length of odometry_position_x value, can be length of the array or number of maximum number of characters for a string

Definition at line 328 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_odometry_position_y (  )  const

Get maximum length of odometry_position_y value.

Returns:
length of odometry_position_y value, can be length of the array or number of maximum number of characters for a string

Definition at line 363 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_omega (  )  const

Get maximum length of omega value.

Returns:
length of omega value, can be length of the array or number of maximum number of characters for a string

Definition at line 503 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_rear_rpm (  )  const

Get maximum length of rear_rpm value.

Returns:
length of rear_rpm value, can be length of the array or number of maximum number of characters for a string

Definition at line 223 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_right_rpm (  )  const

Get maximum length of right_rpm value.

Returns:
length of right_rpm value, can be length of the array or number of maximum number of characters for a string

Definition at line 188 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_vx (  )  const

Get maximum length of vx value.

Returns:
length of vx value, can be length of the array or number of maximum number of characters for a string

Definition at line 433 of file MotorInterface.cpp.

size_t fawkes::MotorInterface::maxlenof_vy (  )  const

Get maximum length of vy value.

Returns:
length of vy value, can be length of the array or number of maximum number of characters for a string

Definition at line 468 of file MotorInterface.cpp.

bool fawkes::MotorInterface::message_valid ( const Message message  )  const [virtual]

Check if message is valid and can be enqueued.

Parameters:
message Message to check
Returns:
true if the message is valid, false otherwise.

Implements fawkes::Interface.

Definition at line 1970 of file MotorInterface.cpp.

uint32_t fawkes::MotorInterface::motor_state (  )  const

Get motor_state value.

The current state of the motor.

Returns:
motor_state value

Definition at line 108 of file MotorInterface.cpp.

float fawkes::MotorInterface::odometry_orientation (  )  const

Get odometry_orientation value.

The actual orientation of the robot relative to the orientation at the last ResetOdometry.

Returns:
odometry_orientation value

Definition at line 388 of file MotorInterface.cpp.

float fawkes::MotorInterface::odometry_path_length (  )  const

Get odometry_path_length value.

The actual length of the robot's trajectory since the last ResetOdometry.

Returns:
odometry_path_length value

Definition at line 283 of file MotorInterface.cpp.

float fawkes::MotorInterface::odometry_position_x (  )  const

Get odometry_position_x value.

The actual position of the robot relative to the position at the last ResetOdometry.

Returns:
odometry_position_x value

Definition at line 318 of file MotorInterface.cpp.

float fawkes::MotorInterface::odometry_position_y (  )  const

Get odometry_position_y value.

The actual position of the robot relative to the position at the last ResetOdometry.

Returns:
odometry_position_y value

Definition at line 353 of file MotorInterface.cpp.

float fawkes::MotorInterface::omega (  )  const

Get omega value.

Rotation speed of the robot in rad/s.

Returns:
omega value

Definition at line 493 of file MotorInterface.cpp.

int32_t fawkes::MotorInterface::rear_rpm (  )  const

Get rear_rpm value.

RPM of motor on the rear of the robot.

Returns:
rear_rpm value

Definition at line 213 of file MotorInterface.cpp.

int32_t fawkes::MotorInterface::right_rpm (  )  const

Get right_rpm value.

RPM of the motor on the right front of the robot.

Returns:
right_rpm value

Definition at line 178 of file MotorInterface.cpp.

void fawkes::MotorInterface::set_controller ( const uint32_t  new_controller  ) 

Set controller value.

The ID of the controller. The controller ID is the instance serial of the sending interface. Only from this interface instance command messages are accepted.

Parameters:
new_controller new controller value

Definition at line 552 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_controller_thread_name ( const char *  new_controller_thread_name  ) 

Set controller_thread_name value.

The name of the controlling thread, for easier debugging. This is informative only and actually two threads may share an interface instance (although this should be avoided since the interface locking has to be reproduced for these threads then).

Parameters:
new_controller_thread_name new controller_thread_name value

Definition at line 591 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_drive_mode ( const uint32_t  new_drive_mode  ) 

Set drive_mode value.

The current drive mode of the motor.

Parameters:
new_drive_mode new drive_mode value

Definition at line 165 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_left_rpm ( const int32_t  new_left_rpm  ) 

Set left_rpm value.

RPM of the motor on the left front of the robot.

Parameters:
new_left_rpm new left_rpm value

Definition at line 270 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_motor_state ( const uint32_t  new_motor_state  ) 

Set motor_state value.

The current state of the motor.

Parameters:
new_motor_state new motor_state value

Definition at line 130 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_odometry_orientation ( const float  new_odometry_orientation  ) 

Set odometry_orientation value.

The actual orientation of the robot relative to the orientation at the last ResetOdometry.

Parameters:
new_odometry_orientation new odometry_orientation value

Definition at line 410 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by PlayerMotorPositionMapper::sync_player_to_fawkes().

void fawkes::MotorInterface::set_odometry_path_length ( const float  new_odometry_path_length  ) 

Set odometry_path_length value.

The actual length of the robot's trajectory since the last ResetOdometry.

Parameters:
new_odometry_path_length new odometry_path_length value

Definition at line 305 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_odometry_position_x ( const float  new_odometry_position_x  ) 

Set odometry_position_x value.

The actual position of the robot relative to the position at the last ResetOdometry.

Parameters:
new_odometry_position_x new odometry_position_x value

Definition at line 340 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by PlayerMotorPositionMapper::sync_player_to_fawkes().

void fawkes::MotorInterface::set_odometry_position_y ( const float  new_odometry_position_y  ) 

Set odometry_position_y value.

The actual position of the robot relative to the position at the last ResetOdometry.

Parameters:
new_odometry_position_y new odometry_position_y value

Definition at line 375 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by PlayerMotorPositionMapper::sync_player_to_fawkes().

void fawkes::MotorInterface::set_omega ( const float  new_omega  ) 

Set omega value.

Rotation speed of the robot in rad/s.

Parameters:
new_omega new omega value

Definition at line 515 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_rear_rpm ( const int32_t  new_rear_rpm  ) 

Set rear_rpm value.

RPM of motor on the rear of the robot.

Parameters:
new_rear_rpm new rear_rpm value

Definition at line 235 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_right_rpm ( const int32_t  new_right_rpm  ) 

Set right_rpm value.

RPM of the motor on the right front of the robot.

Parameters:
new_right_rpm new right_rpm value

Definition at line 200 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_vx ( const float  new_vx  ) 

Set vx value.

VX of the robot in m/s. Forward.

Parameters:
new_vx new vx value

Definition at line 445 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::MotorInterface::set_vy ( const float  new_vy  ) 

Set vy value.

VY of the robot in m/s. Left.

Parameters:
new_vy new vy value

Definition at line 480 of file MotorInterface.cpp.

References fawkes::Interface::data_changed.

float fawkes::MotorInterface::vx (  )  const

Get vx value.

VX of the robot in m/s. Forward.

Returns:
vx value

Definition at line 423 of file MotorInterface.cpp.

float fawkes::MotorInterface::vy (  )  const

Get vy value.

VY of the robot in m/s. Left.

Returns:
vy value

Definition at line 458 of file MotorInterface.cpp.


Member Data Documentation

const uint32_t fawkes::MotorInterface::DRIVE_MODE_LINE_TRANS_ROT = 6u [static]

DRIVE_MODE_LINE_TRANS_ROT constant.

Definition at line 47 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::DRIVE_MODE_ORBIT = 5u [static]

DRIVE_MODE_ORBIT constant.

Definition at line 46 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::DRIVE_MODE_ROT = 3u [static]

DRIVE_MODE_ROT constant.

Definition at line 44 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::DRIVE_MODE_RPM = 1u [static]

DRIVE_MODE_RPM constant.

Definition at line 42 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::DRIVE_MODE_TRANS = 2u [static]

DRIVE_MODE_TRANS constant.

Definition at line 43 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::DRIVE_MODE_TRANS_ROT = 4u [static]

DRIVE_MODE_TRANS_ROT constant.

Definition at line 45 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::MOTOR_DISABLED = 1u [static]

MOTOR_DISABLED constant.

Definition at line 41 of file MotorInterface.h.

const uint32_t fawkes::MotorInterface::MOTOR_ENABLED = 0u [static]

MOTOR_ENABLED constant.

Definition at line 40 of file MotorInterface.h.


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:32:41 2011 for Fawkes API by  doxygen 1.4.7