24 #include <aspect/tf.h> 25 #include <blackboard/ownership.h> 26 #include <core/exceptions/system.h> 27 #include <core/threading/thread_initializer.h> 28 #include <tf/transform_listener.h> 80 tf_aspect_frame_id_ = strdup(frame_id);
82 tf_aspect_frame_id_ = 0;
84 tf_aspect_blackboard_ = 0;
90 if (tf_aspect_frame_id_)
91 free(tf_aspect_frame_id_);
103 const char * thread_name)
106 && (tf_aspect_frame_id_ == NULL)) {
108 "in mode %s but BB interface ID" 110 (tf_aspect_mode_ ==
BOTH) ?
"BOTH" :
"ONLY_PUBLISHER");
148 throw Exception(
"Publisher can only be enabled later in (BOTH_)DEFER_PUBLISHER mode");
151 if (tf_aspect_frame_id_) {
152 throw Exception(
"Cannot overwrite frame_id '%s' with '%s' in tf_enable_publisher",
156 tf_aspect_frame_id_ = strdup(frame_id);
159 if (tf_aspect_frame_id_ == 0) {
160 throw Exception(
"TransformAspect in %s mode " 161 "requires a valid blackboard interface ID to enable the publisher",
163 :
"BOTH_DEFER_PUBLISHER");
189 throw Exception(
"Publisher can only be enabled later in (BOTH_)DEFER_PUBLISHER mode");
193 va_start(arg, frame_id_format);
196 if (vasprintf(&msg, frame_id_format, arg) == -1) {
200 std::string frame_id = msg;
204 throw Exception(
"Publisher for %s has already been added", frame_id.c_str());
216 if (tf_aspect_frame_id_) {
220 std::map<std::string, tf::TransformPublisher *>::iterator ti;
227 delete tf_aspect_blackboard_;
228 tf_aspect_blackboard_ = 0;
Fawkes library namespace.
void add_aspect(const char *name)
Add an aspect to a thread.
Thread cannot be initialized.
Base class for exceptions in Fawkes.
BlackBoard that traces interface ownership.
The BlackBoard abstract class.
System ran out of memory and desired operation could not be fulfilled.