Main Page
+
Namespaces
Namespace List
+
Namespace Members
All
Functions
Variables
+
Classes
Class List
Class Hierarchy
+
Class Members
All
Functions
Variables
+
Files
File List
scripts
cos.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(
"cos"
)
10
pub = rospy.Publisher(
"/cos"
, 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.cos(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
()
cos.main
def main()
Definition:
cos.py:8
rwt_plot
Author(s): Ryohei Ueda
autogenerated on Fri Jun 2 2023 02:53:35