test.cpp
Go to the documentation of this file.
1 #include "ros/ros.h"
2 #include "std_msgs/String.h"
3 
4 int main(int argc, char **argv)
5 {
6  ros::init(argc, argv, "test");
8 
9  ros::Publisher chatter_pub = nh.advertise<std_msgs::String>("chatter", 1000);
10 
11  ros::Rate loop_rate(10);
12 // while (ros::ok())
13 // {
14  std_msgs::String msg;
15  msg.data = "hello world";
16 
17  chatter_pub.publish(msg);
18 
19  ros::spinOnce();
20 
21  loop_rate.sleep();
22 // }
23 
24  return 0;
25 }
void publish(const boost::shared_ptr< M > &message) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char **argv)
Definition: test.cpp:4
ROSCPP_DECL void spinOnce()


xbot_navi
Author(s):
autogenerated on Sat Oct 10 2020 03:27:50