/chatbot_rasa/start_dialogueΒΆ

Caution

This documentation page has been auto-generated.

It may be missing some details.

/chatbot_rasa/start_dialogue Quick Facts

Category

πŸ’¬ Communication

Message type

chatbot_msgs/action/Dialogue

This is used to open a dialogue channel with the RASA chatbot.

Quick snippetsΒΆ

Send a goal from the command-lineΒΆ
$ ros2 action send_goal /chatbot_rasa/start_dialogue chatbot_msgs/action/Dialogue # 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 chatbot_msgs.action import Dialogue

class StartDialogueActionClient(Node):

    def __init__(self):
        super().__init__('chatbot_rasa_start_dialogue_client')
        self._action_client = ActionClient(self, Dialogue, '/chatbot_rasa/start_dialogue')

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

        # TODO: adapt to the action's parameters
        # check https://github.com/pal-robotics/chatbot_msgs/tree/humble-devel/action/Dialogue.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 = StartDialogueActionClient()

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

    rclpy.spin_until_future_complete(action_client, future)

    rclpy.shutdown()