Fix geo latitude inversion unreal coordinates#9552
Open
csonthomisi wants to merge 2 commits intocarla-simulator:ue4-devfrom
Open
Fix geo latitude inversion unreal coordinates#9552csonthomisi wants to merge 2 commits intocarla-simulator:ue4-devfrom
csonthomisi wants to merge 2 commits intocarla-simulator:ue4-devfrom
Conversation
|
It seems that this is maybe not the best place and solution for this problem. I will try to implement a better solution next week. Until that, this should not be merged! Thanks for your patience! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug in the geo-coordinate conversion system where latitude values changed incorrectly (inverted sign) when moving north/south in maps using Transverse Mercator (tmerc) or Universal Transverse Mercator (UTM) projections without an explicit
<offset>tag in the OpenDRIVE file.Root Cause:
Unreal Engine uses a left-handed coordinate system while geographic projections (Transverse Mercator, UTM) assume a right-handed system. The projection inverse transforms did not account for this handedness mismatch, causing the northing (Y) component to have an inverted sign relative to latitude changes.
Changes Made:
TransformToGeoLocationTransverseMercator()to negate the Y-coordinate:double y = -((location.y - p.y_0) / p.k);TransformToGeoLocationUniversalTransverseMercator()to negate the Y-coordinate:double y = -((location.y - y_0) / k);Behavior Change:
Fixes #9530 #9389
Where has this been tested?
Possible Drawbacks
<offset>transform in OpenDRIVE may need validation to ensure the combined effect (offset negation + projection negation) is correct. However, the offset's OffsetTransform already applies a Y negation, so this change complements existing behavior.Files Changed
LibCarla/source/carla/geom/GeoProjection.cppThis change is