]> defiant.homedns.org Git - ros_wild_thumper.git/blob - scripts/christmas.py
wt_node: Transision from 4x TLE5205 to 2x VNH2SP30
[ros_wild_thumper.git] / scripts / christmas.py
1 #!/usr/bin/env python
2 # -*- coding: iso-8859-15 -*-
3
4 import rospy
5 from random import *
6 from wild_thumper.msg import LedStripe, Led
7
8 max_val = 10
9
10 if __name__ == "__main__":
11         rospy.init_node('christmas')
12         pub = rospy.Publisher('led_stripe', LedStripe, queue_size=10)
13         rate = rospy.Rate(2)
14         while not rospy.is_shutdown():
15                 msg = LedStripe()
16                 msg.leds = [
17                                 Led(4, randint(0, max_val), randint(0, max_val), randint(0, max_val)),
18                                 Led(5, randint(0, max_val), randint(0, max_val), randint(0, max_val)),
19                                 Led(6, randint(0, max_val), randint(0, max_val), randint(0, max_val)),
20                                 Led(7, randint(0, max_val), randint(0, max_val), randint(0, max_val))
21                                 ]
22                 pub.publish(msg)
23                 rate.sleep()