From e9cb77205c69ac7966914c1c78c9c73a2f16d80b Mon Sep 17 00:00:00 2001 From: Thomas Sedlmayer Date: Fri, 22 Mar 2024 10:00:18 +0100 Subject: [PATCH 1/5] Add proj frame offset to groundtruth Signed-off-by: Thomas Sedlmayer --- osi_groundtruth.proto | 44 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/osi_groundtruth.proto b/osi_groundtruth.proto index 651ff7e81..d883db4bb 100644 --- a/osi_groundtruth.proto +++ b/osi_groundtruth.proto @@ -133,7 +133,8 @@ message GroundTruth optional uint32 country_code = 13; // Projection string that allows to transform all coordinates in GroundTruth - // into a different cartographic projection. + // into a different cartographic projection after the \c proj_frame_offset + // has been applied. // // The string follows the PROJ rules for projections [1]. // @@ -178,4 +179,45 @@ message GroundTruth // Logical lanes used e.g. by traffic agents // repeated LogicalLane logical_lane = 19; + + // Coordinate frame offset to be used for PROJ transformations. + // + optional ProjFrameOffset proj_frame_offset = 20; + + // + // \brief Coordinate frame offset to transform from OSI's global coordinate + // system to a coordinate reference system to be used for given PROJ + // transformations. + // + // If an offset is defined, always apply the \c proj_frame_offset on + // global OSI coordinates before applying any transformations defined in + // \c proj_string. + // + // To apply the offset, global coordinates are first translated by the given + // positional offset (x,y,z). Then, the yaw angle is used to rotate around + // the new origin. + // + // The offset is applied on global OSI coordinates using an affine + // transformation with rotation around z-axis: + // xWorld = xOSI * cos(yaw) - yOSI * sin(yaw) + xOffset + // yWorld = xOSI * sin(yaw) + yOSI * cos(yaw) + yOffset + // zWorld = zOSI + zOffset + // + // If no yaw is provided (recommended), the formulas simplify to: + // xWorld = xOSI + xOffset + // yWorld = yOSI + yOffset + // zWorld = zOSI + zOffset + // + message ProjFrameOffset + { + // Positional offset for relocation of the coordinate frame. + // + optional Vector3d position = 1; + + // Yaw/heading angle for re-orientation of the coordinate frame around + // the z-axis. + // + optional double yaw = 2; + } + } From 4930e3b90be30e50d5929ecd22c9f1d14b67c102 Mon Sep 17 00:00:00 2001 From: Thomas Sedlmayer Date: Fri, 22 Mar 2024 10:14:55 +0100 Subject: [PATCH 2/5] Add spelling exceptions Signed-off-by: Thomas Sedlmayer --- .github/spelling_custom_words_en_US.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/spelling_custom_words_en_US.txt b/.github/spelling_custom_words_en_US.txt index a88e44be9..592d59468 100644 --- a/.github/spelling_custom_words_en_US.txt +++ b/.github/spelling_custom_words_en_US.txt @@ -2,6 +2,7 @@ abc absteigen adas ADR +affine agbl al Allgemeine @@ -244,6 +245,7 @@ openscenario optischen Ordnung osi +OSI's osmp Ouml ouml From a604f5a05fd7820a81e38aadb9618af8c0f7417d Mon Sep 17 00:00:00 2001 From: Thomas Sedlmayer Date: Fri, 22 Mar 2024 10:25:34 +0100 Subject: [PATCH 3/5] Add empty lines for better formatting in doxygen Signed-off-by: Thomas Sedlmayer --- osi_groundtruth.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osi_groundtruth.proto b/osi_groundtruth.proto index d883db4bb..ddcb25e96 100644 --- a/osi_groundtruth.proto +++ b/osi_groundtruth.proto @@ -199,13 +199,20 @@ message GroundTruth // // The offset is applied on global OSI coordinates using an affine // transformation with rotation around z-axis: + // // xWorld = xOSI * cos(yaw) - yOSI * sin(yaw) + xOffset + // // yWorld = xOSI * sin(yaw) + yOSI * cos(yaw) + yOffset + // // zWorld = zOSI + zOffset // + // // If no yaw is provided (recommended), the formulas simplify to: + // // xWorld = xOSI + xOffset + // // yWorld = yOSI + yOffset + // // zWorld = zOSI + zOffset // message ProjFrameOffset From 66218d756b3aadb97270bbfefe42f57edf40c069 Mon Sep 17 00:00:00 2001 From: Thomas Sedlmayer Date: Fri, 22 Mar 2024 13:52:12 +0100 Subject: [PATCH 4/5] Add proj frame offset explanations to documentation Signed-off-by: Thomas Sedlmayer --- doc/architecture/reference_points_coordinate_systems.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/architecture/reference_points_coordinate_systems.adoc b/doc/architecture/reference_points_coordinate_systems.adoc index 4c6ea7343..c2eb3fe95 100644 --- a/doc/architecture/reference_points_coordinate_systems.adoc +++ b/doc/architecture/reference_points_coordinate_systems.adoc @@ -12,7 +12,7 @@ Coordinate system for all entities that are part of ground truth. The global coordinate system is an inertial x/y/z-coordinate system. The origin is the global reference point that is determined by the environment simulation. This reference point may be derived from map data or other considerations. -Global coordinates can be mapped to a geographic coordinate system via `osi3::GroundTruth::proj_string`. +Global coordinates can be mapped to a geographic coordinate system via `osi3::GroundTruth::proj_string`. Note that before applying any PROJ transformations to global coordinates, the `osi3::GroundTruth::proj_frame_offset` must be applied. Host vehicle coordinate system:: The host vehicle coordinate system's origin is defined to be at the center of the rear axle of the host vehicle. From 274859c9f6c62a7665907987567945806d8136f3 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 22 Mar 2024 16:49:10 +0100 Subject: [PATCH 5/5] Formatting fix Signed-off-by: Pierre R. Mai --- doc/architecture/reference_points_coordinate_systems.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/architecture/reference_points_coordinate_systems.adoc b/doc/architecture/reference_points_coordinate_systems.adoc index c2eb3fe95..b32eb8392 100644 --- a/doc/architecture/reference_points_coordinate_systems.adoc +++ b/doc/architecture/reference_points_coordinate_systems.adoc @@ -12,7 +12,8 @@ Coordinate system for all entities that are part of ground truth. The global coordinate system is an inertial x/y/z-coordinate system. The origin is the global reference point that is determined by the environment simulation. This reference point may be derived from map data or other considerations. -Global coordinates can be mapped to a geographic coordinate system via `osi3::GroundTruth::proj_string`. Note that before applying any PROJ transformations to global coordinates, the `osi3::GroundTruth::proj_frame_offset` must be applied. +Global coordinates can be mapped to a geographic coordinate system via `osi3::GroundTruth::proj_string`. +Note that before applying any PROJ transformations to global coordinates, the `osi3::GroundTruth::proj_frame_offset` must be applied. Host vehicle coordinate system:: The host vehicle coordinate system's origin is defined to be at the center of the rear axle of the host vehicle.