std_marker_demo.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 import rospy
4 from easy_markers.generator import MarkerGenerator
5 from visualization_msgs.msg import Marker
6 
7 
8 if __name__ == '__main__':
9  rospy.init_node('some_markers')
10  pub = rospy.Publisher('/visualization_marker', Marker, queue_size=1)
12  gen.ns = '/awesome_markers'
13  gen.type = Marker.SPHERE_LIST
14  gen.scale = [.3] * 3
15  gen.frame_id = 'map'
16 
17  while not rospy.is_shutdown():
18  gen.counter = 0
19  t = rospy.get_time()
20 
21  gen.color = [1, 0, 0, 1]
22  m = gen.marker(points=[(0, i, (i + t) % 5.0) for i in range(10)])
23  pub.publish(m)
24  rospy.sleep(0.1)
25  gen.color = [0, 1, 0, 1]
26  m = gen.marker(points=[(0, i, (i - t) % 5.0) for i in range(10)])
27  pub.publish(m)
28  rospy.sleep(0.1)


easy_markers
Author(s): David V. Lu!!
autogenerated on Tue Mar 1 2022 00:06:55