Fawkes API
Fawkes Development Version
|
TransformInterface Fawkes BlackBoard Interface. More...
#include <>>
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 Message * | create_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. |
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.
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.
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.
other | other 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.
type | message type |
UnknownTypeException | thrown 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.
enumtype | enum type as string |
val | value to convert |
UnknownTypeException | thrown 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.
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.
Definition at line 127 of file TransformInterface.cpp.
size_t fawkes::TransformInterface::maxlenof_frame | ( | ) | const |
Get maximum length of frame value.
Definition at line 90 of file TransformInterface.cpp.
size_t fawkes::TransformInterface::maxlenof_rotation | ( | ) | const |
Get maximum length of rotation value.
Definition at line 262 of file TransformInterface.cpp.
size_t fawkes::TransformInterface::maxlenof_translation | ( | ) | const |
Get maximum length of translation value.
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.
message | Message to check |
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.
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.
index | index of value |
Exception | thrown 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.
new_child_frame | new 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.
new_frame | new 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.
new_rotation | new rotation value |
index | index 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.
new_rotation | new 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.
new_translation | new translation value |
index | index 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.
new_translation | new 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.
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.
index | index of value |
Exception | thrown if index is out of bounds |
Definition at line 171 of file TransformInterface.cpp.