Go to the documentation of this file.00001
00002
00003 from jsk_recognition_msgs.msg import PlotData
00004 import numpy as np
00005 import rospy
00006 import math
00007
00008 if __name__ == "__main__":
00009 rospy.init_node("sample_2d_plot")
00010 pub = rospy.Publisher("~output", PlotData)
00011 r = rospy.Rate(10)
00012 offset = 0
00013 while not rospy.is_shutdown():
00014 msg = PlotData()
00015 msg.xs = np.arange(0, 5, 0.1)
00016 msg.ys = [math.sin(x + offset) for x in msg.xs]
00017 pub.publish(msg)
00018 offset = offset + 0.1
00019 r.sleep()