You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_09_development/_develop_guide/_develop_guide/_develop_new_pkg.rst
+44-24
Original file line number
Diff line number
Diff line change
@@ -19,25 +19,33 @@ Every new C++ package should have the following architecture:
19
19
/package_name
20
20
/include
21
21
/package_name
22
-
### header files ###
23
-
node_name(.hpp)
22
+
### header files (.hpp) ###
23
+
package_name.hpp
24
+
header_files.hpp
24
25
/launch
25
26
/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
30
32
/tests
31
33
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
34
37
CmakeLists.txt
35
38
package.xml
36
39
README.md
37
40
LICENSE
38
41
CONTRIBUTING.md
39
42
.gitignore
40
43
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
+
41
49
Structure of a Python Package
42
50
-----------------------------
43
51
@@ -48,12 +56,12 @@ Every new Python package should have the following architecture:
48
56
/package_name
49
57
/package_name
50
58
__init__.py
51
-
### source_files ###
52
-
file(.py)
59
+
### source_files (.py) ###
60
+
package_name.py
53
61
/launch
54
62
/tests
55
-
### test_files ###
56
-
test(.py)
63
+
### test_files (test_***.py) ###
64
+
test_file.py
57
65
setup.cfg
58
66
setup.py
59
67
package.xml
@@ -72,22 +80,22 @@ A package that includes both Python and C++ files should have the following arch
72
80
/package_name
73
81
/package_name
74
82
__init__.py
75
-
### python_source_files ###
76
-
file(.py)
83
+
### python_source_files(.py) ###
84
+
package_name.py
77
85
/include
78
86
/package_name
79
-
### C++ header files ###
80
-
node_name(.hpp)
87
+
### C++ header files(.hpp) ###
88
+
package_name.hpp
81
89
82
90
/launch
83
91
/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)
88
96
/tests
89
97
### test_files ###
90
-
test(.py)
98
+
test_file.py
91
99
CMakeList.txt
92
100
package.xml
93
101
README.md
@@ -101,8 +109,8 @@ Code Style
101
109
==========
102
110
103
111
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.
106
114
107
115
108
116
.. _development_guide_new_pkg_code_style_c++:
@@ -144,6 +152,18 @@ Every file should start with the Licence text, which looks like this:
144
152
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
145
153
// POSSIBILITY OF SUCH DAMAGE.
146
154
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
+
147
167
Documentation will be generate using `Doxygen <https://www.doxygen.nl/manual/docblocks.html>`_.
148
168
Therefore, header files should include a comment over every definition in order to generate the documentation properly.
149
169
The comments made in the current nodes are writing using Javadoc style.
0 commit comments