autoCycle.cpp
Go to the documentation of this file.
1 
2 #include "ros/ros.h"
3 #include "std_msgs/String.h"
4 
5 int main(int argc, char **argv)
6 {
7  ros::init(argc, argv, "auto_launch");
9 
10  ros::Publisher auto_cycle_pub = nh.advertise<std_msgs::String>("/office/goal_name", 1000);
11 
12  ros::Rate loop_rate(1);
13  int wait_time = 10;
14  while (wait_time)
15  {
16  std_msgs::String msg;
17  if(wait_time > 1)
18  {
19  msg.data = "nothing";
20  }
21  else{
22  msg.data = "A";
23  }
24  auto_cycle_pub.publish(msg);
25  wait_time--;
26 
27  loop_rate.sleep();
28  }
29 
30  return 0;
31 }
int main(int argc, char **argv)
Definition: autoCycle.cpp:5
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)


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