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

Ignore package in colcon but not catkin?

asked 2018-10-24 08:00:31 -0500

lucasw gravatar image

updated 2018-10-24 08:04:06 -0500

catkin ignores packages when they have COLCON_IGNORE in them. ( https://github.com/ros-infrastructure... )

I'd like to have ros1 and ros2 packages in parallel in two subdirectories of the same git repository and not get this error:

CMake Error at CMakeLists.txt:4 (find_package):
  By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "catkin", but
  CMake did not find one.

  Could not find a package configuration file provided by "catkin" with any
  of the following names:

    catkinConfig.cmake
    catkin-config.cmake
...

--packages-skip exists but has to be typed in every time there is a build, I don't see a blacklist option to add to a colcon config to ignore it for all following builds.

Building with catkin produces (more innocuous) warnings:

[build] Warning: Skipping package `foo2` because it has an unsupported package build type: `ament_cmake`
[build] Note: Available build types:                                                               
[build]  - `cmake`                                                                                 
[build]  - `catkin`

And then those can be eliminated with --blacklist.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-11-02 11:56:51 -0500

lucasw gravatar image

updated 2018-11-03 08:18:49 -0500

mixins

sudo apt install python3-colcon-mixin

src/my/mixins/skip.mixin:

{
  "build": {
    "skip": {
      "packages-skip": ["foo1",
                        "foo2",
                        "bar",
                        ],
    }
  }
}

src/my/mixins/index.yaml:

mixin:
    - skip.mixin

Then:

colcon mixin add skip file://`pwd`/src/my/mixins/index.yaml
colcon mixin update skip
fetching links: file:///home/lucasw/ros2_ws/src/my/mixins/index.yaml ...
  fetching file:///home/lucasw/ros2_ws/src/my/mixins/skip.mixin ...
  * /home/lucasw/.colcon/mixin/skip/skip.mixin

And run update if the index or mixin file/s change, and build with

colcon build --mixin skip

More on colcon mixins: https://github.com/colcon/colcon-mixi...

edit flag offensive delete link more

Comments

1

Hopefully in the near future you won't need to create your own local index.yaml for this but can just pass --mixin-file path/to/skip.mixin...

Dirk Thomas gravatar image Dirk Thomas  ( 2018-11-02 12:00:12 -0500 )edit

The mixing doesn't provide persistence either and seems to be more effort than the options mentioned in the other answer.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-11-03 11:29:37 -0500 )edit
1

answered 2018-10-24 08:56:29 -0500

Dirk Thomas gravatar image

The build tool is not a valid criteria for concluding if a build is for ROS 1 or ROS 2 (e.g. you can use colcon to build a ROS 1 workspace).

Generally it is not a workflow we recommend - to keep ROS 1 and ROS 2 packages on the same branch - so it will likely not be supported in all cases.

You could check the ROS_VERSION environment variable and make a decision about "skipping" a package in it's CMake logic. But as I said that is more like a hack and you might run into problems going down that path.

edit flag offensive delete link more

Comments

Will there be a colcon --blacklist?

lucasw gravatar image lucasw  ( 2018-10-24 09:14:49 -0500 )edit

There are already the options --packages-ignore (to skip packages during discovery, same as a *_IGNORE file) as well as --packages-skip and --packages-skip-regex (to deselect discovered packages).

Dirk Thomas gravatar image Dirk Thomas  ( 2018-10-24 09:28:39 -0500 )edit

But no persistence of those kinds of settings in a build.yaml/config.yaml as with catkin?

lucasw gravatar image lucasw  ( 2018-10-24 12:34:16 -0500 )edit
1

At the moment there is no "profile" / "default mixin". You could create a mixin file manually to aggregate multiple command line options and select it explictly (--mixin mymixin) but that would still require to at least pass that argument - so not very convenient.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-10-24 13:17:02 -0500 )edit

There's an enhancement suggestion for this feature here

jrgnicho gravatar image jrgnicho  ( 2020-01-13 12:57:54 -0500 )edit

@jrgnicho your link points to a repository which has no issues or pull requests open?

Dirk Thomas gravatar image Dirk Thomas  ( 2020-01-13 13:08:17 -0500 )edit
jrgnicho gravatar image jrgnicho  ( 2020-02-19 14:33:45 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-10-24 08:00:31 -0500

Seen: 5,894 times

Last updated: Nov 03 '18