in status_led_pkg/status_led_pkg/status_led_node.py [0:0]
def effect_solid_color(self,
led_index=constants.DEFAULT_LED_INDEX,
color=constants.LEDColors.BLUE,
hold=0.0):
"""Main function implementing the solid color effect with the color and the led index
passed as parameter.
Args:
led_index (int, optional): LED index to identify the status LED.
Defaults to constants.DEFAULT_LED_INDEX.
color (str, optional): Color to set. Defaults to constants.LEDColors.BLUE.
hold (float, optional): Least amount of time in seconds to hold the effect before
waiting for next effect. Defaults to 0.0.
"""
led = self.get_led(led_index)
stop = self.stop[led_index]
if color in constants.LED_COLOR_VALUES:
led.rgb(constants.LED_COLOR_VALUES[color])
time.sleep(hold)
stop.wait()
led.off()
else:
self.get_logger().error(f"Color not supported: {color}")