{"id":3555,"date":"2025-08-10T14:36:30","date_gmt":"2025-08-10T14:36:30","guid":{"rendered":"https:\/\/learnbydoing.dev\/?p=3555"},"modified":"2026-01-10T22:00:56","modified_gmt":"2026-01-10T22:00:56","slug":"how-to-build-voice-interaction-model-in-ros-2","status":"publish","type":"post","link":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/","title":{"rendered":"How to Build a Voice Interaction Model in ROS 2"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"3555\" class=\"elementor elementor-3555\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e28ab35 e-flex e-con-boxed e-con e-parent\" data-id=\"e28ab35\" data-element_type=\"container\" data-e-type=\"container\" id=\"content\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-62ab6e3 e-con-full e-flex e-con e-child\" data-id=\"62ab6e3\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-62ab203 elementor-align-center elementor-widget elementor-widget-post-info\" data-id=\"62ab203\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-2c98363 elementor-inline-item\" itemprop=\"about\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-terms\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-post-info__terms-list\">\n\t\t\t\t<span class=\"elementor-post-info__terms-list-item\">ROS 2<\/span>, <span class=\"elementor-post-info__terms-list-item\">Tutoriales<\/span>\t\t\t\t<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-0650e10 e-con-full e-flex e-con e-child\" data-id=\"0650e10\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ac19582 elementor-view-default elementor-widget elementor-widget-icon\" data-id=\"ac19582\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"75\" height=\"75\" viewbox=\"0 0 75 75\" fill=\"none\"><path d=\"M74.9999 75H13.1889V73.0002H71.5859L0.460938 1.87521L1.87515 0.460999L73.0001 71.586V13.1889H74.9999V75Z\" fill=\"white\"><\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-47aa245d e-flex e-con-boxed e-con e-parent\" data-id=\"47aa245d\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1943f30 elementor-widget elementor-widget-image\" data-id=\"1943f30\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model-1024x576.webp\" class=\"attachment-large size-large wp-image-3745\" alt=\"\" srcset=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model-1024x576.webp 1024w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model-300x169.webp 300w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model-768x432.webp 768w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model-1536x864.webp 1536w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model-18x10.webp 18w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp 1920w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-261c3d8 elementor-widget elementor-widget-text-editor\" data-id=\"261c3d8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"404\" data-end=\"687\">Voice control has become one of the most natural and intuitive ways to interact with robots. From simple voice commands to complex conversational systems, enabling a robot to understand and respond to spoken language opens the door to more human-like and user-friendly experiences.<\/p><p data-start=\"689\" data-end=\"878\">In this tutorial, we will build a <strong data-start=\"723\" data-end=\"750\">Voice Interaction Model<\/strong> in ROS 2 that listens to a voice command, processes it through speech recognition, and triggers a robot\u2019s action accordingly.<\/p><p data-start=\"880\" data-end=\"1176\">We will go step-by-step \u2014 first understanding the theory, then implementing the system with complete ROS 2 code examples. As always, I\u2019ll provide the <strong data-start=\"1030\" data-end=\"1049\">full code first<\/strong>, and then we\u2019ll go into a <em data-start=\"1076\" data-end=\"1103\">Let\u2019s break down the code<\/em> section where we dissect each line to understand what it does and why.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e04c0ca elementor-widget elementor-widget-text-editor\" data-id=\"e04c0ca\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1183\" data-end=\"1235\"><strong>1. Understanding the Voice Interaction Pipeline<\/strong><\/h3><p data-start=\"1236\" data-end=\"1320\">A voice interaction model in robotics typically consists of three main components:<\/p><ol data-start=\"1322\" data-end=\"1590\"><li data-start=\"1322\" data-end=\"1390\"><p data-start=\"1325\" data-end=\"1390\"><strong data-start=\"1325\" data-end=\"1342\">Audio Capture<\/strong> \u2014 getting the voice signal from a microphone.<\/p><\/li><li data-start=\"1391\" data-end=\"1484\"><p data-start=\"1394\" data-end=\"1484\"><strong data-start=\"1394\" data-end=\"1416\">Speech Recognition<\/strong> \u2014 converting the audio to text (using online or offline engines).<\/p><\/li><li data-start=\"1485\" data-end=\"1590\"><p data-start=\"1488\" data-end=\"1590\"><strong data-start=\"1488\" data-end=\"1528\">Command Interpretation and Execution<\/strong> \u2014 parsing the recognized text and triggering robot actions.<\/p><\/li><\/ol><p data-start=\"1592\" data-end=\"1733\">In ROS 2, these components can be implemented as separate nodes or integrated into a single node depending on the complexity of the system.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1560ace elementor-widget elementor-widget-text-editor\" data-id=\"1560ace\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1740\" data-end=\"1787\"><strong>2. Implementing the Voice Interaction Node<\/strong><\/h3><p data-start=\"1789\" data-end=\"1869\">Here\u2019s the <strong data-start=\"1800\" data-end=\"1830\">full Python implementation<\/strong> of our ROS 2 voice interaction node:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5e864ea elementor-widget elementor-widget-code-highlight\" data-id=\"5e864ea\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>import rclpy\r\nfrom rclpy.node import Node\r\nimport speech_recognition as sr\r\nfrom std_msgs.msg import String\r\n\r\nclass VoiceInteractionNode(Node):\r\n    def __init__(self):\r\n        super().__init__('voice_interaction_node')\r\n        self.publisher_ = self.create_publisher(String, 'voice_commands', 10)\r\n        self.timer = self.create_timer(1.0, self.listen_command)\r\n        self.recognizer = sr.Recognizer()\r\n        self.microphone = sr.Microphone()\r\n        self.get_logger().info(\"Voice Interaction Node started and listening...\")\r\n\r\n    def listen_command(self):\r\n        with self.microphone as source:\r\n            self.get_logger().info(\"Listening for a command...\")\r\n            audio = self.recognizer.listen(source)\r\n        try:\r\n            command = self.recognizer.recognize_google(audio)\r\n            self.get_logger().info(f\"Recognized command: {command}\")\r\n            msg = String()\r\n            msg.data = command\r\n            self.publisher_.publish(msg)\r\n        except sr.UnknownValueError:\r\n            self.get_logger().warn(\"Could not understand the audio.\")\r\n        except sr.RequestError as e:\r\n            self.get_logger().error(f\"Speech Recognition service error: {e}\")\r\n\r\ndef main(args=None):\r\n    rclpy.init(args=args)\r\n    node = VoiceInteractionNode()\r\n    rclpy.spin(node)\r\n    node.destroy_node()\r\n    rclpy.shutdown()\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6b7a3fd elementor-widget elementor-widget-text-editor\" data-id=\"6b7a3fd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"2220\" data-end=\"2243\"><strong>Let\u2019s break down the code<\/strong><\/h3>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-132e47b elementor-widget elementor-widget-code-highlight\" data-id=\"132e47b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>import rclpy\r\nfrom rclpy.node import Node\r\nimport speech_recognition as sr\r\nfrom std_msgs.msg import String\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8f421fc elementor-widget elementor-widget-text-editor\" data-id=\"8f421fc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3419\" data-end=\"3429\">We import:<\/p><ul data-start=\"3430\" data-end=\"3659\"><li data-start=\"3430\" data-end=\"3472\"><p data-start=\"3432\" data-end=\"3472\"><strong data-start=\"3432\" data-end=\"3441\">rclpy<\/strong> \u2014 ROS 2 Python client library.<\/p><\/li><li data-start=\"3473\" data-end=\"3522\"><p data-start=\"3475\" data-end=\"3522\"><strong data-start=\"3475\" data-end=\"3483\">Node<\/strong> \u2014 base class for creating ROS 2 nodes.<\/p><\/li><li data-start=\"3523\" data-end=\"3584\"><p data-start=\"3525\" data-end=\"3584\"><strong data-start=\"3525\" data-end=\"3547\">speech_recognition<\/strong> \u2014 Python library for speech-to-text.<\/p><\/li><li data-start=\"3585\" data-end=\"3659\"><p data-start=\"3587\" data-end=\"3659\"><strong data-start=\"3587\" data-end=\"3597\">String<\/strong> \u2014 ROS 2 standard message type for publishing recognized text.<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-46b6c80 elementor-widget elementor-widget-text-editor\" data-id=\"46b6c80\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"3419\" data-end=\"3429\"><strong>Node Initialization<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dfae5a6 elementor-widget elementor-widget-code-highlight\" data-id=\"dfae5a6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>class VoiceInteractionNode(Node):\r\n    def __init__(self):\r\n        super().__init__('voice_interaction_node')\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-821e45c elementor-widget elementor-widget-text-editor\" data-id=\"821e45c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"2574\" data-end=\"2713\">We create a ROS 2 node named <code data-start=\"3838\" data-end=\"3864\">\"voice_interaction_node\"<\/code>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-19013dd elementor-widget elementor-widget-text-editor\" data-id=\"19013dd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"2574\" data-end=\"2713\"><strong>Publisher<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-276b79f elementor-widget elementor-widget-code-highlight\" data-id=\"276b79f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>self.publisher_ = self.create_publisher(String, 'voice_commands', 10)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8691845 elementor-widget elementor-widget-text-editor\" data-id=\"8691845\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"2574\" data-end=\"2713\">This publishes recognized commands on the <code data-start=\"4008\" data-end=\"4024\">voice_commands<\/code> topic.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7a888ec elementor-widget elementor-widget-text-editor\" data-id=\"7a888ec\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"2746\" data-end=\"2847\"><strong>Timer Callback<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-18787ab elementor-widget elementor-widget-code-highlight\" data-id=\"18787ab\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>self.timer = self.create_timer(1.0, self.listen_command)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6df5f32 elementor-widget elementor-widget-text-editor\" data-id=\"6df5f32\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"4124\" data-end=\"4208\">Every <strong data-start=\"4130\" data-end=\"4142\">1 second<\/strong>, the node calls the <code data-start=\"4163\" data-end=\"4181\">listen_command()<\/code> function to capture audio.<\/p><h4 data-start=\"4210\" data-end=\"4239\">\u00a0<\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cf6eef3 elementor-widget elementor-widget-text-editor\" data-id=\"cf6eef3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"3305\" data-end=\"3343\"><strong>Speech Recognition Setup<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5af4bfd elementor-widget elementor-widget-code-highlight\" data-id=\"5af4bfd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>self.recognizer = sr.Recognizer()\r\nself.microphone = sr.Microphone()\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-69f68a5 elementor-widget elementor-widget-text-editor\" data-id=\"69f68a5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3453\" data-end=\"3477\">We initialize the speech recognizer and the default microphone input.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-58daf3d elementor-widget elementor-widget-text-editor\" data-id=\"58daf3d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"3453\" data-end=\"3477\"><strong>Listening for Commands<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-41ebcf3 elementor-widget elementor-widget-code-highlight\" data-id=\"41ebcf3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>with self.microphone as source:\r\n    self.get_logger().info(\"Listening for a command...\")\r\n    audio = self.recognizer.listen(source)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a333079 elementor-widget elementor-widget-text-editor\" data-id=\"a333079\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3453\" data-end=\"3477\">We open the microphone and listen for audio input.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-870e954 elementor-widget elementor-widget-text-editor\" data-id=\"870e954\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"3453\" data-end=\"3477\"><strong>Recognizing Speech<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f813f97 elementor-widget elementor-widget-code-highlight\" data-id=\"f813f97\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-xml\">\n\t\t\t\t<code readonly=\"true\" class=\"language-xml\">\n\t\t\t\t\t<xmp>command = self.recognizer.recognize_google(audio)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c32f5d4 elementor-widget elementor-widget-text-editor\" data-id=\"c32f5d4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3453\" data-end=\"3477\">We use Google\u2019s speech recognition API to transcribe the audio.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c4b0884 elementor-widget elementor-widget-text-editor\" data-id=\"c4b0884\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"3453\" data-end=\"3477\"><strong>Publishing Commands<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ffa8675 elementor-widget elementor-widget-code-highlight\" data-id=\"ffa8675\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>msg = String()\r\nmsg.data = command\r\nself.publisher_.publish(msg)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a15a923 elementor-widget elementor-widget-text-editor\" data-id=\"a15a923\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The recognized text is published as a ROS 2 <code data-start=\"4918\" data-end=\"4926\">String<\/code> message.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2e5c830 elementor-widget elementor-widget-text-editor\" data-id=\"2e5c830\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"4937\" data-end=\"4956\"><strong>Error Handling<\/strong><\/h4><p data-start=\"4957\" data-end=\"4981\">We catch two exceptions:<\/p><ul data-start=\"4982\" data-end=\"5123\"><li data-start=\"4982\" data-end=\"5039\"><p data-start=\"4984\" data-end=\"5039\"><code data-start=\"4984\" data-end=\"5003\">UnknownValueError<\/code> \u2014 when speech cannot be recognized.<\/p><\/li><li data-start=\"5040\" data-end=\"5123\"><p data-start=\"5042\" data-end=\"5123\"><code data-start=\"5042\" data-end=\"5056\">RequestError<\/code> \u2014 when there\u2019s an issue contacting the speech recognition service.<br \/><br \/><\/p><\/li><\/ul><h4 data-start=\"5125\" data-end=\"5146\"><strong>Main Entry Point<\/strong><\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-176de62 elementor-widget elementor-widget-code-highlight\" data-id=\"176de62\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>if __name__ == '__main__':\r\n    main()\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e22cf2f elementor-widget elementor-widget-text-editor\" data-id=\"e22cf2f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"180\" data-end=\"220\">Runs the ROS 2 node.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-37f57d7 elementor-widget elementor-widget-text-editor\" data-id=\"37f57d7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"180\" data-end=\"220\"><strong>3. Testing the Voice Interaction Node<\/strong><\/h3><p data-start=\"222\" data-end=\"299\">Once you have the code ready, it\u2019s time to test your voice interaction model.<\/p><h4 data-start=\"301\" data-end=\"334\"><strong>Step 1 &#8211; Install Dependencies<\/strong><\/h4><p data-start=\"335\" data-end=\"393\">Make sure you have the required Python packages installed:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4405bef elementor-widget elementor-widget-code-highlight\" data-id=\"4405bef\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>pip install SpeechRecognition\r\nsudo apt install portaudio19-dev\r\npip install pyaudio\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a445f8c elementor-widget elementor-widget-text-editor\" data-id=\"a445f8c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul data-start=\"521\" data-end=\"787\"><li data-start=\"521\" data-end=\"606\"><p data-start=\"523\" data-end=\"606\"><code data-start=\"523\" data-end=\"554\">pip install SpeechRecognition<\/code> \u2192 Installs the Python speech recognition library.<\/p><\/li><li data-start=\"607\" data-end=\"706\"><p data-start=\"609\" data-end=\"706\"><code data-start=\"609\" data-end=\"643\">sudo apt install portaudio19-dev<\/code> \u2192 Installs audio device support needed for microphone input.<\/p><\/li><li data-start=\"707\" data-end=\"787\"><p data-start=\"709\" data-end=\"787\"><code data-start=\"709\" data-end=\"730\">pip install pyaudio<\/code> \u2192 Provides the interface between Python and PortAudio.<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4b1eab9 elementor-widget elementor-widget-text-editor\" data-id=\"4b1eab9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"794\" data-end=\"819\"><strong>Step 2 &#8211; Run the Node<\/strong><\/h4><p data-start=\"820\" data-end=\"867\">In one terminal, source your workspace and run:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-79d1fa3 elementor-widget elementor-widget-code-highlight\" data-id=\"79d1fa3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-xml\">\n\t\t\t\t<code readonly=\"true\" class=\"language-xml\">\n\t\t\t\t\t<xmp>. install\/setup.bash\r\nros2 run voice_interaction_pkg voice_interaction_node\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-efc1605 elementor-widget elementor-widget-text-editor\" data-id=\"efc1605\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"957\" data-end=\"986\"><em data-start=\"957\" data-end=\"984\">Let\u2019s break down the code<\/em><\/p><ul data-start=\"987\" data-end=\"1174\"><li data-start=\"987\" data-end=\"1077\"><p data-start=\"989\" data-end=\"1077\"><code data-start=\"989\" data-end=\"1011\">. install\/setup.bash<\/code> \u2192 Sources your ROS 2 workspace so ROS knows about your package.<\/p><\/li><li data-start=\"1078\" data-end=\"1174\"><p data-start=\"1080\" data-end=\"1174\"><code data-start=\"1080\" data-end=\"1135\">ros2 run voice_interaction_pkg voice_interaction_node<\/code> \u2192 Executes the node from your package.<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-64d5e23 elementor-widget elementor-widget-text-editor\" data-id=\"64d5e23\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4 data-start=\"1181\" data-end=\"1219\"><strong>Step 3 &#8211; Subscribe to the Commands<\/strong><\/h4><p data-start=\"1220\" data-end=\"1240\">In another terminal:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ea14b89 elementor-widget elementor-widget-code-highlight\" data-id=\"ea14b89\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>. install\/setup.bash\r\nros2 topic echo \/voice_commands\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-693d998 elementor-widget elementor-widget-text-editor\" data-id=\"693d998\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul><li data-start=\"1340\" data-end=\"1455\"><code data-start=\"1340\" data-end=\"1373\">ros2 topic echo \/voice_commands<\/code> \u2192 Displays every message published to the <code data-start=\"1416\" data-end=\"1433\">\/voice_commands<\/code> topic in real time.<\/li><\/ul><p data-start=\"1457\" data-end=\"1518\">You should see the exact text of the voice command you spoke.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c9956bc elementor-widget elementor-widget-text-editor\" data-id=\"c9956bc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1525\" data-end=\"1561\"><strong>4. Integrating with Robot Control<\/strong><\/h3><p data-start=\"1563\" data-end=\"1684\">Recognizing voice commands is just the first step. The real power comes when you connect these commands to robot actions.<\/p><p data-start=\"1686\" data-end=\"1854\">Let\u2019s say you have a robot that can move forward, turn, and stop. We\u2019ll create a command interpreter node that listens to <code data-start=\"1808\" data-end=\"1825\">\/voice_commands<\/code> and sends velocity commands.<\/p><h3 data-start=\"1861\" data-end=\"1903\">\u00a0<\/h3><h3 data-start=\"1861\" data-end=\"1903\"><strong>Full Command Interpreter Node (Python)<\/strong><\/h3>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7c9fb99 elementor-widget elementor-widget-code-highlight\" data-id=\"7c9fb99\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>import rclpy\r\nfrom rclpy.node import Node\r\nfrom std_msgs.msg import String\r\nfrom geometry_msgs.msg import Twist\r\n\r\nclass CommandInterpreter(Node):\r\n    def __init__(self):\r\n        super().__init__('command_interpreter')\r\n        self.subscription = self.create_subscription(\r\n            String,\r\n            'voice_commands',\r\n            self.listener_callback,\r\n            10)\r\n        self.publisher_ = self.create_publisher(Twist, 'cmd_vel', 10)\r\n        self.get_logger().info(\"Command Interpreter Node started.\")\r\n\r\n    def listener_callback(self, msg):\r\n        command = msg.data.lower()\r\n        twist = Twist()\r\n\r\n        if \"forward\" in command:\r\n            twist.linear.x = 0.2\r\n        elif \"backward\" in command:\r\n            twist.linear.x = -0.2\r\n        elif \"left\" in command:\r\n            twist.angular.z = 0.5\r\n        elif \"right\" in command:\r\n            twist.angular.z = -0.5\r\n        elif \"stop\" in command:\r\n            twist.linear.x = 0.0\r\n            twist.angular.z = 0.0\r\n\r\n        self.publisher_.publish(twist)\r\n        self.get_logger().info(f\"Executing command: {command}\")\r\n\r\ndef main(args=None):\r\n    rclpy.init(args=args)\r\n    node = CommandInterpreter()\r\n    rclpy.spin(node)\r\n    node.destroy_node()\r\n    rclpy.shutdown()\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e5d8424 elementor-widget elementor-widget-text-editor\" data-id=\"e5d8424\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"5254\" data-end=\"5282\"><strong>\ud83e\udde0Let\u2019s break down the code<\/strong><\/h3><h5 data-start=\"3220\" data-end=\"3254\"><strong>Subscribing to Voice Commands<\/strong><\/h5>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2fb1f22 elementor-widget elementor-widget-code-highlight\" data-id=\"2fb1f22\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>self.subscription = self.create_subscription(\r\n    String,\r\n    'voice_commands',\r\n    self.listener_callback,\r\n    10)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d806f70 elementor-widget elementor-widget-text-editor\" data-id=\"d806f70\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul data-start=\"3385\" data-end=\"3487\"><li data-start=\"3385\" data-end=\"3427\"><p data-start=\"3387\" data-end=\"3427\">Listens to the <code data-start=\"3402\" data-end=\"3418\">voice_commands<\/code> topic.<\/p><\/li><li data-start=\"3428\" data-end=\"3487\"><p data-start=\"3430\" data-end=\"3487\">When a new message arrives, it calls <code data-start=\"3467\" data-end=\"3486\">listener_callback<\/code>.<br \/><br \/><\/p><\/li><\/ul><h5 data-start=\"3489\" data-end=\"3522\"><strong>Publishing Velocity Commands<\/strong><\/h5>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-07664fd elementor-widget elementor-widget-code-highlight\" data-id=\"07664fd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>self.publisher_ = self.create_publisher(Twist, 'cmd_vel', 10)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-de1d45f elementor-widget elementor-widget-text-editor\" data-id=\"de1d45f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul><li>Publishes robot velocity messages to <code data-start=\"3638\" data-end=\"3647\">cmd_vel<\/code>.<\/li><\/ul><h5><strong>Parsing Commands<\/strong><\/h5>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3e89aed elementor-widget elementor-widget-code-highlight\" data-id=\"3e89aed\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>command = msg.data.lower()\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b16609c elementor-widget elementor-widget-text-editor\" data-id=\"b16609c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul data-start=\"3713\" data-end=\"3774\"><li data-start=\"3713\" data-end=\"3774\"><p data-start=\"3715\" data-end=\"3774\">Converts recognized command to lowercase for easy matching.<\/p><\/li><\/ul><h5 data-start=\"3776\" data-end=\"3795\"><strong>Movement Logic<\/strong><\/h5><ul data-start=\"3796\" data-end=\"3993\"><li data-start=\"3796\" data-end=\"3848\"><p data-start=\"3798\" data-end=\"3848\"><code data-start=\"3798\" data-end=\"3809\">\"forward\"<\/code>\u00a0\u2192 Moves straight ahead at\u00a0<code data-start=\"3836\" data-end=\"3845\">0.2 m\/s<\/code>.<\/p><\/li><li data-start=\"3849\" data-end=\"3883\"><p data-start=\"3851\" data-end=\"3883\"><code data-start=\"3851\" data-end=\"3863\">\"backward\"<\/code>\u00a0\u2192 Moves backward.<\/p><\/li><li data-start=\"3884\" data-end=\"3925\"><p data-start=\"3886\" data-end=\"3925\"><code data-start=\"3886\" data-end=\"3894\">\"left\"<\/code>\u00a0\u2192 Rotates counter-clockwise.<\/p><\/li><li data-start=\"3926\" data-end=\"3960\"><p data-start=\"3928\" data-end=\"3960\"><code data-start=\"3928\" data-end=\"3937\">\"right\"<\/code>\u00a0\u2192 Rotates clockwise.<\/p><\/li><li data-start=\"3961\" data-end=\"3993\"><p data-start=\"3963\" data-end=\"3993\"><code data-start=\"3963\" data-end=\"3971\">\"stop\"<\/code> \u2192 Stops all movement.<\/p><\/li><\/ul><h5 data-start=\"3995\" data-end=\"4010\">P<strong>ublishing<\/strong><\/h5>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-069c428 elementor-widget elementor-widget-code-highlight\" data-id=\"069c428\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-python\">\n\t\t\t\t<code readonly=\"true\" class=\"language-python\">\n\t\t\t\t\t<xmp>self.publisher_.publish(twist)\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-22edadd elementor-widget elementor-widget-text-editor\" data-id=\"22edadd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul data-start=\"4056\" data-end=\"4098\"><li data-start=\"4056\" data-end=\"4098\"><p data-start=\"4058\" data-end=\"4098\">Sends the velocity command to the robot.<\/p><\/li><\/ul><h3 data-start=\"4105\" data-end=\"4134\"><strong>5. Testing the Full System<\/strong><\/h3><p data-start=\"4136\" data-end=\"4164\">Once both nodes are running:<\/p><ol data-start=\"4165\" data-end=\"4433\"><li data-start=\"4165\" data-end=\"4233\"><p data-start=\"4168\" data-end=\"4233\">Start <code data-start=\"4174\" data-end=\"4198\">voice_interaction_node<\/code> to capture and recognize speech.<\/p><\/li><li data-start=\"4234\" data-end=\"4306\"><p data-start=\"4237\" data-end=\"4306\">Start <code data-start=\"4243\" data-end=\"4264\">command_interpreter<\/code> to interpret and act on those commands.<\/p><\/li><li data-start=\"4307\" data-end=\"4433\"><p data-start=\"4310\" data-end=\"4332\">Speak commands like:<\/p><ul data-start=\"4336\" data-end=\"4433\"><li data-start=\"4336\" data-end=\"4370\"><p data-start=\"4338\" data-end=\"4370\">&#8220;Forward&#8221; \u2192 Robot moves ahead.<\/p><\/li><li data-start=\"4374\" data-end=\"4406\"><p data-start=\"4376\" data-end=\"4406\">&#8220;Left&#8221; \u2192 Robot rotates left.<\/p><\/li><li data-start=\"4410\" data-end=\"4433\"><p data-start=\"4412\" data-end=\"4433\">&#8220;Stop&#8221; \u2192 Robot stops.<\/p><\/li><\/ul><\/li><\/ol><h3 data-start=\"4440\" data-end=\"4467\"><strong>6. Possible Improvements<\/strong><\/h3><ul data-start=\"4469\" data-end=\"4819\"><li data-start=\"4469\" data-end=\"4565\"><p data-start=\"4471\" data-end=\"4565\"><strong data-start=\"4471\" data-end=\"4494\">Offline Recognition<\/strong> \u2014 Use Vosk or PocketSphinx to avoid reliance on internet connection.<\/p><\/li><li data-start=\"4566\" data-end=\"4663\"><p data-start=\"4568\" data-end=\"4663\"><strong data-start=\"4568\" data-end=\"4587\">Noise Filtering<\/strong> \u2014 Apply audio preprocessing to improve recognition in noisy environments.<\/p><\/li><li data-start=\"4664\" data-end=\"4735\"><p data-start=\"4666\" data-end=\"4735\"><strong data-start=\"4666\" data-end=\"4692\">Multi-Language Support<\/strong> \u2014 Enable commands in multiple languages.<\/p><\/li><li data-start=\"4736\" data-end=\"4819\"><p data-start=\"4738\" data-end=\"4819\"><strong data-start=\"4738\" data-end=\"4759\">Context Awareness<\/strong> \u2014 Different actions depending on the robot\u2019s current state.<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cfb2d58 elementor-widget elementor-widget-text-editor\" data-id=\"cfb2d58\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"4844\" data-end=\"5000\">By following this tutorial, you\u2019ve created a complete voice interaction system in ROS 2 \u2014 from capturing audio to making a robot move based on what you say.<\/p><p data-start=\"5002\" data-end=\"5245\">Voice control brings an extra layer of intuitiveness to human-robot interaction, making robots more accessible and engaging. This foundation can be expanded into more sophisticated systems, from conversational AI to voice-driven task planning.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-cdc3df8 e-flex e-con-boxed e-con e-parent\" data-id=\"cdc3df8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-f20c218 e-flex e-con-boxed e-con e-parent\" data-id=\"f20c218\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Voice control has become one of the most natural and intuitive ways to interact with robots. From simple voice commands to complex conversational systems, enabling a robot to understand and respond to spoken language opens the door to more human-like and user-friendly experiences. In this tutorial, we will build a Voice Interaction Model in ROS [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3745,"comment_status":"closed","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[45,43],"tags":[116,129,109,284,179,66,285,71,107,72,273,76,283],"class_list":["post-3555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ros-2","category-tutorials","tag-alexa","tag-build","tag-control","tag-interaction","tag-lbd","tag-learn-by-doing","tag-model","tag-ros","tag-ros-2","tag-ros2","tag-smart","tag-step-by-step","tag-voice"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Build a Voice Interaction Model in ROS 2 - Learn by Doing!<\/title>\n<meta name=\"description\" content=\"Build a Voice Interaction Model in ROS 2 to trigger robot actions and add speech recognition for natural human-robot interaction.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnbydoing.dev\/es\/how-to-build-voice-interaction-model-in-ros-2\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Build a Voice Interaction Model in ROS 2\" \/>\n<meta property=\"og:description\" content=\"Learn by Doing!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnbydoing.dev\/es\/how-to-build-voice-interaction-model-in-ros-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn by Doing!\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T14:36:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-10T22:00:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"How to Build a Voice Interaction Model in ROS 2\",\"datePublished\":\"2025-08-10T14:36:30+00:00\",\"dateModified\":\"2026-01-10T22:00:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/\"},\"wordCount\":743,\"publisher\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp\",\"keywords\":[\"alexa\",\"build\",\"control\",\"interaction\",\"lbd\",\"learn by doing\",\"model\",\"ROS\",\"ROS 2\",\"ROS2\",\"smart\",\"step by step\",\"voice\"],\"articleSection\":[\"ROS 2\",\"Tutorials\"],\"inLanguage\":\"es\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/\",\"url\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/\",\"name\":\"How to Build a Voice Interaction Model in ROS 2 - Learn by Doing!\",\"isPartOf\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp\",\"datePublished\":\"2025-08-10T14:36:30+00:00\",\"dateModified\":\"2026-01-10T22:00:56+00:00\",\"description\":\"Build a Voice Interaction Model in ROS 2 to trigger robot actions and add speech recognition for natural human-robot interaction.\",\"breadcrumb\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage\",\"url\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp\",\"contentUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learnbydoing.dev\/es\/learn-by-doing-es\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Build a Voice Interaction Model in ROS 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#website\",\"url\":\"https:\/\/learnbydoing.dev\/es\/\",\"name\":\"Learn by Doing!\",\"description\":\"Learn Robotics the fun way\",\"publisher\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnbydoing.dev\/es\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\",\"name\":\"Learn by Doing!\",\"url\":\"https:\/\/learnbydoing.dev\/es\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png\",\"contentUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png\",\"width\":512,\"height\":512,\"caption\":\"Learn by Doing!\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/antonio-brandi-512166bb\/\"]},{\"@type\":\"Person\",\"@id\":\"\",\"url\":\"https:\/\/learnbydoing.dev\/es\/author\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Build a Voice Interaction Model in ROS 2 - Learn by Doing!","description":"Build a Voice Interaction Model in ROS 2 to trigger robot actions and add speech recognition for natural human-robot interaction.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnbydoing.dev\/es\/how-to-build-voice-interaction-model-in-ros-2\/","og_locale":"es_ES","og_type":"article","og_title":"How to Build a Voice Interaction Model in ROS 2","og_description":"Learn by Doing!","og_url":"https:\/\/learnbydoing.dev\/es\/how-to-build-voice-interaction-model-in-ros-2\/","og_site_name":"Learn by Doing!","article_published_time":"2025-08-10T14:36:30+00:00","article_modified_time":"2026-01-10T22:00:56+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"","Tiempo de lectura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#article","isPartOf":{"@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/"},"author":{"name":"","@id":""},"headline":"How to Build a Voice Interaction Model in ROS 2","datePublished":"2025-08-10T14:36:30+00:00","dateModified":"2026-01-10T22:00:56+00:00","mainEntityOfPage":{"@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/"},"wordCount":743,"publisher":{"@id":"https:\/\/learnbydoing.dev\/es\/#organization"},"image":{"@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage"},"thumbnailUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp","keywords":["alexa","build","control","interaction","lbd","learn by doing","model","ROS","ROS 2","ROS2","smart","step by step","voice"],"articleSection":["ROS 2","Tutorials"],"inLanguage":"es"},{"@type":"WebPage","@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/","url":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/","name":"How to Build a Voice Interaction Model in ROS 2 - Learn by Doing!","isPartOf":{"@id":"https:\/\/learnbydoing.dev\/es\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage"},"image":{"@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage"},"thumbnailUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp","datePublished":"2025-08-10T14:36:30+00:00","dateModified":"2026-01-10T22:00:56+00:00","description":"Build a Voice Interaction Model in ROS 2 to trigger robot actions and add speech recognition for natural human-robot interaction.","breadcrumb":{"@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#primaryimage","url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp","contentUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/08\/Voice-Interaction-Model.webp","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/learnbydoing.dev\/how-to-build-voice-interaction-model-in-ros-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learnbydoing.dev\/es\/learn-by-doing-es\/"},{"@type":"ListItem","position":2,"name":"How to Build a Voice Interaction Model in ROS 2"}]},{"@type":"WebSite","@id":"https:\/\/learnbydoing.dev\/es\/#website","url":"https:\/\/learnbydoing.dev\/es\/","name":"Learn by Doing!","description":"Learn Robotics the fun way","publisher":{"@id":"https:\/\/learnbydoing.dev\/es\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnbydoing.dev\/es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/learnbydoing.dev\/es\/#organization","name":"Learn by Doing!","url":"https:\/\/learnbydoing.dev\/es\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/","url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png","contentUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png","width":512,"height":512,"caption":"Learn by Doing!"},"image":{"@id":"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/antonio-brandi-512166bb\/"]},{"@type":"Person","@id":"","url":"https:\/\/learnbydoing.dev\/es\/author\/"}]}},"_links":{"self":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/3555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/comments?post=3555"}],"version-history":[{"count":21,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/3555\/revisions"}],"predecessor-version":[{"id":5506,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/3555\/revisions\/5506"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/media\/3745"}],"wp:attachment":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/media?parent=3555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/categories?post=3555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/tags?post=3555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}