From 9f2f3b1fae510d469ad3bb0603914c4814ed2ed2 Mon Sep 17 00:00:00 2001 From: Wessel Tip Date: Mon, 15 Sep 2025 08:08:54 +0200 Subject: [PATCH] feat(cpp-convention): Add Tilmann requirements --- CPP_CODE_CONVENTION.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CPP_CODE_CONVENTION.md b/CPP_CODE_CONVENTION.md index 07b24e8..77475ef 100644 --- a/CPP_CODE_CONVENTION.md +++ b/CPP_CODE_CONVENTION.md @@ -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 `__ws`. +* Package names are snake_case, named as `___pkg`. +This name has to be approved by the project manager. +* Interface package names are snake_case, named as either `__machine_interfaces` +or `__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