ROS2 workspace profiles
Setting work-space wide configurations
Mixin
A mixin is a tag given to a set of parameters that you may want to pass to colcon during build (maybe used with other colcon commands).
Adding Mixins to colcon
Add the official mixin repository to install the default mixins:
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
Update the mixins:
colcon mixin update
List the mixins:
colcon mixin list
Build with particular mixin:
colcon build --mixin rel-with-deb-info
Adding a custom Mixins
- Make a
custom.mixinfile that defines custom mixins(JSONformat). Here we add a mixin for theMRS_ENABLE_TESTINGflag.
{
"build": {
"mrs-testing": {
"cmake-args": ["-DMRS_ENABLE_TESTING=true",
"-DENABLE_TESTS=true"]
},
}
}
- Make an
index.yamlfile forcolcon mixinto find all the defined mixins
mixin:
- custom.mixin
- Add the file to the mixin repository and update the mixins:
colcon mixin add mrs file://<path-to-directory-with-mixin-index-file>/index.yaml
colcon mixin update mrs
Using Mixins for build
colconuses configuration files for building, testing and installing packages. It's good practice to have acolcon_defaults.yamlin the root of your ROS2 workspace.- The file can have different parameters as described at https://colcon.readthedocs.io/en/released/reference/verb/build.html. For eg. using a particular mixin and limiting the threads during build would look like
build:
parallel-workers: 8
mixin:
- rel-with-deb-info
- mrs-testing