Main Page
Namespaces
Files
File List
providers
launch
hello.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
import
rospy
4
from
std_msgs.msg
import
String
5
6
7
def
main
():
8
rospy.init_node(
'minimal'
)
9
pub = rospy.Publisher(
'chatter'
, String, queue_size=1000)
10
start = rospy.Time.now()
11
while
not
rospy.is_shutdown()
and
(rospy.Time.now() - start).to_sec() < 10:
12
log =
"hello world %s"
% rospy.get_time()
13
rospy.loginfo(log)
14
pub.publish(String(log))
15
rospy.sleep(1.0)
16
17
18
if
__name__ ==
'__main__'
:
19
try
:
20
main
()
21
except
rospy.ROSInterruptException:
22
pass
hello.main
def main()
Definition:
hello.py:7
roch_capabilities
Author(s): Chen
autogenerated on Mon Jun 10 2019 14:41:22