Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use colcon plugins #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,34 @@ The `r2r_cargo` function requires cmake version 3.21 or newer, but
ubuntu 20.04 ships with cmake 3.16.3. You can update to a newer cmake
version by adding the kitware apt repo: <https://apt.kitware.com>.

## Building using the Rust plugins for the ROS buildtools.
It is also possible to build using the Rust plugins for the ROS buildtools.

To install the Rust plugins for the ROS buildtools:
```sh
cargo install --debug cargo-ament-build
pip install git+https://github.com/colcon/colcon-cargo.git
pip install git+https://github.com/colcon/colcon-ros-cargo.git
```

`r2r_minimal_node_colcon_plugin` is configured to be built using the rust plugins. To only build one version of the minimal node package, this directory has a `COLCON_IGNORE` file in it. Move it to `r2r_minimal_node` to skip that package instead.

```sh
mkdir src
cd src
git clone [this repo]
mv r2r_minimal_node_colcon_plugin/COLCON_IGNORE r2r_minimal_node/
cd ..
colcon build --clean-build --cargo-args --release
```

## Building using only cargo

Another option is to build the message package first, then sourcing the resulting workspace. When `r2r_minimal_node_msgs` is sourced, the r2r build script will automatically pick up the custom messages (it defaults to building everything).

To avoid building everything, it is possible to declare only the messages needed using the environment variable `IDL_PACKAGE_FILTER`. Setting this can be done in `.cargo/config.toml` for convenience, e.g. <https://github.com/m-dahl/r2r_minimal_node/blob/master/r2r_minimal_node/.cargo/config.toml>

``` sh
```sh
mkdir src
cd src
git clone [this repo]
Expand Down
3 changes: 3 additions & 0 deletions r2r_minimal_node_colcon_plugin/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example of how to do idl package filtering.
[env]
IDL_PACKAGE_FILTER = { value = "std_msgs;r2r_minimal_node_msgs" }
Empty file.
Loading