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

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

asked 2023-06-14 04:23:06 -0500

ngolombek gravatar image

updated 2023-06-14 13:39:38 -0500

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:

  • ros2 run <package> <component_executable> ... - Works
  • ros2 component types | grep <package> - Component is in output
  • ros2 component standalone <package> <component::plugin> - Works
  • ros2 component load <container> <package> <component::plugin> - DOES NOT WORK

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.

edit retag flag offensive close merge delete

Comments

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

ngolombek gravatar image ngolombek  ( 2023-06-14 13:07:02 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2023-06-14 13:28:50 -0500

ngolombek gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-14 04:23:06 -0500

Seen: 833 times

Last updated: Jun 14 '23