Robotics StackExchange | Archived questions

"Could not find requested resource in ament index" - When loading component into a container

EDIT: Revised to be more general for others to reference if needed and formating to be skimmable.

Hi all,

I'm relatively new to implementing composition for nodes. So far, all the legacy packages we use internally have been converted without issues. But my latest project won't load after it is compiled. What I've tried so far:

I get the error message:

"Could not find requested resource in ament index"

I'm at a bit of a loss as to why it isn't working.

I have registered the component with the macro in my code. My class is inherited from Node and only accepts the NodeOptions in the constructor.

Any help would be greatly appreciated. Thank you.

Running in osrf/ros:humble-desktop Docker container.

Asked by ngolombek on 2023-06-14 04:23:06 UTC

Comments

Update: I have continued testing. I can run the component in standalone mode, but not load it into a container

Asked by ngolombek on 2023-06-14 13:07:02 UTC

Answers

Ok. So it turns out I didn't correctly understand how the component composition works. For anyone who may encounter a similar issue in the future, the error message was correct. I had loaded two workspaces—one with my component container and a second with the node I was compiling and testing. In order to work with composition, ALL components must be sourced into a single environment before the container is run. I had wanted to package some components in separate Dockers (with proper IPC and network settings) to create greater encapsulation.

TL;DR - Components must be in a single-sourced workspace where the container is run in order to be found by ament.

Asked by ngolombek on 2023-06-14 13:28:50 UTC

Comments