Welcome to DOFBOT-Pi repository
2.AI Encyclopedia-Arithmetic Master
AI Encyclopedia-Arithmetic Master
Before running the function, you need to close the App and large programs. For the closing method, refer to [4. Preparation] - [1. Manage APP control services].
1. Function Description
After the program starts, give the large model an arithmetic problem. After thinking, the large model will reply with the correct answer and find the correct answer on the desktop and control the robotic arm to point to the correct answer. If there is no correct answer on the desktop at this time, the robotic arm will shake its head.
2. Startup
First, log in to the dify management interface. Enter the robotic arm's IP address in the browser and press Enter to log in to the dify management interface. For the first login, you need to enter email and password. The email is yahboom@163.com and the password is yahboom123. After successful login, it will be shown as below:

Then click on the knowledge base and select [决策层训练样例en.xlsx], as shown below:

After entering this [决策层训练样例en.xlsx], click on [决策层训练样例en.xlsx], and the next step is to modify the file content, as shown below:

After opening this xlsx file, you can see the content inside. Click [Add Chunk] on the right side, as shown below:

Then add a scenario for the following content: Let's do an arithmetic problem, tell me what is the result of six multiplied by eleven. You can input the following content:
xxxxxxxxxxquery":"Let's do an arithmetic problem, tell me what is the result of six multiplied by eleven.";"answer":"Execute in strict accordance with the following steps, and only output one action function at a time.1. First reply with the result of the arithmetic problem;2. Find the number on the desktop that matches the result;3. Perform the following operations based on whether there is a number on the desktop that matches the result:- If it exists, call the `point_to(x1, y1, x2, y2)` function to point to the number (where x1, y1, x2, y2 are the relevant coordinate parameters of the number's position);- If it does not exist, call the `arm_shake()` function. "
Modify according to the actual problem and expected output steps. The content in query is the actual problem, and the content in answer is the expected output steps.
After entering the Docker container, enter the following commands in the Docker terminal.
xxxxxxxxxxros2 launch largemodel largemodel_control.launch.py text_chat_mode:=TrueThen open a second terminal and input the following command:
xxxxxxxxxxros2 run text_chat text_chat
Then input arithmetic content in the text_chat terminal, for example, let the large model calculate what 6 multiplied by 11 equals, you can input like this: "Let's do an arithmetic problem, tell me what is the result of eleven multiplied by six", and press Enter; if it's the voice version, wake up the voice module and directly say to the voice module "Let's do an arithmetic problem, tell me what is the result of eleven multiplied by six", then wait for the large model to think and reply, as shown in the figure below:

The robotic arm will point to 66 on the desktop, as shown in the figure below:

Here's a point to note: before asking the question, we need to add Let's do an arithmetic problem, so that the large model will plan the correct steps, otherwise, the large model will directly reply with the result without pointing to the arithmetic result.
3. Task Planning
- Reply with the result of the arithmetic problem;
- Call
seewhat()to observe the environment and check if there is a number 66 on the desktop. - If it exists, call the
point_to(x1, y1, x2, y2)function to point to the number (where x1, y1, x2, y2 are the relevant coordinate parameters of the number's position). - If it does not exist, call the
arm_shake()function.