Main Page
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Classes
Class List
Class Hierarchy
Class Members
All
Functions
Variables
Files
File List
scripts
sin.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
import
roslib
4
import
rospy
5
import
math
6
from
std_msgs.msg
import
Float64
7
from
random
import
random
8
def
main
():
9
rospy.init_node(
"sin"
)
10
pub = rospy.Publisher(
"/sin"
, Float64, queue_size=1)
11
counter = 0
12
RESOLUTION = 100
13
while
not
rospy.is_shutdown():
14
if
counter == RESOLUTION:
15
counter = 0
16
val = math.sin(2 * math.pi / RESOLUTION * counter)
17
pub.publish(Float64(val))
18
rospy.sleep(0.05)
19
counter = counter + 1
20
21
22
if
__name__ ==
"__main__"
:
23
main
()
sin.main
def main()
Definition:
sin.py:8
rwt_plot
Author(s): Ryohei Ueda
autogenerated on Sat Jun 3 2023 02:43:57