/pal_led_manager/do_effect#

Caution

This documentation page has been auto-generated.

It may be missing some details.

/pal_led_manager/do_effect Quick Facts

Category

βš™οΈ Robots hardware

Message type

pal_device_msgs/action/DoTimedLedEffect

Controls the various LEDs or PAL’s robots. You can select the desired set of LEDs, a colour effect, duration and priority, as well as provide effect-specific parameters (like the desired color).

See LEDs API for details.

Quick snippets#

Send a goal from the command-line#
$ ros2 action send_goal /pal_led_manager/do_effect pal_device_msgs/action/DoTimedLedEffect # press Tab to complete the message prototype

How to use in your code#

Call the action from a Python script#
#!/usr/bin/env python

import rclpy
from rclpy.action import ActionClient
from rclpy.node import Node

from pal_device_msgs.action import DoTimedLedEffect

class DoEffectActionClient(Node):

    def __init__(self):
        super().__init__('pal_led_manager_do_effect_client')
        self._action_client = ActionClient(self, DoTimedLedEffect, '/pal_led_manager/do_effect')

    def send_goal(self, a, b):
        goal_msg = DoTimedLedEffect.Goal()

        # TODO: adapt to the action's parameters
        # check https://github.com/pal-robotics/pal_msgs/tree/indigo-devel/pal_device_msgs/action/DoTimedLedEffect.action
        # for the possible goal parameters
        # goal_msg.a = a
        # goal_msg.b = b

        self._action_client.wait_for_server()

        return self._action_client.send_goal_async(goal_msg)

if __name__ == '__main__':
    rclpy.init(args=args)

    action_client = DoEffectActionClient()

    # TODO: adapt to your action's parameters
    future = action_client.send_goal(a, b)

    rclpy.spin_until_future_complete(action_client, future)

    rclpy.shutdown()