Skip to content

Commit 5cc6023

Browse files
vkreschThomasNaderBMW
authored andcommitted
Update release names (#381)
Signed-off-by: Nader Thomas <[email protected]>
1 parent 6e94c46 commit 5cc6023

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

doc/interfaceconventions.rst.orig

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
.. _iconventions:
2+
3+
Interface Conventions
4+
======================
5+
6+
When adding new messages, enums, field messages and field enums to OSI we enforce a few naming conventions for each type like in the `style guide <https://developers.google.com/protocol-buffers/docs/style>`_ from protobuf.
7+
8+
Message Naming
9+
---------------
10+
<<<<<<< HEAD
11+
A message definition should always be in PascalCase. This means that the first letter of each word in a message should be upper case without any spaces. See example below:
12+
=======
13+
A message definition should always be in camel case. This means that the first letter of each word in a message should be upper case without any spaces. See example below:
14+
>>>>>>> Documentation/interface convention (#380)
15+
16+
.. code-block:: protobuf
17+
18+
message EnvironmentalConditions
19+
{
20+
}
21+
22+
Top-Level Messages
23+
-------------------
24+
All messages that are intended to be exchanged as a stand-alone message, i.e. not required to be embedded in another message, like e.g. ``SensorView`` or ``SensorViewConfiguration``, are required to carry an ``InterfaceVersion`` field as their first field, and a ``Timestamp`` field as their second field, e.g.:
25+
26+
.. code-block:: protobuf
27+
28+
message TopLevel
29+
{
30+
// The interface version used by the sender (simulation environment).
31+
//
32+
optional InterfaceVersion version = 1;
33+
34+
// The data timestamp of the simulation environment. Zero time is arbitrary
35+
// but must be identical for all messages. Zero time does not need to
36+
// coincide with the UNIX epoch. Recommended is the starting time point of
37+
// the simulation.
38+
//
39+
optional Timestamp timestamp = 2;
40+
}
41+
42+
Field Message Naming
43+
---------------------
44+
<<<<<<< HEAD
45+
After defining a message fields can be added to it in snake_case format. This means every letter is lower case and the words are connected through an underline character. See example below:
46+
=======
47+
After defining a message fields can be added to it in snake case format. This means every letter is lower case and the words are connected through an underline character. See example below:
48+
>>>>>>> Documentation/interface convention (#380)
49+
50+
.. code-block:: protobuf
51+
52+
message EnvironmentalConditions
53+
{
54+
optional double atmospheric_pressure = 1;
55+
}
56+
57+
Field Numbering
58+
----------------
59+
60+
Fields should be numbered consecutively starting from 1 on first definition. During maintenance, the rules of backward/forward-compatibility require that fields are never renumbered, and field numbers never re-used unless a major release is performed.
61+
62+
All field numbers of 10000 and above are reserved for user-defined extensions and will thus never be used by OSI message fields.
63+
64+
Enum Naming
65+
------------
66+
<<<<<<< HEAD
67+
The naming of an enum should be PascalCase. See example below:
68+
=======
69+
The naming of an enum should be camel case. See example below:
70+
>>>>>>> Documentation/interface convention (#380)
71+
72+
.. code-block:: protobuf
73+
74+
message EnvironmentalConditions
75+
{
76+
optional double atmospheric_pressure = 1;
77+
78+
enum AmbientIllumination
79+
{
80+
}
81+
}
82+
83+
Enum Field Naming
84+
------------
85+
<<<<<<< HEAD
86+
The naming of an enum field should be all in upper case. The start should be converted from the enum name PascalCase to UPPER_CASE_SNAKE_CASE. It is mandatory to add to the first enum field name the postfix ``_UNKNOWN`` and to the second the postfix ``_OTHER``. After that the naming can be decided by the user. It is often mentioned that the value ``_UNKNOWN`` should not be used in a ``GroundTruth`` message as there are now uncertanties by definition in ``the truth``. These values are mostly used in messages like ``SensorData`` where the content is subject to interpretation. See example below:
87+
=======
88+
The naming of an enum field should be all in upper case. The start should be converted from the enum name camel case to upper case snake case. It is mandatory to add to the first enum field name the postfix ``_UNKNOWN`` and to the second the postfix ``_OTHER``. After that the naming can be decided by the user. It is often mentioned that the value ``_UNKNOWN`` should not be used in a ``GroundTruth`` message as there are now uncertanties by definition in ``the truth``. These values are mostly used in messages like ``SensorData`` where the content is subject to interpretation. See example below:
89+
>>>>>>> Documentation/interface convention (#380)
90+
91+
.. code-block:: protobuf
92+
93+
message EnvironmentalConditions
94+
{
95+
optional double atmospheric_pressure = 1;
96+
97+
enum AmbientIllumination
98+
{
99+
AMBIENT_ILLUMINATION_UNKNOWN = 0;
100+
101+
AMBIENT_ILLUMINATION_OTHER = 1;
102+
103+
AMBIENT_ILLUMINATION_LEVEL1 = 2;
104+
}
105+
}
106+
107+
Summary
108+
--------
109+
Here a small summary for the naming conventions:
110+
111+
<<<<<<< HEAD
112+
Messages: PascalCase
113+
114+
Message Fields: snake_case
115+
116+
Enum: PascalCase
117+
118+
Enum Fields: Name of enum converted in UPPER_CASE_SNAKE_CASE and then following the specified name
119+
=======
120+
Messages: camel case
121+
122+
Message Fields: snake case
123+
124+
Enum: camel case
125+
126+
Enum Fields: upper case, name of enum converted in upper case snake case and then following the specified name
127+
>>>>>>> Documentation/interface convention (#380)
128+
129+
After defining the messages do not forget to comment them. See also the `section for commenting <https://opensimulationinterface.github.io/osi-documentation/open-simulation-interface/doc/commenting.html>`_ of fields and messages.

doc/releases.rst.orig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Releases
2+
=========
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
:caption: Release History:
7+
8+
releases/v02.00
9+
releases/v02.01
10+
releases/v02.02
11+
releases/v03.00
12+
releases/v03.01
13+
releases/v03.02
14+
<<<<<<< HEAD
15+
releases/v03.03
16+
=======
17+
>>>>>>> Update release names (#381)

0 commit comments

Comments
 (0)