Skip to content

Commit e8549a1

Browse files
authored
Merge pull request #64 from OpenSimulationInterface/feature/version-number
Version number in one file (resolves #58)
2 parents d32e6d8 + ec912fa commit e8549a1

20 files changed

+725
-696
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ build
1313
osi
1414
.project
1515
doc/html
16-
doc/latex
16+
doc/latex
17+
osi_version.proto
18+
version.py

CMakeLists.txt

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
cmake_minimum_required(VERSION 3.7)
22

3-
# set name and version of the project
43
project(open_simulation_interface)
5-
set(VERSION_MAJOR 2)
6-
set(VERSION_MINOR 1)
7-
set(VERSION_PATCH 1)
84

5+
# read the version number from the file "VERSION"
6+
file(STRINGS "VERSION" VERSION_CONTENTS)
7+
foreach(LINE ${VERSION_CONTENTS})
8+
string(REGEX REPLACE " |\t" "" LINE ${LINE})
9+
string(REGEX MATCH "^[^=]+" VERSION_NAME ${LINE})
10+
string(REPLACE "${VERSION_NAME}=" "" VERSION_VALUE ${LINE})
11+
set(${VERSION_NAME} "${VERSION_VALUE}")
12+
endforeach()
13+
14+
configure_file(osi_version.proto.in ${CMAKE_CURRENT_SOURCE_DIR}/osi_version.proto)
915

1016
find_package(Protobuf 2.6.1 REQUIRED)
1117

1218
set(OSI_PROTO_FILES
19+
osi_version.proto
1320
osi_common.proto
1421
osi_datarecording.proto
1522
osi_detectedlandmark.proto
@@ -77,22 +84,22 @@ if(NOT DOXYGEN_FOUND)
7784
message(WARNING "Doxygen could not be found.")
7885

7986
else()
80-
81-
if(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py)
82-
83-
message(WARNING "${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py could not be found.")
84-
85-
else()
86-
87-
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_config.cmake.in)
88-
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
89-
90-
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
91-
92-
ADD_CUSTOM_TARGET(api_doc ALL
93-
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
94-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
95-
96-
endif(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py)
97-
87+
88+
if(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py)
89+
90+
message(WARNING "${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py could not be found.")
91+
92+
else()
93+
94+
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_config.cmake.in)
95+
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
96+
97+
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
98+
99+
ADD_CUSTOM_TARGET(api_doc ALL
100+
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
101+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
102+
103+
endif(NOT EXISTS ${FILTER_PROTO2CPP_PY_PATH}/proto2cpp.py)
104+
98105
endif(NOT DOXYGEN_FOUND)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ sensor model component, i.e. it takes a SensorData message as input and returns
4141
Specific errors should be handled as follows:
4242
- Ghost objects / false positive:
4343
An additional SensorDataObject is added to the list of objects in SensorData.object
44-
with SensorDataObject.model_internal_object.ground_truth_type set to kTypeGhost.
44+
with SensorDataObject.model_internal_object.ground_truth_type set to kTypeGhost.
4545
- False negative:
4646
The object is marked as not seen by the sensor by setting the property
47-
SensorDataObject.model_internal_object.is_seen to false. The implementation
48-
of field-of-view calculation modules should respect this flag and never reset
49-
an object marked as not-seen to seen.
47+
SensorDataObject.model_internal_object.is_seen to false. The implementation
48+
of field-of-view calculation modules should respect this flag and never reset
49+
an object marked as not-seen to seen.
5050

5151

5252
Versioning

VERSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VERSION_MAJOR = 2
2+
VERSION_MINOR = 2
3+
VERSION_PATCH = 0

osi_common.proto

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,6 @@ option optimize_for = SPEED;
44

55
package osi;
66

7-
//
8-
// \brief The interface version number.
9-
//
10-
// The field containing the version number. Should be left on default, not to be modified by sender.
11-
// Increments will happen as part of changes to the whole interface.
12-
//
13-
message InterfaceVersion
14-
{
15-
// Major version number.
16-
//
17-
optional uint32 major = 1 [default = 2];
18-
19-
// Minor version number.
20-
//
21-
optional uint32 minor = 2 [default = 1];
22-
23-
// Patch version number.
24-
//
25-
optional uint32 patch = 3 [default = 1];
26-
}
277

288
//
299
// \brief A cartesian 3D vector for positions, velocities or accelerations.
@@ -33,31 +13,31 @@ message InterfaceVersion
3313
message Vector3d
3414
{
3515
// The x coordinate.
36-
//
16+
//
3717
optional double x = 1;
3818

3919
// The y coordinate.
40-
//
20+
//
4121
optional double y = 2;
4222

4323
// The z coordinate.
44-
//
24+
//
4525
optional double z = 3;
4626
}
4727

4828
//
49-
// \brief A cartesian 2D vector for positions, velocities or accelerations.
29+
// \brief A cartesian 2D vector for positions, velocities or accelerations.
5030
//
5131
// Units are [m] for positions, [m/s] for velocities and [m/s^2] for accelerations.
5232
//
5333
message Vector2d
5434
{
5535
// The x coordinate.
56-
//
36+
//
5737
optional double x = 1;
5838

5939
// The y coordinate.
60-
//
40+
//
6141
optional double y = 2;
6242
}
6343

@@ -70,11 +50,11 @@ message Vector2d
7050
message Timestamp
7151
{
7252
// The number of seconds since start of the simulation / system / vehicle. Unit: [s].
73-
//
53+
//
7454
optional int64 seconds = 1;
7555

7656
// The number of nanoseconds since the start of the last second. Unit: [ns].
77-
//
57+
//
7858
optional int32 nanos = 2;
7959
}
8060

@@ -86,15 +66,15 @@ message Timestamp
8666
message Dimension3d
8767
{
8868
// The width of the bounding box.
89-
//
69+
//
9070
optional double width = 1;
91-
71+
9272
// The length of the bounding box.
93-
//
73+
//
9474
optional double length = 2;
95-
75+
9676
// The height of the bounding box.
97-
//
77+
//
9878
optional double height = 3;
9979
}
10080

@@ -123,15 +103,15 @@ message Dimension3d
123103
message Orientation3d
124104
{
125105
// The roll angle/rate/acceleration.
126-
//
106+
//
127107
optional double roll = 1;
128-
108+
129109
// The pitch angle/rate/acceleration.
130-
//
110+
//
131111
optional double pitch = 2;
132-
112+
133113
// The yaw angle/rate/acceleration.
134-
//
114+
//
135115
optional double yaw = 3;
136116
}
137117

@@ -146,7 +126,7 @@ message Orientation3d
146126
message Identifier
147127
{
148128
// The identifier's value.
149-
//
129+
//
150130
optional uint64 value = 1;
151131
}
152132

@@ -158,11 +138,11 @@ message Identifier
158138
message MountingPosition
159139
{
160140
// Offset position relative to specified reference coordinate system.
161-
//
141+
//
162142
optional Vector3d position = 1;
163143

164144
// Orientation offset relative to specified reference coordinate system.
165-
//
145+
//
166146
optional Orientation3d orientation = 2;
167147
}
168148

@@ -175,15 +155,15 @@ message MountingPosition
175155
message Polar3d
176156
{
177157
// The radial distance.
178-
//
158+
//
179159
optional double distance = 1;
180160

181161
// The azimuth (horizontal) angle.
182-
//
162+
//
183163
optional double azimuth = 2;
184164

185165
// The elevation (vertical) angle.
186-
//
166+
//
187167
optional double elevation = 3;
188168
}
189169

@@ -195,15 +175,15 @@ message Polar3d
195175
message BaseStationary
196176
{
197177
// The 3D dimension of the landmark (bounding box):
198-
//
178+
//
199179
optional Dimension3d dimension = 1;
200180

201181
// The reference point for position and rotation (orientation): center (x, y, z) of bounding box.
202-
//
182+
//
203183
optional Vector3d position = 2;
204184

205185
// The relative orientation of the landmark w.r.t its parent frame.
206-
//
186+
//
207187
optional Orientation3d orientation = 3;
208188

209189
// Usage as ground truth:
@@ -230,29 +210,27 @@ message BaseStationary
230210
message BaseMoving
231211
{
232212
// The 3D dimension of the object (bounding box).
233-
//
213+
//
234214
optional Dimension3d dimension = 1;
235215

236216
// The reference point for position and rotation (orientation): center (x, y, z) of bounding box.
237-
//
217+
//
238218
optional Vector3d position = 2;
239219

240220
// The relative orientation of the object w.r.t its parent frame.
221+
//
241222
optional Orientation3d orientation = 3;
242223

243224
// The relative velocity of the object w.r.t. its parent frame and parent velocity.
244225
// Obviously, the velocity becomes global/absolute if the parent frame does not move.
245-
//
246226
optional Vector3d velocity = 4;
247227

248228
// The relative acceleration of the object w.r.t. its parent frame and parent acceleration.
249229
// Obviously, the acceleration becomes global/absolute if the parent frame is not accelerating.
250-
//
251230
optional Vector3d acceleration = 5;
252231

253232
// The relative orientation rate of the object w.r.t. its parent frame and parent orientation rate.
254233
// Obviously, the orientation rate becomes global/absolute if the parent frame is not rotating.
255-
//
256234
optional Orientation3d orientation_rate = 6;
257235

258236
// Usage as ground truth:

osi_datarecording.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package osi;
1212
message SensorDataSeries
1313
{
1414
// List of sensor data messages for subsequent timesteps.
15-
//
15+
//
1616
repeated SensorData sensor_data = 1;
1717
}
1818

@@ -25,7 +25,7 @@ message SensorDataList
2525
{
2626
// List of sensor data for multiple sensors at a specific timestep.
2727
//
28-
repeated SensorData sensor = 1;
28+
repeated SensorData sensor = 1;
2929
}
3030

3131
//
@@ -35,5 +35,5 @@ message SensorDataSeriesList
3535
{
3636
// List of sensor data for multiple sensors at subsequent timesteps.
3737
//
38-
repeated SensorDataSeries sensor = 1;
38+
repeated SensorDataSeries sensor = 1;
3939
}

0 commit comments

Comments
 (0)