in status_led_pkg/status_led_pkg/status_led_node.py [0:0]
def get_led(self, led_index):
"""Helper function to return the LEDControl object for the led_index passed as parameter.
Args:
led_index (int): LED index to identify the status LED.
Returns:
LEDControl: LEDControl object that provides access to the RGB channel ports for the
specific LED light.
"""
if self.leds[led_index] is None:
led = led_control.LEDControl(led_index, self.get_logger())
led.enable()
self.leds[led_index] = led
else:
led = self.leds[led_index]
return led