Functions
listener_single_message.cpp File Reference
#include "ros/ros.h"
#include "std_msgs/String.h"
Include dependency graph for listener_single_message.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

This tutorial demonstrates simplified syntax for receiving a single message on a topic. This is generally only useful for latched topics, as the overhead of subscribing to a topic is relatively significant

The ros::init() function needs to see argc and argv so that it can perform any ROS arguments and name remapping that were provided at the command line. For programmatic remappings you can use a different version of init() which takes remappings directly, but for most command-line programs, passing argc and argv is the easiest way to do it. The third argument to init() is the name of the node.

You must call one of the versions of ros::init() before using any other part of the ROS system.

NodeHandle is the main access point to communications with the ROS system. The first NodeHandle constructed will fully initialize this node, and the last NodeHandle destructed will close down the node.

Definition at line 35 of file listener_single_message.cpp.



roscpp_tutorials
Author(s): Morgan Quigley, Dirk Thomas
autogenerated on Sun Oct 18 2020 13:09:42