[πŸ€” ROS2?] /play_motion_builder_node/run#

Caution

This documentation page has been auto-generated.

It may be missing some details.

/play_motion_builder_node/run Quick Facts

Category

πŸ‘‹ Gestures and motions

Message type

play_motion_builder_msgs/action/RunMotion

Quick snippets#

Send a goal from the command-line#
$ ros2 action send_goal /play_motion_builder_node/run play_motion_builder_msgs/action/RunMotion # 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 play_motion_builder_msgs.action import RunMotion

class RunActionClient(Node):

    def __init__(self):
        super().__init__('play_motion_builder_node_run_client')
        self._action_client = ActionClient(self, RunMotion, '/play_motion_builder_node/run')

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

        # TODO: adapt to the action's parameters
        # check the play_motion_builder_msgs/action/RunMotionGoal message
        # definition 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 = RunActionClient()

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

    rclpy.spin_until_future_complete(action_client, future)

    rclpy.shutdown()