Fawkes API
Fawkes Development Version
|
Utility class to send transforms. More...
#include <>>
Public Member Functions | |
TransformPublisher (BlackBoard *bb, const char *bb_iface_id) | |
Constructor. | |
virtual | ~TransformPublisher () |
Destructor. | |
virtual void | send_transform (const StampedTransform &transform) |
Publish transform. | |
virtual void | send_transform (const Transform &transform, const fawkes::Time &time, const std::string frame, const std::string child_frame) |
Convenience wrapper to send a transform. |
Utility class to send transforms.
The transform publisher opens an instance of TransformInterface on the blackboard for writing and publishes every transform through that interface. Assuming that the event-based listener is used it will catch all updates even though we might send them in quick succession.
fawkes::tf::TransformPublisher::TransformPublisher | ( | BlackBoard * | bb, |
const char * | bb_iface_id | ||
) |
Constructor.
bb | blackboard to open transform interface on, if 0 the publisher will be disabled. Trying to send a transform will result in a DisabledException being thrown. |
bb_iface_id | the blackboard interface ID to be used for the opened TransformInterface. Note that the name is prefixed with "TF ". |
Definition at line 93 of file transform_publisher.cpp.
References fawkes::BlackBoard::open_for_writing(), and fawkes::Interface::set_auto_timestamping().
fawkes::tf::TransformPublisher::~TransformPublisher | ( | ) | [virtual] |
Destructor.
Closes TransformInterface, hence BlackBoard must still be alive and valid.
Definition at line 109 of file transform_publisher.cpp.
References fawkes::BlackBoard::close().
void fawkes::tf::TransformPublisher::send_transform | ( | const StampedTransform & | transform | ) | [virtual] |
Publish transform.
transform | transform to publish |
Definition at line 120 of file transform_publisher.cpp.
References fawkes::Interface::set_timestamp(), fawkes::tf::StampedTransform::stamp, fawkes::TransformInterface::set_frame(), fawkes::tf::StampedTransform::frame_id, fawkes::TransformInterface::set_child_frame(), fawkes::tf::StampedTransform::child_frame_id, fawkes::TransformInterface::set_translation(), fawkes::TransformInterface::set_rotation(), and fawkes::Interface::write().
Referenced by AmclThread::loop(), MapLaserGenThread::loop(), RosTfThread::loop(), and StaticTransformsThread::loop().
void fawkes::tf::TransformPublisher::send_transform | ( | const Transform & | transform, |
const fawkes::Time & | time, | ||
const std::string | frame, | ||
const std::string | child_frame | ||
) | [inline, virtual] |
Convenience wrapper to send a transform.
This simply calls send_transform() with a StampedTransform created from the data pased into this method.
transform | transform to publish |
time | time of the transform to publish |
frame | reference frame ID |
child_frame | child frame ID |
Definition at line 78 of file transform_publisher.h.
References send_transform().
Referenced by send_transform().