Skip to main content

AIUI Configuration FAQ

Table of Contents

一、Adding Personalized Responses

二、Adding Custom Cases

三、Making Configuration Files Effective

四、Possible Issues and Troubleshooting Solutions

Adding Personalized Responses

  • Configuration File Path

    • /home/lemon/robot_ros_application/catkin_ws/src/ros_AIUI_node/config/VoiceControlConfig.json
  • Basic Format of the Configuration File

    • Strictly adhere to the JSON format when making modifications.
    • 配置文件基本格式
  • The logic for code to call the configuration is as follows:

    • Skill Name:

      • A unique identifier for the skill that distinguishes it from other skills. There is no fixed format.
    • Key Words:

      • The keywords that trigger the skill. You can list multiple keywords.
      • When a recognized statement exactly matches one of these keywords, the corresponding content in the FAQ will be triggered.
      • For example, if the keyword is "turn left," saying "turn left" can control the robot to move to the left.
    • Reply

      • When a keyword is recognized, the response defined in "reply" will be used to reply.
    • Cmd Type:

      • The type of skill.
      • "execute_func" indicates executing a function.
      • "run_node" represents running a case.
      • "stop_node" represents stopping a case.
    • execute_func:

      • Only needs to be defined when cmd_type is "execute_func".
      • The name of the function to be executed, with the function definition located in /home/lemon/robot_ros_application/catkin_ws/src/ros_AIUI_node/scripts/execute_funcs.py.
    • path:

      • Only needs to be defined when cmd_type is "run_node".
      • The path for the case execution. You can create custom actions using the desktop software and download them to the robot. The download path is usually under /home/lemon/robot_ros_application/catkin_ws/src/ros_actions_node/scripts/. Add the file path to this item.

Adding Custom Cases

  • When the cmd_type of a skill in the configuration file is "run_node," it indicates running a case. For example, the configuration for running a hand-raising case:

    • 配置文件基本格式
    • You can trigger the hand-raising case by saying "raise hand" or "raise your hand."
  • Creating a Case

    • Using Roban Software to Edit Actions and Download to the Robot
  • Steps for Action Design in Roban Software:

    • Create a new project file. It is recommended to create a separate project file for each action. When downloaded to the robot, a Python file named after the project file will be generated in the specified directory.
      • 新建工程文件
    • Choose the position to insert a frame, right-click to add a keyframe, and select the whole body.
      • 插入关键帧
    • Click on the robot model on the right side of the software interface, select the robot joint part you want to control, choose the servo you want to control, drag the timeline or enter the encoder value, and the corresponding servo on the robot will rotate.
    • Click the confirmation button, and the action for the current frame will be inserted into the action frame position. Note that the unit of the action frame timeline is 1f = 10ms.
      • 插入关键帧
    • Insert multiple keyframes between the start and end frames following the same steps
    • Click "Generate Module" to encapsulate the action frame content in a modular form.
      • 生成自定义动作
    • Place the generated action module inside the start program and click "Download."
      • 下载动作
  • The file will be downloaded to /home/lemon/robot_ros_application/catkin_ws/src/ros_actions_node/scripts/ as a Python file named after the project file.

Making Configuration Files Effective

  • The configuration file is read when the program is running, so you need to restart the program after modifying the configuration file.

  • Restarting the Program:

    • Method 1:
      • Reboot the robot.
    • Method 2:
      • Use remote software like VSCode or mobaXterm, or connect the robot to a monitor, open a new terminal, and run the following commands:
        $ sudo killall roslaunch # If prompted for a password, enter softdev
        $ cd & ./start.sh

Possible Issues and Troubleshooting Solutions

  • Error Message: ValueError: <string>:** Unexpected ** at column *

    • This usually indicates a formatting error in the configuration file, such as extra or missing punctuation marks. The number before "Unexpected" represents the line number. Check that line or the adjacent lines in the configuration file for punctuation or character errors.
  • No Response or Abnormal Operation After Restarting

    • If you used the second method to make the changes effective, it is recommended to reboot the robot and try again.
    • If you used the first method, connect a monitor and check the terminal of start.sh during startup to see if there are any error messages. If there are, provide the error information to the engineer.