22 #ifndef _PLUGINS_ROS_TF_THREAD_H_
23 #define _PLUGINS_ROS_TF_THREAD_H_
25 #include <aspect/blackboard.h>
26 #include <aspect/blocked_timing.h>
27 #include <aspect/clock.h>
28 #include <aspect/configurable.h>
29 #include <aspect/logging.h>
30 #include <aspect/tf.h>
31 #include <blackboard/interface_listener.h>
32 #include <blackboard/interface_observer.h>
33 #include <core/threading/mutex.h>
34 #include <core/threading/thread.h>
35 #include <interfaces/TransformInterface.h>
36 #include <plugins/ros/aspect/ros.h>
42 #include <ros/common.h>
43 #include <ros/node_handle.h>
44 #include <tf/tfMessage.h>
46 # include <tf2_msgs/TFMessage.h>
79 void tf_message_cb(
const ros::MessageEvent<::tf::tfMessage const> &msg_evt);
81 void tf_message_cb_dynamic(
const ros::MessageEvent<tf2_msgs::TFMessage const> &msg_evt);
82 void tf_message_cb_static(
const ros::MessageEvent<tf2_msgs::TFMessage const> &msg_evt);
83 void tf_message_cb(
const ros::MessageEvent<tf2_msgs::TFMessage const> &msg_evt,
bool static_tf);
87 void publish_static_transforms_to_ros();
88 void publish_transform_to_fawkes(
const geometry_msgs::TransformStamped &ts,
89 bool static_tf =
false);
103 float cfg_update_interval_;
105 std::list<std::string> ros_frames_;
106 std::list<fawkes::TransformInterface *> tfifs_;
108 ros::Subscriber sub_tf_;
109 ros::Subscriber sub_static_tf_;
110 ros::Publisher pub_tf_;
111 ros::Publisher pub_static_tf_;
114 unsigned int active_queue_;
115 std::queue<::tf::tfMessage::ConstPtr> tf_msg_queues_[2];
117 std::queue<std::pair<bool, tf2_msgs::TFMessage::ConstPtr>> tf2_msg_queues_[2];
121 unsigned int seq_num_;
Thread to exchange transforms between Fawkes and ROS.
virtual void bb_interface_reader_removed(fawkes::Interface *interface, fawkes::Uuid instance_serial) noexcept
A reading instance has been closed for a watched interface.
RosTfThread()
Constructor.
virtual void loop()
Code to execute in the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
virtual void init()
Initialize the thread.
virtual void bb_interface_writer_removed(fawkes::Interface *interface, fawkes::Uuid instance_serial) noexcept
A writing instance has been closed for a watched interface.
virtual void finalize()
Finalize the thread.
virtual void bb_interface_created(const char *type, const char *id) noexcept
BlackBoard interface created notification.
virtual ~RosTfThread()
Destructor.
virtual void bb_interface_data_refreshed(fawkes::Interface *interface) noexcept
BlackBoard data refreshed notification.
Thread aspect to access to BlackBoard.
BlackBoard interface listener.
BlackBoard interface observer.
Thread aspect to use blocked timing.
Thread aspect that allows to obtain the current time from the clock.
Thread aspect to access configuration data.
Base class for all Fawkes BlackBoard interfaces.
Thread aspect to log output.
Mutex mutual exclusion lock.
Thread aspect to get access to a ROS node handle.
Thread class encapsulation of pthreads.
A class for handling time.
A convenience class for universally unique identifiers (UUIDs).