Fawkes API  Fawkes Development Version
fawkes::TransformInterface Class Reference

TransformInterface Fawkes BlackBoard Interface. More...

#include <>>

Inheritance diagram for fawkes::TransformInterface:

List of all members.

Classes

struct  TransformInterface_data_t
 Internal data storage, do NOT modify! More...

Public Member Functions

virtual bool message_valid (const Message *message) const
 Check if message is valid and can be enqueued.
char * frame () const
 Get frame value.
void set_frame (const char *new_frame)
 Set frame value.
size_t maxlenof_frame () const
 Get maximum length of frame value.
char * child_frame () const
 Get child_frame value.
void set_child_frame (const char *new_child_frame)
 Set child_frame value.
size_t maxlenof_child_frame () const
 Get maximum length of child_frame value.
double * translation () const
 Get translation value.
double translation (unsigned int index) const
 Get translation value at given index.
void set_translation (unsigned int index, const double new_translation)
 Set translation value at given index.
void set_translation (const double *new_translation)
 Set translation value.
size_t maxlenof_translation () const
 Get maximum length of translation value.
double * rotation () const
 Get rotation value.
double rotation (unsigned int index) const
 Get rotation value at given index.
void set_rotation (unsigned int index, const double new_rotation)
 Set rotation value at given index.
void set_rotation (const double *new_rotation)
 Set rotation value.
size_t maxlenof_rotation () const
 Get maximum length of rotation 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.

Detailed Description

TransformInterface Fawkes BlackBoard Interface.

This interface is used to publish transforms. It aims to be as compatible as possible with ROS' tf library and is used extensively by the Fawkes tf library.

For this to work properly it is crucial to have correct timestamp set (cf. Interface::set_timestamp()). Set this as close as possible to the time of when the data, from which the transform is computed, has been acquired.


Member Function Documentation

char * fawkes::TransformInterface::child_frame ( ) const

Get child_frame value.

The ID of the child frame. The child frame's origin is at the given point in the parent frame denoted by the transform.

Returns:
child_frame value

Definition at line 117 of file TransformInterface.cpp.

Referenced by fawkes::tf::TransformListener::bb_interface_data_changed(), and RosTfThread::bb_interface_data_changed().

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

Copy values from other interface.

Parameters:
otherother interface to copy values from

Implements fawkes::Interface.

Definition at line 315 of file TransformInterface.cpp.

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

Message * fawkes::TransformInterface::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:
typemessage type
Returns:
message of the given type, empty
Exceptions:
UnknownTypeExceptionthrown if this interface cannot create a message of the given type.

Implements fawkes::Interface.

Definition at line 304 of file TransformInterface.cpp.

const char * fawkes::TransformInterface::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:
enumtypeenum type as string
valvalue to convert
Returns:
string representation of value
Exceptions:
UnknownTypeExceptionthrown if enumtype is not specified for interface.

Implements fawkes::Interface.

Definition at line 326 of file TransformInterface.cpp.

char * fawkes::TransformInterface::frame ( ) const

Get frame value.

Parent frame ID. The given transform is relative to the origin of this coordinate frame.

Returns:
frame value

Definition at line 80 of file TransformInterface.cpp.

Referenced by fawkes::tf::TransformListener::bb_interface_data_changed(), and RosTfThread::bb_interface_data_changed().

size_t fawkes::TransformInterface::maxlenof_child_frame ( ) const

Get maximum length of child_frame value.

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

Definition at line 127 of file TransformInterface.cpp.

size_t fawkes::TransformInterface::maxlenof_frame ( ) const

Get maximum length of frame value.

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

Definition at line 90 of file TransformInterface.cpp.

size_t fawkes::TransformInterface::maxlenof_rotation ( ) const

Get maximum length of rotation value.

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

Definition at line 262 of file TransformInterface.cpp.

size_t fawkes::TransformInterface::maxlenof_translation ( ) const

Get maximum length of translation value.

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

Definition at line 184 of file TransformInterface.cpp.

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

Check if message is valid and can be enqueued.

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

Implements fawkes::Interface.

