ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can define publisher as global variable without initializing it. You can later initialize publisher with node handler within main()
after ros::init()
. In this way you can use publisher outside main within any function.