Skip to content

Commit

Permalink
Add info on colcon.pkg - another way to specify module dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommy IdeaPad3 committed Dec 2, 2023
1 parent 6eb55ad commit b18375a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ First make sure we have run the unit test already.
colcon test
```

### Test coverage report for "my_controller":
### Test coverage report for `my_controller`:

``` bash
ros2 run my_controller generate_coverage_report.bash
open build/my_controller/test_coverage/index.html
```

### Test coverage report for "my_model":
### Test coverage report for `my_model`:

``` bash
colcon build \
Expand Down
21 changes: 18 additions & 3 deletions src/my_controller/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# my_controller
# `my_controller`

Here's a simple ROS2 package that demonstrates how integration test
(aka level 2 unit test) can be done using GoogleTest.
Expand All @@ -14,11 +14,26 @@ For a more portable ROS2 integration test framework, consider using catch_ros2:
https://github.com/ngmor/catch_ros2


This ROS2 package depends on the "my_model" module. This dependency
is specified in the package's package.xml file:
This ROS2 package depends on the `my_model` module. This dependency
is specified in the package's `package.xml` file:

```
<depend>my_model</depend>
```

Alternatively, we could also specify the dependency by creating a
`colcon.pkg` file with the content listed below. But since this is a
ROS package, we must use `package.xml` instead of `colcon.pkg`.
Otherwise the package will not show up in the list of ROS2 packages
(ie., output of `ros2 pkg list`).

```
{
"name": "my_controller",
"type": "cmake",
"dependencies" : ["my_model"]
}
```



2 changes: 1 addition & 1 deletion src/my_model/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# my_model
# `my_model`

## Overview

Expand Down

0 comments on commit b18375a

Please sign in to comment.