micro_ros_espidf_component icon indicating copy to clipboard operation
micro_ros_espidf_component copied to clipboard

rcl/rcl.h: No such file or directory

Open rahgirrafi opened this issue 3 months ago • 12 comments

  • Version or commit hash: humble

Steps to reproduce the issue

idf.py build

Expected behavior

A complete build

Actual behavior

/home/rahgirrafi/esp/vaccumbot_firmware/components/examples/int32_publisher/main/main.c:11:10: fatal error: rcl/rcl.h: No such file or directory 11 | #include <rcl/rcl.h> | ^~~~~~~~~~~

Additional information

rahgirrafi avatar Nov 06 '25 17:11 rahgirrafi

I worked around it by writing my project inside the example directory. The projects are building perfectly from there. I assume it has something to do with the CMake.

rahgirrafi avatar Nov 06 '25 20:11 rahgirrafi

Facing the same problem! I'm attempting to prebuild the component once and use it instead of building it everytime I idf.py fullclean it.

mohankaushik97 avatar Nov 07 '25 04:11 mohankaushik97

@rahgirrafi can you please elaborate on how you exactly where able to work around this issue? I'm also getting fatal error: rcl/rcl.h: No such file or directory 11 message. When running the example as shown in the readme.

RickerStem avatar Nov 17 '25 21:11 RickerStem

@RickerStem I created my project inside the example directory of this repository (along with other example projects) and I didn't face the problem anymore.

I noticed that example projects provided by this component weren't failing to build. So, Instead of adding this repo to my project's component directory, I cloned this repo first, then created my project in the same directory where the other example projects (int32_publisher, int32_subscdiber etc.) are provided. Then everything worked fine.

rahgirrafi avatar Nov 17 '25 21:11 rahgirrafi

@rahgirrafi thank you for your quick response, I will try this in the coming days!

RickerStem avatar Nov 18 '25 08:11 RickerStem

  • Version or commit hash: humble

Steps to reproduce the issue

idf.py build

Expected behavior

A complete build

Actual behavior

/home/rahgirrafi/esp/vaccumbot_firmware/components/examples/int32_publisher/main/main.c:11:10: fatal error: rcl/rcl.h: No such file or directory 11 | #include <rcl/rcl.h> | ^~~~~~~~~~~

Additional information

check ESP-IDF 4.4.5 version and tap

idf.py fullclean idf.py reconfigure idf.py build

Waelhechmi avatar Nov 19 '25 10:11 Waelhechmi

I tried again but was not able to build as @rahgirrafi suggested.

I noticed that example projects provided by this component weren't failing to build.

For me they are failing?

@Waelhechmi I tried as you suggested docker pull espressif/idf:v4.4.5 then docker run and pull this repo inside the container. but still the same issue.

Any suggestions, or examples?

RickerStem avatar Nov 27 '25 23:11 RickerStem

@RickerStem . Try replacing the CMakeLists.txt file with these codes.

`file(GLOB_RECURSE SRC_FILES "${CMAKE_CURRENT_LIST_DIR}/.c" "${CMAKE_CURRENT_LIST_DIR}/.cpp")

idf_component_register(SRCS ${SRC_FILES} INCLUDE_DIRS "include")`

rahgirrafi avatar Nov 28 '25 03:11 rahgirrafi

@rahgirrafi Thank you for the suggestion, didn't get it to work.

RickerStem avatar Dec 04 '25 14:12 RickerStem

@rahgirrafi Thank you for the suggestion, didn't get it to work.

Sorry to hear that.

I can offer to arrange a meeting to take a look into your project structure (If you are okay with it). I would like to see why it isn't working with you. I have used this method to solve this issue on multiple devices.

If I can identify the issue, I can try to find a solution and close this issue.

rahgirrafi avatar Dec 04 '25 14:12 rahgirrafi

Found a (cumbersome) way to build the example/int32_publisher from this repo.

Note: I'm using a Ubuntu 24.04.03 LTS, VM on Win11.

  • Installed ESP-IDF v5.2.5 (Espressif guide)
  • . $HOME/esp/esp-idf/export.sh
  • pip3 install catkin_pkg lark-parser colcon-common-extensions
  • git clone -b jazzy https://github.com/micro-ROS/micro_ros_espidf_component.git
  • cd /micro_ros_espidf_component/examples/int32_publisher
  • idf.py set-target esp32
  • idf.py menuconfig
  • idf.py flash

RickerStem avatar Dec 04 '25 14:12 RickerStem

@rahgirrafi Thank you for the suggestion, didn't get it to work.

Sorry to hear that.

I can offer to arrange a meeting to take a look into your project structure (If you are okay with it). I would like to see why it isn't working with you. I have used this method to solve this issue on multiple devices.

If I can identify the issue, I can try to find a solution and close this issue.

That's very kind of you! Maybe we can arrange something later. I think it's on me, I'm not an expert on CMake and ESP-IDF. But I was expecting the example and docker example to work.

RickerStem avatar Dec 04 '25 14:12 RickerStem