Fawkes API
Fawkes Development Version
|
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>
74 unsigned int instance_serial)
throw();
76 unsigned int instance_serial)
throw();
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_;
virtual ~RosTfThread()
Destructor.
Mutex mutual exclusion lock.
virtual void run()
Stub to see name in backtrace for easier debugging.
Thread to exchange transforms between Fawkes and ROS.
BlackBoard interface listener.
Thread aspect to use blocked timing.
virtual void bb_interface_data_changed(fawkes::Interface *interface)
BlackBoard data changed notification.
Thread aspect to access to BlackBoard.
Thread aspect to log output.
Thread aspect to get access to a ROS node handle.
virtual void bb_interface_reader_removed(fawkes::Interface *interface, unsigned int instance_serial)
A reading instance has been closed for a watched interface.
BlackBoard interface observer.
Base class for all Fawkes BlackBoard interfaces.
virtual void finalize()
Finalize the thread.
A class for handling time.
Thread class encapsulation of pthreads.
virtual void loop()
Code to execute in the thread.
Thread aspect to access configuration data.
RosTfThread()
Constructor.
virtual void bb_interface_created(const char *type, const char *id)
BlackBoard interface created notification.
virtual void bb_interface_writer_removed(fawkes::Interface *interface, unsigned int instance_serial)
A writing instance has been closed for a watched interface.
Thread aspect that allows to obtain the current time from the clock.
virtual void init()
Initialize the thread.