21 from std_msgs.msg
import ColorRGBA
26 rospy.wait_for_service(
'/light_controller/mode')
27 control_lights = rospy.ServiceProxy(
'/light_controller/mode', SetLightMode)
29 light_mode = LightMode()
37 light_red = ColorRGBA()
80 light_mode.frequency=40
81 light_mode.colors.append(green);
82 light_mode.colors.append(green);
83 light_mode.colors.append(green);
84 light_mode.colors.append(green);
85 light_mode.colors.append(green);
86 light_mode.colors.append(green);
87 light_mode.colors.append(green);
88 light_mode.colors.append(green);
89 light_mode.colors.append(green);
90 light_mode.colors.append(green);
91 light_mode.colors.append(green);
92 light_mode.colors.append(green);
93 light_mode.colors.append(green);
94 light_mode.colors.append(green);
95 light_mode.colors.append(green);
96 light_mode.colors.append(blue);
97 light_mode.colors.append(blue);
98 light_mode.colors.append(blue);
99 light_mode.colors.append(blue);
100 light_mode.colors.append(blue);
101 light_mode.colors.append(blue);
102 light_mode.colors.append(blue);
103 light_mode.colors.append(blue);
104 light_mode.colors.append(blue);
105 light_mode.colors.append(blue);
106 light_mode.colors.append(blue);
107 light_mode.colors.append(blue);
108 light_mode.colors.append(blue);
109 light_mode.colors.append(blue);
110 light_mode.colors.append(blue);
112 light_mode.colors.append(green);
113 light_mode.colors.append(green);
114 light_mode.colors.append(green);
115 light_mode.colors.append(green);
116 light_mode.colors.append(green);
117 light_mode.colors.append(green);
118 light_mode.colors.append(green);
119 light_mode.colors.append(green);
120 light_mode.colors.append(green);
121 light_mode.colors.append(green);
122 light_mode.colors.append(green);
123 light_mode.colors.append(green);
124 light_mode.colors.append(green);
125 light_mode.colors.append(green);
126 light_mode.colors.append(green);
127 light_mode.colors.append(blue);
128 light_mode.colors.append(blue);
129 light_mode.colors.append(blue);
130 light_mode.colors.append(blue);
131 light_mode.colors.append(blue);
132 light_mode.colors.append(blue);
133 light_mode.colors.append(blue);
134 light_mode.colors.append(blue);
135 light_mode.colors.append(blue);
136 light_mode.colors.append(blue);
137 light_mode.colors.append(blue);
138 light_mode.colors.append(blue);
139 light_mode.colors.append(blue);
140 light_mode.colors.append(blue);
141 light_mode.colors.append(blue);
143 resp1 = control_lights(light_mode)
145 except rospy.ServiceException
as e:
146 print(
"Service call failed: %s"%e)
150 if __name__ ==
'__main__':
152 rospy.init_node(
'light_test')
154 except rospy.ROSInterruptException: