random_float.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import roslib
4 import rospy
5 from std_msgs.msg import Float64
6 from random import random
7 def main():
8  rospy.init_node("random_float")
9  pub = rospy.Publisher("/random_float", Float64, queue_size=1)
10  while not rospy.is_shutdown():
11  val = random() * 1.0
12  pub.publish(Float64(val))
13  rospy.sleep(0.1)
14 
15 
16 if __name__ == "__main__":
17  main()


rwt_plot
Author(s): Ryohei Ueda
autogenerated on Fri Jun 2 2023 02:53:35