double_pub.cpp
Go to the documentation of this file.
00001 #include <ros/ros.h>
00002 #include <std_msgs/String.h>
00003 
00004 int
00005 main(int argc, char** argv)
00006 {
00007   ros::init(argc, argv, "double_pub");
00008   ros::NodeHandle n;
00009   ros::Publisher p1 = n.advertise<std_msgs::String>("chatter", 1);
00010   ros::Publisher p2 = n.advertise<std_msgs::String>("rettahc", 1);
00011 
00012   ros::Rate r(10.0);
00013   while(ros::ok())
00014   {
00015     std_msgs::String s;
00016     s.data = "hello";
00017     p1.publish(s);
00018     s.data = "goodbye";
00019     p2.publish(s);
00020   }
00021   return 0;
00022 }


test_rosbag
Author(s): Tim Field, Jeremy Leibs, James Bowman
autogenerated on Fri Aug 28 2015 12:34:27