Open liamhan0905 opened 1 year ago
You can run your idf.py build
directly into the example folder since it is prepared to find the micro-ROS component two folders above.
Copying the micro-ROS module into the components
folder is the way for integrating it into your own IDF project because it is the default way of doing it: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#example-project
If I run idf.py build
directly into the example folder under micro_ros_espidf_component
, I get the following error.
ubuntu@ubuntu:~/micro_ros_espidf_component/examples/int32_publisher$ get_idf
Setting IDF_PATH to '/home/ubuntu/esp/esp-idf'
Detecting the Python interpreter
Checking "python3" ...
Python 3.8.10
"python3" has been detected
Checking Python compatibility
Checking other ESP-IDF version.
Using a supported version of tool cmake found in PATH: 3.16.3.
However the recommended version is 3.24.0.
Adding ESP-IDF tools to PATH...
Using a supported version of tool cmake found in PATH: 3.16.3.
However the recommended version is 3.24.0.
Checking if Python packages are up to date...
Constraint file: /home/ubuntu/.espressif/espidf.constraints.v5.0.txt
Requirement files:
- /home/ubuntu/esp/esp-idf/tools/requirements/requirements.core.txt
Python being checked: /home/ubuntu/.espressif/python_env/idf5.0_py3.8_env/bin/python
Python requirements are satisfied.
Added the following directories to PATH:
/home/ubuntu/esp/esp-idf/components/esptool_py/esptool
/home/ubuntu/esp/esp-idf/components/espcoredump
/home/ubuntu/esp/esp-idf/components/partition_table
/home/ubuntu/esp/esp-idf/components/app_update
/home/ubuntu/.espressif/tools/xtensa-esp-elf-gdb/11.2_20220823/xtensa-esp-elf-gdb/bin
/home/ubuntu/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin
/home/ubuntu/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin
/home/ubuntu/.espressif/tools/openocd-esp32/v0.11.0-esp32-20221026/openocd-esp32/bin
/home/ubuntu/.espressif/python_env/idf5.0_py3.8_env/bin
/home/ubuntu/esp/esp-idf/tools
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
//////////////////////////////////////////////ERROR BELOW//////////////////////////////////////////////
ubuntu@ubuntu:~/micro_ros_espidf_component/examples/int32_publisher$ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/ubuntu/micro_ros_espidf_component/examples/int32_publisher/build
Executing "ninja all"...
ninja: error: '/home/ubuntu/micro_ros_espidf_component/libmicroros.a', needed by 'int32_publisher.elf', missing and no known rule to make it
ninja failed with exit code 1, output of the command is in the /home/ubuntu/micro_ros_espidf_component/examples/int32_publisher/build/log/idf_py_stderr_output_700773 and /home/ubuntu/micro_ros_espidf_component/examples/int32_publisher/build/log/idf_py_stdout_output_700773
[0/2] Re-checking globbed directories...ubuntu@ubuntu:~/micro_ros_espidf_component/examples/int32_publisher$
Also is it possible to use Raspberry Pi 4 as the host and esp32 as the client? Everything worked well if I used my desktop but running into errors if I use Raspberry Pi 4. when I run create_firmware command,
ubuntu@ubuntu:~/uros_ws$ ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32
I get the following error.
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
ERROR: tool xtensa-esp32-elf does not have versions compatible with platform linux-arm64
[ros2run]: Process exited with failure 1
Regarding the first error, have you installed the required dependencies https://github.com/micro-ROS/micro_ros_espidf_component#dependencies ?
Regarding
Installing ESP-IDF tools Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32 ERROR: tool xtensa-esp32-elf does not have versions compatible with platform linux-arm64 [ros2run]: Process exited with failure 1
It is not related to micro-ROS
Regarding the first error, have you installed the required dependencies https://github.com/micro-ROS/micro_ros_espidf_component#dependencies ? Yes, all the dependencies is installed Seems like others are also getting the same error
ninja: error: '/home/ubuntu/micro_ros_espidf_component/libmicroros.a', needed by 'int32_publisher.elf', missing and no known rule to make it ninja failed with exit code 1, output of the command is in the /home/ubuntu/micro_ros_espidf_component/examples/int32_publisher/build/log/idf_py_stderr_output_700773 and /home/ubuntu/micro_ros_espidf_component/examples/int32_publisher/build/log/idf_py_stdout_output_700773 [0/2] Re-checking globbed directories...ubuntu@ubuntu:~/micro_ros_espidf_component/examples/int32_publisher$
I followed the build and then ran `ros2 run micro_ros_setup component esp_idf` from the `uros_ws` directory. Tree shown below. And then tried building the `int32_publisher` example.
ubuntu@ubuntu:~/uros_ws$ tree -d -L 1 . ├── build ├── install ├── log ├── micro_ros_espidf_component └── src
So it is possible to use raspberry pi 4 with esp32?
In relation to this i got the same error, when building the esp-idf tools on Raspberry PI 5 running Ubuntu 24.04.
I tried to build it following this installation tutorial from espressif, and it worked!
Then, to make it work using the ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32
command, i edited the file create.sh.
Commenting line 14. 23 and 25 and adding ./esp-idf/install.sh
to this:
# python3 esp-idf/tools/idf_tools.py install
./esp-idf/install.sh
echo "Installing ESP-IDF virtualenv"
dpkg -s python3-pip > /dev/null
if [[ $? -ne 0 ]]; then
echo "Error: python3-pip package must be installed before continuing..."
exit 1
fi
pip3 install virtualenv --break-system-packages
# python3 esp-idf/tools/idf_tools.py install-python-env
# eval $(python3 $FW_TARGETDIR/toolchain/esp-idf/tools/idf_tools.py export --prefer-system)
This worked for me.
Issue template
Hardware description:
RTOS: freertos on esp32
Installation type: tried
micro_ros_setup
but got error (mentioned below). Tried installing ESP-IDF directly and then using micro-ROS component for ESP-IDF. (More errors mentioned below)Version or commit hash:
humble
on Rapsberry PiDescription
I first tried installing
micro_ros_setup
. The build process was okay but when creating micro-ROS firmware by running the following command,I get the following error
It seems like
micro_ros_setup
is not compatible with raspberry pi 4.So instead, I installed the ESP-IDF following this link. I was able to flash the
hello_world
example. The version I installed was v5.0 since it states thatmicro-ROS component has been tested in ESP-IDF v4.3, v4.4, and v5.0 with ESP32
shown here.I wanted to ask
micro_ros_setup
work for raspberry pi 4? Or is it not compatible for linux-arm64?I think the
Example
section can be elaborated. In the example shown here, why isn'tcomponents
directory created under theint32_publisher
directory? Under theUsage
section, it states to clone the repo directly in the components folder. Please correct me if I'm wrong.I copied the
int32_publisher
example from themicro_ros_espidf_component
(link) into the home directory, created a components directory insteadint32_publisher
directory and then git clonedmicro_ros_espidf_component
inside it.Running
idf.py build
command inside theint32_publisher
directory, generates the error belowI googled this error but didn't get anything helpful.