class LedRingRosWrapper(object):
Constructor: LedRingRosWrapper(hardware_version, service_timeout)
Undocumented
Method | __init__ |
Undocumented |
Method | alternate |
Several colors are alternated one after the other. |
Method | breath |
Variation of the light intensity of the LED ring, similar to human breathing. |
Method | chase |
Movie theater light style chaser animation. |
Method | custom |
Sends a colour command to all LEDs of the LED ring. The function expects a list of colours for the 30 LEDs of the robot. |
Method | flashing |
Flashes a color according to a frequency. The frequency is equal to 1 / period. |
Method | go |
LEDs turn on like a loading circle, and are then all turned off at once. |
Method | go |
LEDs turn on like a loading circle, and are turned off the same way. |
Method | rainbow |
Draws rainbow that fades across all LEDs at once. |
Method | rainbow |
Rainbow chase animation, like the led_ring_chase method. |
Method | rainbow |
Draws rainbow that uniformly distributes itself across all LEDs. |
Method | set |
Lights up an LED in one colour. RGB colour between 0 and 255. |
Method | snake |
A small coloured snake (certainly a python :D ) runs around the LED ring. |
Method | solid |
Sets the whole Led Ring to a fixed color. |
Method | turn |
Turns off all Leds |
Method | wipe |
Wipes a color across the LED Ring, light a LED at a time. |
Property | hardware |
Undocumented |
Static Method | __check |
Undocumented |
Method | __call |
Waits for the service called service_name Then calls the service with args |
Method | __check |
Undocumented |
Method | __classic |
Undocumented |
Instance Variable | __hardware |
Undocumented |
Instance Variable | __service |
Undocumented |
Several colors are alternated one after the other.
Examples:
from std_msgs.msg import ColorRGBA color_list = [ ColorRGBA(r=15, g=50, b=255), [255, 0, 0], [0, 255, 0], ] led_ring.alternate(color_list) led_ring.alternate(color_list, 1, 100, True) led_ring.alternate(color_list, iterations=20, wait=True)
Parameters | |
color | Led color list of lists of size 3[R, G, B] or ColorRGBA objects. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive alternations. If 0, the Led Ring alternates endlessly. |
wait:bool | The service wait for the animation to finish all iterations or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Variation of the light intensity of the LED ring, similar to human breathing.
Examples:
from std_msgs.msg import ColorRGBA led_ring.breath(ColorRGBA(r=15, g=50, b=255)) led_ring.breath([15, 50, 255], 1, 100, True) led_ring.breath(ColorRGBA(r=15, g=50, b=255), iterations=20, wait=True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive turns around the Led Ring. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Movie theater light style chaser animation.
Examples:
from std_msgs.msg import ColorRGBA led_ring.chase(ColorRGBA(r=15, g=50, b=255)) led_ring.chase([15, 50, 255], 1, 100, True) led_ring.chase(ColorRGBA(r=15, g=50, b=255), iterations=20, wait=True)
Parameters | |
color:list or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive chase. If 0, the animation continues endlessly. One chase just lights one Led every 3 Leds. |
wait:bool | The service wait for the animation to finish all iterations or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Sends a colour command to all LEDs of the LED ring. The function expects a list of colours for the 30 LEDs of the robot.
Example:
led_list = [[i / 30. * 255 , 0, 255 - i / 30.] for i in range(30)] led_ring.custom(led_list)
Parameters | |
led | List of size 30 of led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
Returns | |
(int, str) | status, message |
Flashes a color according to a frequency. The frequency is equal to 1 / period.
Examples:
from std_msgs.msg import ColorRGBA led_ring.flashing([15, 50, 255]) led_ring.flashing([15, 50, 255], 1, 100, True) led_ring.flashing([15, 50, 255], iterations=20, wait=True) frequency = 20 # Hz total_duration = 10 # seconds led_ring.flashing(ColorRGBA(r=15, g=50, b=255), 1./frequency, total_duration * frequency , True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive flashes. If 0, the Led Ring flashes endlessly. |
wait:bool | The service wait for the animation to finish all iterations or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
LEDs turn on like a loading circle, and are then all turned off at once.
Examples:
from std_msgs.msg import ColorRGBA led_ring.go_up(ColorRGBA(r=15, g=50, b=255)) led_ring.go_up([15, 50, 255], 1, 100, True) led_ring.go_up(ColorRGBA(r=15, g=50, b=255), iterations=20, wait=True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive turns around the Led Ring. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
LEDs turn on like a loading circle, and are turned off the same way.
Examples:
from std_msgs.msg import ColorRGBA led_ring.go_up_down(ColorRGBA(r=15, g=50, b=255)) led_ring.go_up_down([15, 50, 255], 1, 100, True) led_ring.go_up_down(ColorRGBA(r=15, g=50, b=255), iterations=20, wait=True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive turns around the Led Ring. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Draws rainbow that fades across all LEDs at once.
Examples:
led_ring.rainbow() led_ring.rainbow(5, 2, True) led_ring.rainbow(wait=True)
Parameters | |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive rainbows. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Rainbow chase animation, like the led_ring_chase method.
Examples:
led_ring.rainbow_chase() led_ring.rainbow_chase(5, 2, True) led_ring.rainbow_chase(wait=True)
Parameters | |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive rainbow cycles. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Draws rainbow that uniformly distributes itself across all LEDs.
Examples:
led_ring.rainbow_cycle() led_ring.rainbow_cycle(5, 2, True) led_ring.rainbow_cycle(wait=True)
Parameters | |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
iterations:int | Number of consecutive rainbow cycles. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Lights up an LED in one colour. RGB colour between 0 and 255.
Example:
from std_msgs.msg import ColorRGBA led_ring.set_led_color(5, [15, 50, 255]) led_ring.set_led_color(5, ColorRGBA(r=15, g=50, b=255))
Parameters | |
led | Id of the led: between 0 and 29 |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
Returns | |
(int, str) | status, message |
A small coloured snake (certainly a python :D ) runs around the LED ring.
Examples:
from std_msgs.msg import ColorRGBA led_ring.snake(ColorRGBA(r=15, g=50, b=255)) led_ring.snake([15, 50, 255], 1, 100, True) led_ring.snake(ColorRGBA(r=15, g=50, b=255), iterations=20, wait=True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default duration will be used. |
iterations:int | Number of consecutive turns around the Led Ring. If 0, the animation continues endlessly. |
wait:bool | The service wait for the animation to finish or not to answer. If iterations is 0, the service answers immediately. |
Returns | |
(int, str) | status, message |
Sets the whole Led Ring to a fixed color.
Example:
from std_msgs.msg import ColorRGBA led_ring.solid([15, 50, 255]) led_ring.solid(ColorRGBA(r=15, g=50, b=255), True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
wait:bool | The service wait for the animation to finish or not to answer. For this method, the action is quickly done, so waiting doesn't take a lot of time. |
Returns | |
(int, str) | status, message |
Turns off all Leds
Example:
led_ring.turn_off()
Parameters | |
wait:bool | The service wait for the animation to finish or not to answer. For this method, the action is quickly done, so waiting doesn't take a lot of time. |
Returns | |
(int, str) | status, message |
Wipes a color across the LED Ring, light a LED at a time.
Examples:
from std_msgs.msg import ColorRGBA led_ring.wipe(ColorRGBA(r=15, g=50, b=255)) led_ring.wipe([15, 50, 255], 1, True) led_ring.wipe(ColorRGBA(r=15, g=50, b=255), wait=True)
Parameters | |
color:list[float] or ColorRGBA | Led color in a list of size 3[R, G, B] or in an ColorRGBA object. RGB channels from 0 to 255. |
period:float | Execution time for a pattern in seconds. If 0, the default time will be used. |
wait:bool | The service wait for the animation to finish or not to answer. |
Returns | |
(int, str) | status, message |