1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 import rospy
16 from intera_io import IODeviceInterface
17
18
20 """
21 Interface class for the lights on the Intera robots.
22 """
23
25 """
26 Constructor.
27
28 """
29 self._lights_io = IODeviceInterface("robot", "robot")
30
32 """
33 Returns a list of strings describing all available lights
34
35 @rtype: list [str]
36 @return: a list of string representing light names
37 Each light name of the following format:
38 '<assembly>_<color>_light'
39 """
40 return [name for name in self._lights_io.list_signal_names() if "light" in name]
41
43 """
44 Sets the named light the desired state (on=True, off=False)
45
46 @type name: str
47 @param name: Light name of the following format:
48 '<assembly>_<color>_light'
49 @type on: bool
50 @param on: value to set the light (on=True, off=False)
51
52 @rtype: bool
53 @return: True if the light state is set, False otherwise
54 """
55 return self._lights_io.set_signal_value(name, on)
56
58 """
59 Returns a boolean describing whether the requested light is 'ON'.
60 (True: on, False: off)
61
62 @type name: str
63 @param name: Light name of the following format:
64 '<assembly>_<color>_light'
65 @rtype: bool
66 @return: a variable representing light state: (True: on, False: off)
67 """
68 return self._lights_io.get_signal_value(name)
69