24 #include <aspect/tf.h> 25 #include <tf/transform_listener.h> 30 #include <core/threading/thread_initializer.h> 31 #include <core/exceptions/system.h> 32 #include <blackboard/ownership.h> 79 : __tf_aspect_mode(mode)
86 __tf_aspect_frame_id = strdup(frame_id);
88 __tf_aspect_frame_id = 0;
90 __tf_aspect_blackboard = 0;
97 if (__tf_aspect_frame_id) free(__tf_aspect_frame_id);
109 const char *thread_name)
112 (__tf_aspect_frame_id == NULL))
115 "in mode %s but BB interface ID" 117 (__tf_aspect_mode ==
BOTH) ?
"BOTH" 159 throw Exception(
"Publisher can only be enabled later in (BOTH_)DEFER_PUBLISHER mode");
162 if (__tf_aspect_frame_id) {
163 throw Exception(
"Cannot overwrite frame_id '%s' with '%s' in tf_enable_publisher",
164 __tf_aspect_frame_id, frame_id);
166 __tf_aspect_frame_id = strdup(frame_id);
169 if (__tf_aspect_frame_id == 0) {
170 throw Exception(
"TransformAspect in %s mode " 171 "requires a valid blackboard interface ID to enable the publisher",
173 ?
"DEFER_PUBLISHER" :
"BOTH_DEFER_PUBLISHER" );
201 throw Exception(
"Publisher can only be enabled later in (BOTH_)DEFER_PUBLISHER mode");
205 va_start(arg, frame_id_format);
208 if (vasprintf(&msg, frame_id_format, arg) == -1) {
212 std::string frame_id = msg;
216 throw Exception(
"Publisher for %s has already been added", frame_id.c_str());
229 if (__tf_aspect_frame_id) {
233 std::map<std::string, tf::TransformPublisher *>::iterator ti;
240 delete __tf_aspect_blackboard;
241 __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.