Autoware code style and guidelines #2824
Replies: 10 comments 28 replies
-
Function names are supposed to use snake_case. However, the following exceptions are needed when inheriting classes of external projects such as Qt for rviz plugins.
|
Beta Was this translation helpful? Give feedback.
-
According to this PR, constants using constexpr should be lower_snake_case. |
Beta Was this translation helpful? Give feedback.
-
A rationale for the include order: https://llvm.org/docs/CodingStandards.html#include-style |
Beta Was this translation helpful? Give feedback.
-
Private header files should be placed under
|
Beta Was this translation helpful? Give feedback.
-
[suffixes of build artifacts]
Related: autowarefoundation/autoware.universe#1561 (comment) |
Beta Was this translation helpful? Give feedback.
-
We need to define the style for acronyms in CamelCase.
Related:
Google's guide says:
Microsoft's guide says:
I personally think following Google's guide is simple. I've tried to find a Clang-Tidy rule to fix the naming automatically, but I couldn't find it. |
Beta Was this translation helpful? Give feedback.
-
We should discuss the guideline for ROS interface (topic/service/action) names. |
Beta Was this translation helpful? Give feedback.
-
About the ROS message guidelines. |
Beta Was this translation helpful? Give feedback.
-
About the naming convention for enum members. ROS 2 uses rclcpp/rclcpp/include/rclcpp/qos.hpp
34:enum class HistoryPolicy
35-{
36- KeepLast = RMW_QOS_POLICY_HISTORY_KEEP_LAST,
--
42:enum class ReliabilityPolicy
43-{
44- BestEffort = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
--
51:enum class DurabilityPolicy
52-{
53- Volatile = RMW_QOS_POLICY_DURABILITY_VOLATILE,
--
60:enum class LivelinessPolicy
61-{
62- Automatic = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC,
--
69:enum class QoSCompatibility
70-{
71- Ok = RMW_QOS_COMPATIBILITY_OK, In the ROS 1 guide, it uses enum class Choise
{
Choice1,
Choice2,
Choice3
};
Choise c = Choise::Choice1; And Google uses enum class UrlTableError {
kOk = 0,
kOutOfMemory,
kMalformedInput,
}; In C++ Core Guidelines, |
Beta Was this translation helpful? Give feedback.
-
@xmfcx Let's discuss https://github.com/orgs/autowarefoundation/discussions/2824#discussioncomment-3967388 in another thread.
I personally think we can depend on @Sharrrrk So, do you have any requests to logging in ROS-independent libraries. |
Beta Was this translation helpful? Give feedback.
-
Autoware's code style is based on this page, but I think it needs some customization. So I'd like to discuss the changes of code style for Autoware here.
Beta Was this translation helpful? Give feedback.
All reactions