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

Issues Building ROS2: Dashing Python Package

asked 2019-09-06 10:49:34 -0500

SouLeo gravatar image


I've tried following this tutorial page ( to build my own python package for ROS2 Dashing on Ubuntu 18.04 (bionic), but I'm running into issues.

Here is a link to my package: It includes my setup.cfg,, and package.xml.

My issue is that, even though I can build successfully with

colcon build --symlink-install

after sourcing with

source ~/ws/install/setup.bash

I can't run

ros2 run temoto_parser srl_test

Instead I get an error:

Package 'temoto_parser' not found

Any help at all would be greatly appreciated. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-09-06 11:03:20 -0500

sloretz gravatar image

updated 2019-09-06 11:03:56 -0500

I think ros2 run uses the ament index to find packages, and it looks like the package temoto_parser isn't installing a marker file.

Create a folder called resource/ (this folder name doesn't really matter, it's just what's been used so far) in the same directory as your file. Next, create an empty file with the same name as your package in that folder: resource/temoto_parser. In your use the data_files keyword argument to install the marker file temoto_parser to share/ament_index/resource_index/packages.

See the ros2/examples repo for python packages that do this. Here's the relevant part of the, and here's a marker file in a folder called resource.

Here's a page with a little more info about the ament_index, though it's targeted at packages using CMake.

edit flag offensive delete link more


Thank you so much! This solved my problem!

SouLeo gravatar image SouLeo  ( 2019-09-06 11:09:43 -0500 )edit

I believe this is due to a bug in colcon core. Package discovery currently uses either orsetup.cfg. I’m working on a fix in

DanRose gravatar image DanRose  ( 2019-09-07 05:52:50 -0500 )edit

This behavior is not a bug. Earlier colcon-rosdid this automatically for the user but that "magic" has recently been removed ( since it makes it difficult for users to spot that while it works when building from source it would fall when packaging the package into e.g a Debian package.

Dirk Thomas gravatar image Dirk Thomas  ( 2019-09-07 11:02:54 -0500 )edit

I think there is a bug here, though I may have misattributed it. Here's which files change when you remove the setup.cfg and colcon build --symlink-install. Note the path.* hooks so that, without setup.cfg, the directory containing srl_test gets injected into PATH:


DanRose gravatar image DanRose  ( 2019-09-07 15:35:17 -0500 )edit

Question Tools


Asked: 2019-09-06 10:49:34 -0500

Seen: 2,489 times

Last updated: Sep 06 '19