/head_controller/point_head_action#

Caution

This documentation page has been auto-generated.

It may be missing some details.

/head_controller/point_head_action Quick Facts

Category

👋 Gestures and motions

Message type

control_msgs/action/PointHead

Moves the head joints to the necessary positions to point to a desired position, performing inverse kinematics

Quick snippets#

Send a goal from the command-line#
$ ros2 action send_goal /head_controller/point_head_action control_msgs/action/PointHead # 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 control_msgs.action import PointHead

class PointHeadActionActionClient(Node):

    def __init__(self):
        super().__init__('head_controller_point_head_action_client')
        self._action_client = ActionClient(self, PointHead, '/head_controller/point_head_action')

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

        # TODO: adapt to the action's parameters
        # check https://docs.ros2.org/latest/api/control_msgs/action/PointHead.html
        # 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 = PointHeadActionActionClient()

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

    rclpy.spin_until_future_complete(action_client, future)

    rclpy.shutdown()