(Solved) Help compiling MicroROS esp component (Humble or Iron)
Hi all,
I am trying to compile https://github.com/micro-ROS/micro_ros_espidf_component.git
Following the instructions in the readme, I get the following error
/opt/microros/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>
I have seen this error before but there is a chicken / egg issue with the include directories in microrossrc and the combined include dir in ${EXTENSIONS_DIR}/include.
If I add in all the requisite INCLUDE directories in the main/CMakeLists.txt, I can eliminate errors until I get the error about the missing .h file configuration_flags.h because I am using the mircorossrc as the top of my include path vs the include directory in the EXTENSIONS_DIR because that directory is not available until after a successful compile and only the .h.in files exists in the rcutils include dir.
I am using IDF version 4.4
Any idea what I may be doing wrong ?
Asked by gentijo on 2023-08-02 16:36:39 UTC
Answers
My docker definition was mostly the same as the Docker definition in the esp_idf_component repo.
The one difference is that I originated my image
from ubuntu:22.04 and manually installed idf 4.4 from the gitrepo vs espressif/idf:release-v4.4 which is based on focal.
The idf-release version compiles fine, but when based off of 22.04, it fails. It seems to be a CMake error, maybe different versions, as the MicroROS component runs cmake just fine, but it never adds the build dependency for libmicroros.a and that lib never gets compiled on build. This is true trying to build an example or my code using the repo in my component dir.
Asked by gentijo on 2023-08-03 16:56:54 UTC
Comments
On a related topic, I tried dropping the micros_ros_espidf into my component directory. When I do that, the cmake process will run but it does not add a target for libmicroros.a.
I think this is around the change from Galactic where the CMakeLists.txt file used external_project_add cmake macro to call colcon for the build process to now use the external_process command cmake macro
I swapped out the external_process command for the older external_project_add and now make is running to build the target but the make process is filled with errors.
Asked by gentijo on 2023-08-04 15:07:22 UTC