nodehandles.cpp
Go to the documentation of this file.
1 #include <nodelet/nodelet.h>
3 #include <string>
4 #include <ros/ros.h>
5 #include <std_msgs/Bool.h>
6 #include <std_msgs/Byte.h>
7 #include <std_msgs/Time.h>
8 
9 namespace test_nodelet
10 {
11 
13 {
14 public:
16  virtual void onInit()
17  {
18  ros::NodeHandle nh = this->getNodeHandle();
20  global_pub_ = nh.advertise<std_msgs::Time>("/global", 1000);
21  namespaced_pub_ = nh.advertise<std_msgs::Byte>("namespaced", 1000);
22  private_pub_ = pnh.advertise<std_msgs::Bool>("private", 1000);
23  }
24 private:
26 };
27 
28 } // namespace test_nodelet
29 
ros::NodeHandle & getNodeHandle() const
ros::NodeHandle & getPrivateNodeHandle() const
ros::Publisher namespaced_pub_
Definition: nodehandles.cpp:25
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
PLUGINLIB_EXPORT_CLASS(test_nodelet::NodehandleTest, nodelet::Nodelet)


test_nodelet
Author(s): Tully Foote
autogenerated on Mon Feb 28 2022 22:57:16