Skip to content

Commit 4fbc2e9

Browse files
authored
Merge pull request #40 from OpenSimulationInterface/contour2d
Contour2d
2 parents 49adb5f + c0c1907 commit 4fbc2e9

File tree

3 files changed

+57
-11
lines changed

3 files changed

+57
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
dist/
23
CMakeCache.txt
34
CMakeFiles
45
CMakeScripts
@@ -10,3 +11,4 @@ CTestTestfile.cmake
1011
build
1112
*.egg-info
1213
osi
14+
.project

osi_common.proto

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ message InterfaceVersion
1212
/// The field containing the version number. Should be left on default, not to be modified by sender. Increments will
1313
/// happen as part of changes to the whole interface.
1414
optional uint32 major = 1 [default = 2];
15-
optional uint32 minor = 2 [default = 0];
16-
optional uint32 patch = 3 [default = 1];
15+
optional uint32 minor = 2 [default = 1];
16+
optional uint32 patch = 3 [default = 0];
1717
}
1818

1919
///
@@ -32,6 +32,19 @@ message Vector3d
3232
optional double z = 3;
3333
}
3434

35+
///
36+
/// A cartesian 2D vector for positions, velocities or accelerations.
37+
/// Units are [m] for positions, [m/s] for velocities and [m/s^2] for accelerations.
38+
///
39+
message Vector2d
40+
{
41+
/// The x coordinate
42+
optional double x = 1;
43+
44+
/// The y coordinate
45+
optional double y = 2;
46+
}
47+
3548
///
3649
/// A timestamp.
3750
/// Names and types of fields chosen in accordance with google/protobuf/timestamp.proto to allow a possible switch in the
@@ -141,6 +154,21 @@ message BaseStationary
141154

142155
/// The relative orientation of the landmark w.r.t its parent frame.
143156
optional Orientation3d orientation = 3;
157+
158+
/// Usage as ground truth:
159+
/// The two dimensional (flat) contour of the object. This is an extension of the concept of a
160+
/// bounding box as defined in Dimension3d. The contour is the projection of the object outline
161+
/// on the z-plane in the object frame (independent of its current position and orientation).
162+
/// Usage as sensor data:
163+
/// The polygon describes the visible part of the object's contour.
164+
/// General definitions:
165+
/// The polygon is defined in the local object frame: x pointing forward and y to the left.
166+
/// The origin is the center of the bounding box.
167+
/// As ground truth, the polygon is closed by connecting the last with the first point. Therefore
168+
/// these two points are different and there are at least three points.
169+
/// As sensor data, the polygon is open.
170+
/// The polygon is defined counter-clockwise.
171+
repeated Vector2d base_polygon = 4;
144172
}
145173

146174
///
@@ -169,4 +197,19 @@ message BaseMoving
169197
/// The relative orientation rate of the object w.r.t. its parent frame and parent orientation rate.
170198
/// Obviously, the orientation rate becomes global/absolute if the parent frame is not rotating.
171199
optional Orientation3d orientation_rate = 6;
200+
201+
/// Usage as ground truth:
202+
/// The two dimensional (flat) contour of the object. This is an extension of the concept of a
203+
/// bounding box as defined in Dimension3d. The contour is the projection of the object outline
204+
/// on the z-plane in the object frame (independent of its current position and orientation).
205+
/// Usage as sensor data:
206+
/// The polygon describes the visible part of the object's contour.
207+
/// General definitions:
208+
/// The polygon is defined in the local object frame: x pointing forward and y to the left.
209+
/// The origin is the center of the bounding box.
210+
/// As ground truth, the polygon is closed by connecting the last with the first point. Therefore
211+
/// these two points are different and there are at least three points.
212+
/// As sensor data, the polygon is open.
213+
/// The polygon is defined counter-clockwise.
214+
repeated Vector2d base_polygon = 7;
172215
}

osi_object.proto

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ package osi;
99
///
1010
/// A vehicle.
1111
///
12-
/// This is basically a BaseObject with additional attributes, such as type and lights. Note that, if this vehicle is a
13-
/// simulated ego vehicle (i.e. ego_vehicle is set to true), relative_ego_origin has to be set, defining the offset from
14-
/// the ego vehicle's bounding box center to the center of the vehicle's rear axis. This defines the origin of the ego
15-
/// vehicle's rear axis coordinate system and allows calculation of quantities relative to this reference frame. The
16-
/// origin of the rear axis coordinate system in world coordinates is calculated as: base.position + R * relative_ego_origin
12+
/// This is basically a BaseObject with additional attributes, such as type and lights.
13+
/// The origin of the rear (front) axis coordinate system in world coordinates is calculated as: base.position + R * bbcenter_to_rear (front)
1714
/// for the ego vehicle (R rotates from vehicle to world frame). For all vehicles, including ego vehicles, the position given
1815
/// in base.position points to the center of the vehicle's bounding box.
1916
///
@@ -35,10 +32,9 @@ message Vehicle
3532
/// See the description above!
3633
optional bool ego_vehicle = 5;
3734

38-
/// The position of the vehicle's reference point.
39-
/// See the description above!
40-
/// Field need not be set (or should be zero) if ego_vehicle is set to false.
41-
optional Vector3d relative_ego_origin = 6;
35+
/// The vector pointing from the bounding box center point (base.position) to the middle (in x, y and z)
36+
/// of the rear axle under neutral load conditions. In object coordinates.
37+
optional Vector3d bbcenter_to_rear = 6;
4238

4339
/// The ids of the lanes that this vehicle is assigned to.
4440
/// Might be multiple if the vehicle is switching lanes or moving from one lane into another following lane.
@@ -54,6 +50,11 @@ message Vehicle
5450
/// The id of the driver of the (ego) vehicle.
5551
/// Field need not be set if ego_vehicle is set to false.
5652
optional Identifier driver = 10;
53+
54+
/// The vector pointing from the bounding box center point (base.position) to the middle (in x, y and z)
55+
/// of the front axle under neutral load conditions. In object coordinates.
56+
optional Vector3d bbcenter_to_front = 11;
57+
5758

5859
/// Definition of vehicle types.
5960
enum Type

0 commit comments

Comments
 (0)