/skill/navigate_to_poseΒΆ

Caution

This documentation page has been auto-generated.

It may be missing some details.

/skill/navigate_to_pose Quick Facts

Category

🧭 Navigation

Message type

navigation_skills/action/NavigateToPose

Make the robot autonomously navigate toward the desired pose. See πŸ₯… Goal Navigation for details.

Quick snippetsΒΆ

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

class NavigateToPoseActionClient(Node):

    def __init__(self):
        super().__init__('skill_navigate_to_pose_client')
        self._action_client = ActionClient(self, NavigateToPose, '/skill/navigate_to_pose')

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

        # TODO: adapt to the action's parameters
        # check the navigation_skills/action/NavigateToPoseGoal 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 = NavigateToPoseActionClient()

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

    rclpy.spin_until_future_complete(action_client, future)

    rclpy.shutdown()