RoArm-M1 Tutorial II: Secondary Development Tutorial
From Waveshare Wiki
RoArm-M1 Tutorial Directory
- RoArm-M1 Tutorial I: How To Use
- RoArm-M1 Tutorial II: Secondary Development Tutorial
- RoArm-M1 Tutorial III: VMware ROS2 Getting Started Tutorial
- RoArm-M1 Tutorial IV: URDF Model Tutorial
- RoArm-M1 Tutorial V: ROS2 Serial Communication Node
- RoArm-M1 Tutorial VI: How to assemble RoArm-M1
- RoArm-M1 Tutorial VII: Assembly Graphics Tutorial
- RoArm-M1 Tutorial VIII: Use of rqt in ROS2
- RoArm-M1 Tutorial IV: URDF Model Tutorial
- RoArm-M1 Main Page
RoArm-M1 Secondary Development Based On ESP32
- This tutorial is for learning how to upload the demo to RoArm-M1. As the demo of RoArm-M1 is open source, users can do the secondary development of the demo.
RoArm-M1 Second Development Tutorial
ESP32 Flash Download Tool
We provide an ESP32 download tool for RoArm-M1, using this tool, users can quickly restore the product to the factory demo.
- Click here to download ESP32 Flash Download Tool. Once downloaded, extract the files and double-click on the "flash_download_tool_3.9.5.exe" program. After opening, two windows will appear. The UI interface of the download tool is the one you need to operate, while the other window serves as a terminal to display the working status of the download tool.
- In the "DOWNLOAD TOOL MODE" interface, select Chip Type as ESP32 and WorkMode as Factory. When using Factory to call the binary file, it will use a relative path, eliminating the need for users to manually input the binary file path. After making these selections, click OK.
- In this software interface, keep the "LockSettings" option checked. On the right side, you can simultaneously upload demos to 8 RoArm-M1 demos. Next, connect the RoArm-M1 to the computer using a USB cable. Click on "COM" and select the newly appeared COM port (in my case, it's COM3). BAUD is used to set the download speed, higher values result in faster speeds, with the ESP32 supporting speeds up to 921600.
- After selecting, click START to begin uploading the demo. Once the upload is complete, "IDLE" will change to "FINISH". After completing this process, you can disconnect the USB connection between the servo driver board and the computer. Then, connect the servos to the servo driver board, provide power to the robotic arm, and start controlling the RoArm-M1 robotic arm.
Install Arduino IDE
-
Download the latest Arduino IDE 2.1.0 package from Arduino website. The official IDE supports different operating systems, just download it according to your operating system. The one I downloaded here is for Windows. (If you have already installed it, just skip to the second step) The installation process is very simple, just keep clicking next step.
Note: It will prompt you to install the driver during installation, you can click to install.
Install ESP32 Plug-in In Arduino IDE
-
Open Arduino IDE, click the File on the left corner and choose "Preferences".
-
Add the following link in the additional development board manager URL, then click OK.
https://dl.espressif.com/dl/package_esp32_index.json
Note: If you need to add more than one development board URL, it is not necessary to delete the URL of the ESP32 development board support, you can directly add the other URL to another line, the default display is comma separated URL. For example, if you need to add the URL of the ESP8266 development board, add it directly to another line, it will be displayed as follows:
https://dl.espressif.com/dl/package_esp32_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json
-
Download the package, and copy the unzipped packages files to the following path:
C:\Users\username\AppData\Local\Arduino15
Install Dependency
- Download libraries, unzip, and open the default installation position of Arduino: C:\Users\username\AppData\Local\Arduino15\libraries (please refer to your actual position), and copy these files to libraries.
- Download serial bus servo library, unzip it, and copy the SCServo file folder to \Documents\Arduino\libraries file folder to install the servo library.
Upload Demo
-
Download RoArm-M1 demo, double-click RoArm-M1-ESP32\RoArm-M1-ESP32.ino.
-
Click Tools -> Port, and remember the existing COM, you don't need to click this COM (the COM displayed by different computers is different, remember the existing COM on your computer).
-
Connect the driver board and the computer with the USB cable, click Tools -> Port, and then click the new COM.
-
Click Tool -> Development Board -> ESP32 Arduino -> ESP32 Dev Module.
-
Click Tool, other settings as shown below (Partition Scheme is recommended to use Huge APP, PSRAM must be "Enabled".):
- After setting, click "Upload" to upload the demo to the device.
- If you encounter problems during the period and need to reinstall or change the Arduino IDE version, you need to uninstall the Arduino IDE after uninstalling the software. Then, you need to manually delete all the contents of the folder C:\Users\[name]\AppData\Local\Arduino15 (Need to display hidden files to see) and then reinstall.