Definition at line 337 of file TransformInterface.cpp.

double * fawkes::TransformInterface::rotation ( ) const

Get rotation value.

This array denotes the rotation quaternion of the transform. The element indexes are ordered x, y, z, w, i.e. translation[0] is the X value of the rotation quaternion and translation[3] is the W value.

Returns:
rotation value

Definition at line 232 of file TransformInterface.cpp.

Referenced by fawkes::tf::TransformListener::bb_interface_data_changed(), and RosTfThread::bb_interface_data_changed().

double fawkes::TransformInterface::rotation ( unsigned int  index) const

Get rotation value at given index.

This array denotes the rotation quaternion of the transform. The element indexes are ordered x, y, z, w, i.e. translation[0] is the X value of the rotation quaternion and translation[3] is the W value.

Parameters:
indexindex of value
Returns:
rotation value
Exceptions:
Exceptionthrown if index is out of bounds

Definition at line 249 of file TransformInterface.cpp.

void fawkes::TransformInterface::set_child_frame ( const char *  new_child_frame)

Set child_frame value.

The ID of the child frame. The child frame's origin is at the given point in the parent frame denoted by the transform.

Parameters:
new_child_framenew child_frame value

Definition at line 140 of file TransformInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by fawkes::tf::TransformPublisher::send_transform().

void fawkes::TransformInterface::set_frame ( const char *  new_frame)

Set frame value.

Parent frame ID. The given transform is relative to the origin of this coordinate frame.

Parameters:
new_framenew frame value

Definition at line 103 of file TransformInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by fawkes::tf::TransformPublisher::send_transform().

void fawkes::TransformInterface::set_rotation ( unsigned int  index,
const double  new_rotation 
)

Set rotation value at given index.

This array denotes the rotation quaternion of the transform. The element indexes are ordered x, y, z, w, i.e. translation[0] is the X value of the rotation quaternion and translation[3] is the W value.

Parameters:
new_rotationnew rotation value
indexindex for of the value

Definition at line 294 of file TransformInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by fawkes::tf::TransformPublisher::send_transform().

void fawkes::TransformInterface::set_rotation ( const double *  new_rotation)

Set rotation value.

This array denotes the rotation quaternion of the transform. The element indexes are ordered x, y, z, w, i.e. translation[0] is the X value of the rotation quaternion and translation[3] is the W value.

Parameters:
new_rotationnew rotation value

Definition at line 277 of file TransformInterface.cpp.

References fawkes::Interface::data_changed.

void fawkes::TransformInterface::set_translation ( unsigned int  index,
const double  new_translation 
)

Set translation value at given index.

This array denotes the translation vector of the transform. The element indexes are ordered x, y, z, i.e. translation[0] is the X value of the translation vector.

Parameters:
new_translationnew translation value
indexindex for of the value

Definition at line 214 of file TransformInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by fawkes::tf::TransformPublisher::send_transform().

void fawkes::TransformInterface::set_translation ( const double *  new_translation)

Set translation value.

This array denotes the translation vector of the transform. The element indexes are ordered x, y, z, i.e. translation[0] is the X value of the translation vector.

Parameters:
new_translationnew translation value

Definition at line 198 of file TransformInterface.cpp.

References fawkes::Interface::data_changed.

double * fawkes::TransformInterface::translation ( ) const

Get translation value.

This array denotes the translation vector of the transform. The element indexes are ordered x, y, z, i.e. translation[0] is the X value of the translation vector.

Returns:
translation value

Definition at line 155 of file TransformInterface.cpp.

Referenced by fawkes::tf::TransformListener::bb_interface_data_changed(), and RosTfThread::bb_interface_data_changed().

double fawkes::TransformInterface::translation ( unsigned int  index) const

Get translation value at given index.

This array denotes the translation vector of the transform. The element indexes are ordered x, y, z, i.e. translation[0] is the X value of the translation vector.

Parameters:
indexindex of value
Returns:
translation value
Exceptions:
Exceptionthrown if index is out of bounds

Definition at line 171 of file TransformInterface.cpp.


The documentation for this class was generated from the following files: