ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

(Solved) Help compiling MicroROS esp component (Humble or Iron)

asked 2023-08-02 16:36:39 -0500

gentijo gravatar image

updated 2023-08-04 14:57:07 -0500

Hi all,

I am trying to compile https://github.com/micro-ROS/micro_ro...

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 micro_ros_src 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 mirco_ros_src 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 ?

edit retag flag offensive close merge delete

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.

gentijo gravatar image gentijo  ( 2023-08-04 15:07:22 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-08-03 16:56:54 -0500

gentijo gravatar image

updated 2023-08-04 15:12:41 -0500

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-08-02 16:36:39 -0500

Seen: 224 times

Last updated: Aug 04 '23