Welcome to DOFBOT-Ultra repository
4. Memory Learning Mode
Memory Learning Mode
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
1. Operation Instructions
1.1. Startup
Before running the function, you need to shut down the web control program backend process. For the shutdown method, please refer to the [4. Preparation - 1. Manage Web control services].
Raspberry Pi version (in Docker environment), enter the following command:
python3 /home/yahboom/dofbot_ultra/2d/dofbot_voice/scripts/learning_model.pyRDK X5 version (native environment), enter the following command:
xxxxxxxxxxpython3 /home/sunrise/dofbot_ultra_ws/src/2d/dofbot_voice/scripts/learning_model.py1.2. Command Words
Then say "Hello, yahboom" to the voice module. The voice module will reply "here" to indicate successful wake-up.
1.2.1 Learn Action
Move the robotic arm to the desired position, then say "Record it" to the voice module. If fewer than 20 action groups have been entered, the voice module will reply "ok". If 20 action groups have already been entered, the voice module will reply "Too many actions, I Can't record them". If you want to end input, say "Over" to the voice module, and the voice module will reply "ok".
1.2.2 Executing Actions
Say "Display actions" to the voice module. The voice module will reply "ok", and the robotic arm will sequentially move to the previously learned positions.
1.2.3 Clearing Actions
Say "Clear actions" to the voice module. The voice module will reply "ok", and then you can proceed with the next learning session.
2. Code Logic
This case calls the robotic arm's action group library, implementing a "learn-run-clear" workflow.
When learning, it first checks if the number of already learned action groups is less than 20. If so, it calls Arm_Action_Study() to learn the current pose. When running, it calls Arm_Action_Mode(1) to execute all learned action groups in sequence. When clearing, it calls Arm_Clear_Action() to delete all learned data.
3. Source Code
Raspberry Pi: /home/yahboom/dofbot_ultra/2d/dofbot_voice/scripts/learning_model.py
RDK X5: /home/sunrise/dofbot_ultra_ws/src/2d/dofbot_voice/scripts/learning_model.py
xxxxxxxxxxresult = mySpeech.speech_read()if result == 55: time.sleep(.1) Arm.Arm_Action_Study() time.sleep(.5) num = Arm.Arm_Read_Action_Num() if num < 20: mySpeech.void_write(55) elif num >= 20: mySpeech.void_write(56)elif result == 56: mySpeech.void_write(57) Arm.Arm_Button_Mode(0)elif result == 57: mySpeech.void_write(58) Arm.Arm_Action_Mode(1)elif result == 58: mySpeech.void_write(59) Arm.Arm_Clear_Action()Arm_Action_Study()- Learn the current robotic arm pose into action groupsArm_Read_Action_Num()- Read the number of currently learned action groupsArm_Action_Mode(1)- Run all learned action groups in sequence modeArm_Clear_Action()- Clear all learned action groupsArm_Button_Mode(0)- Turn off button interrupt mode