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::Publisher
nodelet::Nodelet::getNodeHandle
ros::NodeHandle & getNodeHandle() const
test_nodelet::NodehandleTest
Definition: nodehandles.cpp:12
ros.h
test_nodelet
Definition: console_tests.cpp:39
nodelet::Nodelet::getPrivateNodeHandle
ros::NodeHandle & getPrivateNodeHandle() const
ros::NodeHandle::advertise
Publisher advertise(AdvertiseOptions &ops)
test_nodelet::NodehandleTest::NodehandleTest
NodehandleTest()
Definition: nodehandles.cpp:15
test_nodelet::NodehandleTest::private_pub_
ros::Publisher private_pub_
Definition: nodehandles.cpp:25
test_nodelet::NodehandleTest::onInit
virtual void onInit()
Definition: nodehandles.cpp:16
nodelet::Nodelet
nodelet.h
PLUGINLIB_EXPORT_CLASS
PLUGINLIB_EXPORT_CLASS(test_nodelet::NodehandleTest, nodelet::Nodelet)
class_list_macros.hpp
test_nodelet::NodehandleTest::namespaced_pub_
ros::Publisher namespaced_pub_
Definition: nodehandles.cpp:25
test_nodelet::NodehandleTest::global_pub_
ros::Publisher global_pub_
Definition: nodehandles.cpp:25
ros::NodeHandle


test_nodelet
Author(s): Tully Foote, Michael Carroll
autogenerated on Fri Nov 15 2024 03:38:16