Skip to content

Feature/proj offset #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/spelling_custom_words_en_US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ abc
absteigen
adas
ADR
affine
agbl
al
Allgemeine
Expand Down Expand Up @@ -244,6 +245,7 @@ openscenario
optischen
Ordnung
osi
OSI's
osmp
Ouml
ouml
Expand Down
1 change: 1 addition & 0 deletions doc/architecture/reference_points_coordinate_systems.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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.

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.
Expand Down
51 changes: 50 additions & 1 deletion osi_groundtruth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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].
//
Expand Down Expand Up @@ -178,4 +179,52 @@ 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;
}

}