Last active
August 16, 2017 06:41
-
-
Save sipah00/f06ed1ec7bea99b284952d8c12a817c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ros/ros.h" | |
#include "std_msgs/String.h" | |
void chatterCallback(const std_msgs::String::ConstPtr& msg){ | |
ROS_INFO("I heard: [%s]", msg->data.c_str()); | |
} | |
int main(int argc, char **argv){ | |
ros::init(argc, argv, "listener"); | |
ros::NodeHandle n; | |
ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback); | |
ros::spin(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment