Fawkes API
Fawkes Development Version
|
Utility class to send transforms. More...
#include <>>
Public Member Functions | |
TransformPublisher (BlackBoard *bb, const char *bb_iface_id) | |
Constructor. More... | |
virtual | ~TransformPublisher () |
Destructor. More... | |
virtual void | send_transform (const StampedTransform &transform, const bool is_static=false) |
Publish transform. More... | |
virtual void | send_transform (const Transform &transform, const fawkes::Time &time, const std::string frame, const std::string child_frame, const bool is_static=false) |
Convenience wrapper to send a transform. More... | |
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.
Definition at line 70 of file transform_publisher.h.
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 95 of file transform_publisher.cpp.
References fawkes::BlackBoard::open_for_writing(), and fawkes::Interface::set_auto_timestamping().
|
virtual |
Destructor.
Closes TransformInterface, hence BlackBoard must still be alive and valid.
Definition at line 111 of file transform_publisher.cpp.
References fawkes::BlackBoard::close().
|
virtual |
Publish transform.
transform | transform to publish |
is_static | true to mark transform as static, false otherwise |
Definition at line 123 of file transform_publisher.cpp.
References fawkes::tf::StampedTransform::child_frame_id, fawkes::tf::StampedTransform::frame_id, fawkes::TransformInterface::set_child_frame(), fawkes::TransformInterface::set_frame(), fawkes::TransformInterface::set_rotation(), fawkes::TransformInterface::set_static_transform(), fawkes::Interface::set_timestamp(), fawkes::TransformInterface::set_translation(), fawkes::tf::StampedTransform::stamp, and fawkes::Interface::write().
Referenced by RobotStatePublisherThread::bb_interface_data_changed(), TfExampleThread::loop(), MapLaserGenThread::loop(), LocalizationSimThread::loop(), RobotinoSimThread::loop(), Bumblebee2Thread::loop(), LaserLinesThread::loop(), RobotStatePublisherThread::loop(), and send_transform().
|
inlinevirtual |
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 |
is_static | true if the transform is static, i.e., it does not change over time, false otherwise |
Definition at line 78 of file transform_publisher.h.
References send_transform().