colcon / colcon.readthedocs.org Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://colcon.readthedocs.org
License: Creative Commons Attribution 4.0 International
Home Page: https://colcon.readthedocs.org
License: Creative Commons Attribution 4.0 International
Doing a bit of experimenting, I've found that running test on catkin packages isn't quite as straightforward as colcon build && colcon test
. It's not immediately obvious, but one has to run:
colcon build --cmake-target tests
colcon test
...as extracted from ros-infrastructure/ros_buildfarm#548,
I'm guessing this is my fault, but I've found that when I attach a DEPENDENCY to catkin_add_nosetests
such as when using catkin_virtualenv
(https://github.com/paulbovbel/test_meta/blob/master/CMakeLists.txt#L52), I have to run the following to get all tests to pass:
colcon build
colcon build --cmake-target tests
colcon test
Even though it looks like the ${PROJECT_NAME}_generate_virtualenv
should be getting hooked in via the underlying catkin mechanisms.
Regarding the following page:
https://colcon.readthedocs.io/en/released/user/configuration.html#colcon-pkg-files
It mentions that the project must have a colcon.pkg file, which has the name, type, dependencies, etc. fields, but I can't find any examples of such a file in any projects that I've come across that use Colcon. What I do see is the use of package.xml file for these values, as one would typically encounter in ROS projects. As an example, looking at a driver in the Autoware project:
https://gitlab.com/AutowareAuto/AutowareAuto/tree/master/src/drivers/udp_driver
I see a package.xml file, but no colcon.pkg file. Is there a typo in the docs, or are the package.xml and colcon.pkg files complimentary and/or alternatives? Additionally, are there any example colcon based projects that demonstrate the latest best practices?
I was just going through https://colcon.readthedocs.io/en/released/developer/bootstrap.html to build colcon from source. On the first "build the sources" step it failed because I didn't have distlib installed.
(colcon-venv) tim@ub191:~/projects/colcon/colcon-from-source$ ./src/colcon-core/bin/colcon build --paths src/*
Traceback (most recent call last):
File "./src/colcon-core/bin/colcon", line 59, in <module>
from colcon_core.package_identification.python \
File "/home/tim/projects/colcon/colcon-from-source/src/colcon-core/colcon_core/package_identification/python.py", line 9, in <module>
from distlib.util import parse_requirement
ModuleNotFoundError: No module named 'distlib'
Installing distlib via pip fixed the issue:
(colcon-venv) tim@ub191:~/projects/colcon/colcon-from-source$ pip install distlib
Collecting distlib
Installing collected packages: distlib
Successfully installed distlib-0.2.8
(colcon-venv) tim@ub191:~/projects/colcon/colcon-from-source$ ./src/colcon-core/bin/colcon build --paths src/*
Starting >>> colcon-core
running egg_info
...
Does distlib need to be added to the requirements.txt file?
I'm building on Ubuntu 18.04 with Python 3.6
Hi all,
I found my way to this repository/project as part of learning about ROS2. I was curious to see if Colcon was something ROS2-specific, written by the same people, and/or had other applications. If I were an expert in ROS, the answer might be obvious to me, but in reading Colcon's documentation as an isolated source, the definition of what a "package" is is not clear to me. This term seems to be used copiously in Colcon's documentation, and there is a great section defining what a workspace is (e.g. "Colcon is a command line tool to build and test multiple software packages. It builds and tests those packages in a colcon workspace, but what is a workspace?"), but this introduction relies heavily on the term "package", and I haven't been able to find anything in the docs that answers the (perhaps more basic/core question), "then what is a package"?
Since this term is highly overloaded in programming, I would humbly suggest to add something in the introduction of Colcon's docs to first explain what is actually meant by "package". Is it a package like a Debian package (installable set of files), a Python package (e.g. any folder with an init.py file), some C++ sources/binaries, something less specific such as a programming project, or something else? I think the term "package" is normally employed in relation to a framework of some kind, perhaps to say that a package is a modular component that can be added/removed to/from some thing (e.g. apt, or a Python environment), but it's not clear to me what that framework/thing is here.
My best understanding is that "package" may be meant as a reference to ROS and a program (or set of programs) that can be executed within the ROS framework specifically (perhaps including that package's dependencies, build products, or who knows what else), but as a simpleton I would find it helpful if someone could add a description of how this term is to be interpreted throughout the Colcon documentation.
Thanks so much for considering my input and I look forward to continuing to learn about ROS2 and Colcon, it seems like quite a robust and interesting framework!
Best,
Daniel
The github workflow for this fails because pyenchant cannot be found. It can be fixed by installing through apt, see this commit. I can submit this as a PR if you want, but I don't know if the github workflow still matters on this.
:rkent
I have a bunch of packages that have CMake options exposed. Some are package-specific, but are in upstream repos that don't want to change defaults.
When building in colcon, there is support for changing the behavior of packages from the colcon root, but the docs do not explain how to use it very well.
Can you provide a more complete example in the docs for a use case like this:
src/
pkgA/
pkgB/
pkgC/
.my_example.meta
I want to turn
BUILD_TESTING=OFF
on pkgA because its tests take forever to compile and it's slow, but leave it as default (on) in the othersPACKAGE_B_CUSTOM1=42
only affecting pkgBIf you try setting CMake args for these for the entire build, there is no fine grained control.
It would be very helpful for the docs to include a sample my_example.meta
Thanks for the consideration!
Executor documentation states about --parallel-workers
The default value is based on the number of CPU cores
However, it doesn't say what is the logic. Will it be equal to number of CPU cores or threads? Or perhaps N-1 (preferable not to overload system).
The link to the latest documentation seems to be http://colcon.readthedocs.io/en/master, but I am not sure if that is intentional or just a regression.
pip3 install -r requirements.txt fails for me on Ubuntu 18.04 due to missing package testresources.
pip3 install testresources fixes problem.
testresources shoud be probably added to the requirements.txt
In the installation instructions for ros2_dotnet it says you should use the --merge-install
argument, but I can't find anything about what this does. It is mentioned in the section about migrating from other build tools that it is the inverse of the --isolated
argument of ament build
, but I can't find any documentation for that either.
Use case:
We have multiple build configurations stored inside a devops toolkit. Some of them are for developer use, some for CI pipelines.
To change between configurations, I currently have to create a temporary $COLCON_HOME and copy a build configuration there, or change $COLCON_HOME to point out to a directory with the config. However, the latter assumes that the file name is defaults.yaml
.
Suggestion
colcon build --config-path /path/to/config
Since providing build arguments via command line is rather clumsy, I would rather use configuration files as the default way to configure. For example providing multiple cmake-args didn't work as expected, due to very careful formatting needed.
According to https://discourse.ros.org/t/new-gpg-keys-deployed-for-packages-ros-org/9454, the new GPG key should be C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.