21 from std_msgs.msg
import Float64
24 rospy.init_node(
"test_publisher_float_sine_noise", anonymous=
True)
27 input_pub = rospy.Publisher(
"input", Float64, queue_size=1)
34 b = 0.1 * (2.0*math.pi/freq)
41 while not rospy.is_shutdown():
42 input_msg.data = a*math.sin(b*i+c) + d
44 noise = random.uniform(-a, a)
46 input_msg.data += noise
48 input_pub.publish(input_msg)
53 if __name__ ==
'__main__':
56 except rospy.ROSInterruptException:
pass