Skip to content

Commit c9053e5

Browse files
authored
Merge pull request #794 from thomassedlmayer/feature/proj_offset
Feature/proj offset
2 parents ffcf413 + 274859c commit c9053e5

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.github/spelling_custom_words_en_US.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ abc
22
absteigen
33
adas
44
ADR
5+
affine
56
agbl
67
al
78
Allgemeine
@@ -244,6 +245,7 @@ openscenario
244245
optischen
245246
Ordnung
246247
osi
248+
OSI's
247249
osmp
248250
Ouml
249251
ouml

doc/architecture/reference_points_coordinate_systems.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The global coordinate system is an inertial x/y/z-coordinate system.
1313
The origin is the global reference point that is determined by the environment simulation.
1414
This reference point may be derived from map data or other considerations.
1515
Global coordinates can be mapped to a geographic coordinate system via `osi3::GroundTruth::proj_string`.
16+
Note that before applying any PROJ transformations to global coordinates, the `osi3::GroundTruth::proj_frame_offset` must be applied.
1617

1718
Host vehicle coordinate system::
1819
The host vehicle coordinate system's origin is defined to be at the center of the rear axle of the host vehicle.

osi_groundtruth.proto

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ message GroundTruth
133133
optional uint32 country_code = 13;
134134

135135
// Projection string that allows to transform all coordinates in GroundTruth
136-
// into a different cartographic projection.
136+
// into a different cartographic projection after the \c proj_frame_offset
137+
// has been applied.
137138
//
138139
// The string follows the PROJ rules for projections [1].
139140
//
@@ -178,4 +179,52 @@ message GroundTruth
178179
// Logical lanes used e.g. by traffic agents
179180
//
180181
repeated LogicalLane logical_lane = 19;
182+
183+
// Coordinate frame offset to be used for PROJ transformations.
184+
//
185+
optional ProjFrameOffset proj_frame_offset = 20;
186+
187+
//
188+
// \brief Coordinate frame offset to transform from OSI's global coordinate
189+
// system to a coordinate reference system to be used for given PROJ
190+
// transformations.
191+
//
192+
// If an offset is defined, always apply the \c proj_frame_offset on
193+
// global OSI coordinates before applying any transformations defined in
194+
// \c proj_string.
195+
//
196+
// To apply the offset, global coordinates are first translated by the given
197+
// positional offset (x,y,z). Then, the yaw angle is used to rotate around
198+
// the new origin.
199+
//
200+
// The offset is applied on global OSI coordinates using an affine
201+
// transformation with rotation around z-axis:
202+
//
203+
// xWorld = xOSI * cos(yaw) - yOSI * sin(yaw) + xOffset
204+
//
205+
// yWorld = xOSI * sin(yaw) + yOSI * cos(yaw) + yOffset
206+
//
207+
// zWorld = zOSI + zOffset
208+
//
209+
//
210+
// If no yaw is provided (recommended), the formulas simplify to:
211+
//
212+
// xWorld = xOSI + xOffset
213+
//
214+
// yWorld = yOSI + yOffset
215+
//
216+
// zWorld = zOSI + zOffset
217+
//
218+
message ProjFrameOffset
219+
{
220+
// Positional offset for relocation of the coordinate frame.
221+
//
222+
optional Vector3d position = 1;
223+
224+
// Yaw/heading angle for re-orientation of the coordinate frame around
225+
// the z-axis.
226+
//
227+
optional double yaw = 2;
228+
}
229+
181230
}

0 commit comments

Comments
 (0)