Welcome to MicroROS V2 Robot Car repository
1. Set Up the ESP32-IDF Development Environment
Setting Up the ESP32-IDF Development Environment
Setting Up the ESP32-IDF Development Environment1. ESP32 Development Environment Introduction2. Installing Dependencies3. Downloading ESP-IDF4. Activating the ESP-IDF Development Environment5. Compiling and Flashing the Firmware6. Quick Commands7. ESP-IDF API Reference
Note: The out-of-the-box virtual machine already includes the environment, so there is no need to download it again.
1. ESP32 Development Environment Introduction
The ESP32 development environment supports Windows, Linux, and Mac platforms.
On the Linux and Mac platforms, you need to download and install the ESP-IDF development environment from source.
On the Windows platform, there are multiple development environment options available, including the official ESP-IDF environment, development environments based on the Arduino IDE, and development approaches using VS Code + PlatformIO IDE, etc.
Here, we take the approach of downloading and installing the ESP-IDF development environment from source on an Ubuntu system as an example.
2. Installing Dependencies
Open an Ubuntu system terminal and run the following command to install the required dependencies.
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
3. Downloading ESP-IDF
Note: The out-of-the-box virtual machine already includes the environment, so there is no need to download it again.
Open an Ubuntu system terminal and run the following command to download esp-idf version v5.1.2.
xxxxxxxxxxmkdir -p ~/espcd ~/espgit clone -b v5.1.2 --recursive https://github.com/espressif/esp-idf.git
Set the chip supported by the tools to esp32s3.
xxxxxxxxxxcd esp-idf./install.sh esp32s3
4. Activating the ESP-IDF Development Environment
Run the following command in the esp-idf tools directory.
xxxxxxxxxxsource ~/esp/esp-idf/export.sh
Note: Every time you open a new terminal, you must first activate the ESP-IDF development environment before you can compile ESP-IDF projects.

5. Compiling and Flashing the Firmware
Connect the microROS control board to the virtual machine/computer, and then test compiling the hello_world program to generate the firmware.
xxxxxxxxxxcd examples/get-started/hello_worldidf.py set-target esp32s3idf.py build
When you see the following prompt, it means the compilation succeeded.

View the generated firmware.
xxxxxxxxxxls build/*.binls build/bootloader/*.binls build/partition_table/*.bin

Run the following command to flash the generated firmware to the microROS control board.
xxxxxxxxxxidf.py flash
Before flashing with this command, you need to confirm that the computer is connected to only one serial device. If multiple serial devices are connected, you can manually specify the serial port number to distinguish them. For example, specify the serial port for flashing as /dev/ttyUSB0.
xxxxxxxxxxidf.py flash -p /dev/ttyUSB0
When the download progress reaches 100% and "Done" is displayed, the flashing is complete.

Open the serial monitor.
xxxxxxxxxxidf.py monitor
To exit the serial monitor, press Ctrl+] .
6. Quick Commands
If you need to compile, flash, and open the serial monitor, enter the following command.
xxxxxxxxxxidf.py build flash monitor
7. ESP-IDF API Reference
Open the following link to view the official ESP32S3 API reference.
xxxxxxxxxxhttps://docs.espressif.com/projects/esp-idf/en/v5.1.2/esp32s3/api-reference/index.html
If you need to display Chinese, you can click 【中文】 to go to the Chinese version.
