tf2_server_early_initial_params_nodelet.cpp
Go to the documentation of this file.
1 #include <ros/ros.h>
2 #include <nodelet/nodelet.h>
3 #include <tf2_msgs/TFMessage.h>
5 
6 namespace tf2_server
7 {
8 
17 {
18 protected:
19  void onInit() override
20  {
22  }
23 
24  void onMessage(const tf2_msgs::TFMessageConstPtr& msg)
25  {
26  if (!this->pub)
27  {
28  this->pub = this->getNodeHandle().advertise<tf2_msgs::TFMessage>("/test", 10);
29  ros::WallDuration(0.01).sleep();
30  }
31  this->pub.publish(msg);
32  }
33 
34 private:
37 };
38 
39 }
40 
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::NodeHandle & getNodeHandle() const
void publish(const boost::shared_ptr< M > &message) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool sleep() const
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)


tf2_server
Author(s): Martin Pecka
autogenerated on Sun Jun 12 2022 02:10:45