/skill/look_atΒΆ

Caution

This documentation page has been auto-generated.

It may be missing some details.

/skill/look_at Quick Facts

Category

πŸ˜„ Interaction

Message type

interaction_skills/action/LookAt

Controls the gaze behaviour of the robot. See look_at for details.

Quick snippetsΒΆ

Send a goal from the command-lineΒΆ
$ ros2 action send_goal /skill/look_at interaction_skills/action/LookAt # 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 interaction_skills.action import LookAt

class LookAtActionClient(Node):

    def __init__(self):
        super().__init__('skill_look_at_client')
        self._action_client = ActionClient(self, LookAt, '/skill/look_at')

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

        # TODO: adapt to the action's parameters
        # check https://github.com/pal-robotics/interaction_skills/tree/main/action/LookAt.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 = LookAtActionClient()

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

    rclpy.spin_until_future_complete(action_client, future)

    rclpy.shutdown()