Go to the documentation of this file.00001
00002
00003
00004 #include "stdafx.h"
00005 #include <iostream>
00006 #include <ros/ros.h>
00007 #include <std_msgs/String.h>
00008
00009 #include <sstream>
00010
00015 void chatterCallback(const std_msgs::String::ConstPtr& msg)
00016 {
00017 ROS_INFO("I heard: [%s]", msg->data.c_str());
00018 }
00019
00020 int _tmain(int argc, char** argv)
00021 {
00032 ros::init(argc, argv, "listener");
00033
00034
00040 ros::NodeHandle n;
00041
00057 ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);
00058
00064 ros::spin();
00065
00066 return 0;
00067 }