Commit Iniziale
This commit is contained in:
25
com/RoboGlue_Publisher.cpp
Normal file
25
com/RoboGlue_Publisher.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "ros/ros.h"
|
||||
#include "std_msgs/String.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ros::init(argc, argv, "RoboGlue_Publisher");
|
||||
ros::NodeHandle nh;
|
||||
|
||||
ros::Publisher chatter_pub = nh.advertise<std_msgs::String>("chatter", 1000);
|
||||
|
||||
ros::Rate loop_rate(10);
|
||||
while (ros::ok())
|
||||
{
|
||||
std_msgs::String msg;
|
||||
msg.data = "hello world";
|
||||
|
||||
chatter_pub.publish(msg);
|
||||
|
||||
ros::spinOnce();
|
||||
|
||||
loop_rate.sleep();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user