Skip to content

Commit 5e800ca

Browse files
committed
Second review comments applied
1 parent 8aeda91 commit 5e800ca

File tree

1 file changed

+44
-24
lines changed

1 file changed

+44
-24
lines changed

docs/_09_development/_develop_guide/_develop_guide/_develop_new_pkg.rst

+44-24
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,33 @@ Every new C++ package should have the following architecture:
1919
/package_name
2020
/include
2121
/package_name
22-
### header files ###
23-
node_name(.hpp)
22+
### header files (.hpp) ###
23+
package_name.hpp
24+
header_files.hpp
2425
/launch
2526
/src
26-
### implementation_files ###
27-
node_name(.cpp)
28-
### main_files ###
29-
node_name_node(.cpp)
27+
### implementation_files (.cpp)###
28+
package_name.cpp
29+
implementation_files.cpp
30+
### main_files (_node.cpp) ###
31+
package_name_node.cpp
3032
/tests
3133
CMakeLists.txt
32-
### test_files ###
33-
gtest_test(.cpp)
34+
### test_files (_test.cpp, _gtest.cpp) ###
35+
test_executable_test.cpp
36+
google_test_gtest.cpp
3437
CmakeLists.txt
3538
package.xml
3639
README.md
3740
LICENSE
3841
CONTRIBUTING.md
3942
.gitignore
4043
44+
Note that every executable test file must end with ``_test.cpp`` and every Google test file must end with ``_gtest.cpp``.
45+
46+
Simple packages with just one node should have its only node named as the package. Packages with more than one node or
47+
implementation files may have different naming.
48+
4149
Structure of a Python Package
4250
-----------------------------
4351

@@ -48,12 +56,12 @@ Every new Python package should have the following architecture:
4856
/package_name
4957
/package_name
5058
__init__.py
51-
### source_files ###
52-
file(.py)
59+
### source_files (.py) ###
60+
package_name.py
5361
/launch
5462
/tests
55-
### test_files ###
56-
test(.py)
63+
### test_files (test_***.py) ###
64+
test_file.py
5765
setup.cfg
5866
setup.py
5967
package.xml
@@ -72,22 +80,22 @@ A package that includes both Python and C++ files should have the following arch
7280
/package_name
7381
/package_name
7482
__init__.py
75-
### python_source_files ###
76-
file(.py)
83+
### python_source_files(.py) ###
84+
package_name.py
7785
/include
7886
/package_name
79-
### C++ header files ###
80-
node_name(.hpp)
87+
### C++ header files(.hpp) ###
88+
package_name.hpp
8189
8290
/launch
8391
/src
84-
### C++ implementation_files ###
85-
node_name(.cpp)
86-
### C++ main_files ###
87-
node_name_node(.cpp)
92+
### C++ implementation_files(.cpp) ###
93+
package_name.cpp
94+
### C++ main_files (_node.cpp) ###
95+
package_name_node(.cpp)
8896
/tests
8997
### test_files ###
90-
test(.py)
98+
test_file.py
9199
CMakeList.txt
92100
package.xml
93101
README.md
@@ -101,8 +109,8 @@ Code Style
101109
==========
102110

103111
Aerostack2 mainly follows the `ROS 2 code style and language versions <https://docs.ros.org/en/humble/The-ROS2-Project/Contributing/Code-Style-Language-Versions.html>`_.
104-
There are, though, some exceptions, as ROS 2 claims to follow Goggle code style but uses snake_case
105-
instead of camelCase. Aerostack2 uses camelCase.
112+
There are, though, some exceptions, as ROS 2 claims to follow Google code style but uses snake_case
113+
instead of camelCase. Aerostack2 uses Google code style.
106114

107115

108116
.. _development_guide_new_pkg_code_style_c++:
@@ -144,6 +152,18 @@ Every file should start with the Licence text, which looks like this:
144152
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
145153
// POSSIBILITY OF SUCH DAMAGE.
146154

155+
After the License text, files should include a header like this:
156+
157+
.. code-block:: c++
158+
159+
/**
160+
* @file file_name.cpp
161+
*
162+
* File description
163+
*
164+
* @author Author name <author email>
165+
*/
166+
147167
Documentation will be generate using `Doxygen <https://www.doxygen.nl/manual/docblocks.html>`_.
148168
Therefore, header files should include a comment over every definition in order to generate the documentation properly.
149169
The comments made in the current nodes are writing using Javadoc style.
@@ -374,5 +394,5 @@ To run these tests:
374394

375395
.. code-block:: bash
376396
377-
$ colcon test
397+
colcon test
378398

0 commit comments

Comments
 (0)