Skip to content

Commit

Permalink
feat(coding-guidelines): add guideline for ros node directory structu…
Browse files Browse the repository at this point in the history
…re (autowarefoundation#224)

* feat(coding-guidelines): add guideline for ros node directory structure

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* fix: move warning and add reference

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>

* Update docs/contributing/coding-guidelines/ros-nodes/directory-structure.md

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
Signed-off-by: Cynthia Liu <cynthia.liu@autocore.ai>
  • Loading branch information
2 people authored and cyn-liu committed Nov 7, 2022
1 parent 0d22e41 commit d455627
Showing 1 changed file with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,58 @@
!!! warning

Under Construction

## C++ package

```txt
<package_name>
├─ config
│ ├─ foo_ros.param.yaml
│ └─ foo_non_ros.yaml
├─ include
│ └─ <package_name>
│ └─ foo_public.hpp
├─ launch
│ ├─ foo.launch.xml
│ └─ foo.launch.py
├─ src
│ ├─ foo_node.cpp
│ ├─ foo_node.hpp
│ └─ foo_private.hpp
├─ test
│ └─ test_foo.cpp
├─ package.xml
└─ CMakeLists.txt
```

### config directory

Place configuration files such as node parameters.

For ROS parameters, use the extension `.param.yaml`.
For non-ROS parameters, use the extension `.yaml`.

Rationale: Since ROS parameters files are type-sensitive, they should not be the target of some code formatters and linters. In order to distinguish the file type, we use different file extensions.

### include directory

Place header files exposed to other packages. Do not place files directly under the `include` directory, but place files under the directory with the package name.
This directory is used for mostly library headers. Note that many headers do not need to be placed here. It is enough to place the headers under the `src` directory.

Reference: <https://docs.ros.org/en/rolling/How-To-Guides/Ament-CMake-Documentation.html#adding-files-and-headers>

### launch directory

Place launch files (`.launch.xml` and `.launch.py`).

### src directory

Place source files and private header files.

### test directory

Place source files for testing.

## Python package

T.B.D.

0 comments on commit d455627

Please sign in to comment.