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

esp32 microros Component Linker Error

asked 2022-08-28 15:55:36 -0500

gentijo gravatar image

updated 2022-08-28 15:56:27 -0500

Hi,

I think this is a ROS related build issue, but it may also be cmake / idf.py related. Not sure where to jump in to diagnose this.

I am attempting to break my microros project into components, so that I can build various implementations using common code. It all compiles well but when linking, one of my components, "microros_app", the linker throws errors saying it can't find any of the RCL or RCLC functions. My initial thought was this is a C++ name mangling thing but I also noticed that my microros_app could not find references to my I2Cdev component either.

Another clue / problem, in this project if I do a fullclean/clean, then build the project, as it tries to reconfigure the project, it will fail. The failure is that if can't find the ros library functions. I determined the source of the problem is that the reconfigure script is trying to reconfigure my components before it downloads the micro_ros_src directory then copies the root include directory from the ROS source. Any component that depends on the ros include directory fail because the include directory does not exist yet.

I work around this problem by moving my microros_app component to another directory, perform a build which will fail because the component is missing. After that I copy my microros_app component back, re-run reconfigure, this time it will succeed because the microros include directory has been copied.

My primary problem is the linker error

Here is a link to my microros app. https://github.com/gentijo/MaqueenBat...

  • the maqueen-esp32-obn1 directory is my microros app I am trying to build.
  • the common_component directory is where I am establishing my components.
  • the maqueen-esp32 is an older C based project that works and what I am using as a stating point for maqueen-esp32-obn1

Here is a link to the gist of the output where it fails on linking and can't find the rcl functions. https://gist.github.com/gentijo/e0793...

Here is a link to the gist where compile fails after a clean when a component depends on rcl functions defined in the root include directory. https://gist.github.com/gentijo/1de46...

Any suggestions on where to dive in would be helpful Thank you -John

edit retag flag offensive close merge delete

Comments

I created a new GIST that has the output of the linker command where I put each library on its own line to make it easier to read. I also dumped the symbols from the I2Cdev.a and the libmicroros_ws.a to show that the missing symbols are there.

https://gist.github.com/gentijo/81ec7...

gentijo gravatar image gentijo  ( 2022-08-28 20:09:38 -0500 )edit

In the gist https://gist.github.com/gentijo/81ec7... the 3 libs in question are included in the linker statement /opt/microros_ws/libmicroros.a esp-idf/I2Cdev/libI2Cdev.a esp-idf/microros_app/libmicroros_app.a

but they also seem to be on the other side of a break in the command line options, does that make a difference ?

I also see /opt/microros_ws/libmicroros.a and esp-idf/microros_ws/libmicroros_ws.a included, what's the difference. The second lib does not have an rcl_ functions.

gentijo gravatar image gentijo  ( 2022-08-28 20:22:18 -0500 )edit

If I move all the component source files to the main project directory, it compiles and links.

gentijo gravatar image gentijo  ( 2022-08-28 21:45:35 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-10-16 12:35:02 -0500

gentijo gravatar image

updated 2022-12-04 12:15:30 -0500

Following up here, there was already a similar ticket so I just added my context to the issue. https://github.com/micro-ROS/micro_ro...

Update 12/4/22, I think this may have something to do about this subject where the ROS build system has taken over the CMakeLists.txt meant for the Components. https://answers.ros.org/question/4096...

edit flag offensive delete link more
0

answered 2022-09-05 00:45:20 -0500

Pablogs gravatar image

Please open an issue on the GitHub repo so we can track this issue.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-28 15:55:36 -0500

Seen: 212 times

Last updated: Dec 04 '22