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

ROS2 design - resource directory

asked 2021-09-17 09:07:05 -0500

definitive gravatar image

I am curious about the importance of the resource folder in the package branch. In most cases package consist empty file called same as package name in resource directory. But for example here and here it has some specific files. Is there any documentation about it? I couldn't find any information, usually resource is just skipped. I would like to know the usefulness of this part package design.

edit retag flag offensive close merge delete

Comments

I'am interested in the answer as well, we can see that it is present in the trivial workspace example from the ROS2 Tutorial package but without further information.

And the function ros2 package create automaticaly generate a ressource folder as well as create an "installation setup" for that file even though it is empty.

 data_files=[
 ('share/ament_index/resource_index/packages',
         ['resource/' + package_name]),
 ('share/' + package_name, ['package.xml']),],

And if I try to remove those lines, I get :

[1.114s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'XXX' doesn't explicitly install a marker in the package index (colcon-ros currently does it implicitly but that fallback will be removed in the future)
Luczia gravatar image Luczia  ( 2022-01-09 08:11:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-09 08:35:38 -0500

Luczia gravatar image

There's a partial answer here and some discussions about it in ament git

From my understanding : In order to detect that a package is installed, ROS2 needs to install a marker file. Similar to installing the packages manifest in ROS 1.

So I guess if that marker file didn't exist in the share folder, the ros environment couldn't find the package and we couldn't call the ros2 launch XXX or ros2 run XXX. And it seems that the only way to generate that empty markfile at compile/deployment is to create it in src folder then transfer it to the share folder.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-09-17 09:07:05 -0500

Seen: 2,318 times

Last updated: Jan 09 '22