feat(cpp-convention): Add Tilmann requirements
This commit is contained in:
@@ -89,6 +89,16 @@ For C++ file types we use the following conventions:
|
||||
|
||||
Using C libraries is allowed, but any includes must be in an `extern c` block.
|
||||
|
||||
### ROS2 specific naming conventions
|
||||
|
||||
> **NOTE**: Year is always in YYYY format (2025)
|
||||
|
||||
* Workspace names are snake_case, named as `<groupname>_<year>_ws`.
|
||||
* Package names are snake_case, named as `<groupname>_<year>_<functional_name>_pkg`.
|
||||
This name has to be approved by the project manager.
|
||||
* Interface package names are snake_case, named as either `<groupname>_<year>_machine_interfaces`
|
||||
or `<groupname>_<year>_assessment_interfaces`
|
||||
|
||||
## Comments
|
||||
|
||||
* Comments are lines starting with `//`.
|
||||
@@ -160,6 +170,7 @@ nested if statements are 4)
|
||||
`if (is_charging && (!is_free || moving))`). Instead wrap parts in a variable
|
||||
or simplify the if statement by removing the second part and wrapping that and
|
||||
the underlying code in a function.
|
||||
* Any relevant calculation should output a log message of severity `DEBUG`.
|
||||
|
||||
## Variables
|
||||
|
||||
@@ -175,6 +186,11 @@ nested if statements are 4)
|
||||
3. ternary statements (e.g. int module = is_connected ? 5 : 4)
|
||||
4. boundary condition in loops (e.g. uint loop_end = vector.size() - 1)
|
||||
* Prefer constexpr variables over macros.
|
||||
* Avoid double pointers.
|
||||
|
||||
## Dates
|
||||
|
||||
Dates should always be written in `DD[-/]MM[-/]YYYY HH[:]mm[:]ss` or epoch format.
|
||||
|
||||
## Example file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user