Main Page
Namespaces
Classes
Files
File List
File Members
test
double_pub.cpp
Go to the documentation of this file.
1
#include <
ros/ros.h
>
2
#include <std_msgs/String.h>
3
4
int
5
main
(
int
argc,
char
** argv)
6
{
7
ros::init
(argc, argv,
"double_pub"
);
8
ros::NodeHandle
n;
9
ros::Publisher
p1 = n.
advertise
<std_msgs::String>(
"chatter"
, 1);
10
ros::Publisher
p2 = n.
advertise
<std_msgs::String>(
"rettahc"
, 1);
11
12
ros::Rate
r(10.0);
13
while
(
ros::ok
())
14
{
15
std_msgs::String
s
;
16
s.data =
"hello"
;
17
p1.
publish
(s);
18
s.data =
"goodbye"
;
19
p2.publish(s);
20
}
21
return
0;
22
}
ros::NodeHandle
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
s
XmlRpcServer s
ros::init
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Rate
ros::ok
ROSCPP_DECL bool ok()
ros::NodeHandle::advertise
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros.h
ros::Publisher
main
int main(int argc, char **argv)
Definition:
double_pub.cpp:5
test_rosbag
Author(s): Tim Field, Jeremy Leibs, James Bowman, Dirk Thomas
autogenerated on Mon Nov 2 2020 03:53:09