Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcl/rcl.h: No such file or directory #187

Open
tianrking opened this issue Apr 14, 2023 · 9 comments
Open

rcl/rcl.h: No such file or directory #187

tianrking opened this issue Apr 14, 2023 · 9 comments

Comments

@tianrking
Copy link

https://github.com/tianrking/ESP32_MicroROS

At one time I was able to compile in the old version but the current version gives this error. I'm sure the environment is clean, I've enabled the espidf environment and configured the environment variables, but I can't find rcl rcl.h

[100%] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
/root/ESP32_MicroROS/main/main.c:11:10: fatal error: rcl/rcl.h: No such file or directory
#include <rcl/rcl.h>
^~~~~~~~~~~
compilation terminated.
make[2]: *** [esp-idf/main/CMakeFiles/__idf_main.dir/build.make:76: esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:4839: esp-idf/main/CMakeFiles/__idf_main.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make failed with exit code 2

@pablogs9
Copy link
Member

Could you provide the whole log on an clean environment?

@Digitelektro
Copy link

A ran into the same problem. I figured out the problem (at least in my case).

  • Do not source ROS2 as stated in the readme!
  • If you had tried to build it with ROS2 sourced, make sure you remove the build folder and also run idf.py clean-microros
  • For me building libmicroros is failed with idf-4.2, I installed a fresh idf-4.4.4 and then the required python packages in a terminal where idf is sourced.
  • With the correct idf libmicroros build should be successful as well as the project. If not, check build output for details.

@flabrosse
Copy link
Contributor

Trying to build example/int32_publisher following the instructions in README.md. I have not sourced any of the ROS2 setup files. esp-idf-4.4.6. From a fresh clone, I get:

[ 99%] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
/home/ffl/local/src/micro_ros_espidf_component/examples/int32_publisher/main/main.c:11:10: fatal error: rcl/rcl.h: No such file or directory
 #include <rcl/rcl.h>
          ^~~~~~~~~~~

@flabrosse
Copy link
Contributor

Maybe a hint on what is going on. Trying to make a simple example myself. If I clone today's version of the package (I guess defaulting to iron #d0e63d9), then I get the missing rcl/rcl.h issue. If I build from an older version (from about 2 years ago), then it is fine. Sorry this isn't more precise than that.

@flabrosse
Copy link
Contributor

Trying any of the branches of micro_ros_espidf_component, the whole of micro_ros_src folder is missing, ie is not pulled in by the build process, and therefore rcl.h (and others) is missing. If I use the component here then it all works fine. Apart from the obvious branch differences, I cannot see what makes one fail while the other works. It looks like the target $(EXTENSIONS_DIR)/micro_ros_src/src in libmicroros.mk is not executed, but so far I have not been able to figure out why.

@flabrosse
Copy link
Contributor

The reason the micro-ros-src (and other) folder is not pulled in is because the execute_process function in the CMakeLists.txt file fails. It fails because submake expands to $(MAKE) on Unix which either is not expanded further or not defined. If I set submake to make (or replace ${submake} with make in the execute_process command, then all the necessary files are pulled in.

I am not entirely sure why this is the case, but this works. Should MAKE be an environment variable? Can't submake be set to make all the time?

@flabrosse
Copy link
Contributor

@pablogs9 would you have views on this? I am happy to prepare a PR but I am not sure that just setting submake to make in all cases is the right approach.

I have tried to set MAKE in my environment, or to call idf.py build -DMAKE=make, to no avail.

@pablogs9
Copy link
Member

Please open a PR so we can discuss there about your proposed changes

@flabrosse
Copy link
Contributor

Done (PR #223). I have worked on the humble branch as this is the one I use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants