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 
ros::WallDuration::sleep
bool sleep() const
tf2_server::Tf2ServerEarlyInitialParamsNodelet
Definition: tf2_server_early_initial_params_nodelet.cpp:16
ros::Publisher
nodelet::Nodelet::getNodeHandle
ros::NodeHandle & getNodeHandle() const
ros.h
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
ros::NodeHandle::advertise
Publisher advertise(AdvertiseOptions &ops)
tf2_server::Tf2ServerEarlyInitialParamsNodelet::sub
ros::Subscriber sub
Definition: tf2_server_early_initial_params_nodelet.cpp:35
class_list_macros.h
tf2_server::Tf2ServerEarlyInitialParamsNodelet::onMessage
void onMessage(const tf2_msgs::TFMessageConstPtr &msg)
Definition: tf2_server_early_initial_params_nodelet.cpp:24
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
tf2_server::Tf2ServerEarlyInitialParamsNodelet::onInit
void onInit() override
Definition: tf2_server_early_initial_params_nodelet.cpp:19
ros::NodeHandle::subscribe
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
nodelet::Nodelet
nodelet.h
tf2_server
Definition: tf2_server.h:14
ros::WallDuration
tf2_server::Tf2ServerEarlyInitialParamsNodelet::pub
ros::Publisher pub
Definition: tf2_server_early_initial_params_nodelet.cpp:36
ros::Subscriber


tf2_server
Author(s): Martin Pecka
autogenerated on Fri Jan 12 2024 03:42:13