ljl16

last subs

Nov 24th, 2011
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ros/ros.h"
  2. #include "geometry_msgs/Twist.h"
  3. #include "std_msgs/String.h"
  4.  
  5.  
  6. void chatterCallback(const std_msgs::String::ConstPtr& msg)
  7. {
  8. ROS_INFO("I heard: [%s]", msg->data.c_str());
  9. }
  10.  
  11. int main(int argc, char **argv)
  12. {
  13. ros::init(argc, argv, "listener");
  14. ros::NodeHandle n;
  15. ros::Subscriber sub = n.subscribe<geometry_msgs::Twist>("cmd_vel", 1000, chatterCallback);
  16. ros::spin();
  17.  
  18. return 0;
  19. }
  20.  
RAW Paste Data