C-API: Add set/get origin, xyz2enh and enh2xyz functions#136
Open
CarawaySeed42 wants to merge 16 commits into
Open
C-API: Add set/get origin, xyz2enh and enh2xyz functions#136CarawaySeed42 wants to merge 16 commits into
CarawaySeed42 wants to merge 16 commits into
Conversation
Additive inverse of translation and rotation by modifiers should be applied to channel offsets to retain the global position. This is also necessary to get closer to parity with the Matlab API crg_mods function. Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
A function to change the global origin was added to the api. Because multiple functions now manipulate the Z channel, this functionality got its designated local function Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Since the heading angle offset is part of the global coordinate system definition, it should also be changable. Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Using the public header, a user has no access to the offset values. Thus a getter function is needed.
To further make use of the global offset values, the xyz2enh and enh2xyz evaluation functions have been translated from the Matlab-API. Now a user can transform between the coordinate systems of different CRG data or simply just get the global coordinates.
Previously offsetting the elevation had three cases: Full refline elevation profile, constant elevation and Z-channel only. When no refline was present, an offset was applied by changing the z-channel mean value. This is confusing and unneccesary, so now all elevation offsets are applied by offsetting the refline. This is also how the Matlab API does offsets. Also, Z-channel first and last values were never used, which made it even more confusing. Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Precalculate sinus and cosinus of phi offset to accelerate transformation from and to global coordinates. Also adjust spacing to match the existing codebase. Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Removed the unneccessary branch in the offset z channel function because the first and last values are now always modified. Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Collaborator
|
CCB discussion: Add test case for the new feature |
The C-API operates a little differently when it comes to rotating around the modifier refpoint compared to Matlab. This was adapted here and the channel offset Z function was manually merged from 431a950. Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
…rigin-feature Merge latest fixes of the additive inverse offset modifications. Signed-off-by: Patrick Kuemmerle <patrick.kuemmer@3d-mapping.de>
The latest merge had to change how the additive inverse offset is calculated and removed the offset change from the channel offset function. The result is that the origin setter had to be adapted. Signed-off-by: Patrick Kuemmerle <patrick.kuemmer@3d-mapping.de>
Signed-off-by: Patrick Kuemmerle <patrick.kuemmer@3d-mapping.de>
Rename the function from using the term "change" to "set" for consistency reasons. The term "change" was used to signify that the origin is not only set but modifications are taking place in the background. Signed-off-by: Patrick Kuemmerle <patrick.kuemmer@3d-mapping.de>
Remove the dataset id argument variant and only leave contact point variant. This variant existed because a contact point is not needed for this calculation. But forcing the use of a contact point makes it more consistent for users. Signed-off-by: Patrick Kuemmerle <patrick.kuemmer@3d-mapping.de>
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.
When using multiple CRGs or in conjuction with other external data (e.g. OpenDRIVE maps) it is helpful to be able to evaluate in the same coordinate system.
With this PR the ability to set the global coordinate system origin is added.
Additionally one can transform local crg coordinates to global coordinates analog to existing Matlab API functionality.
RESOLVES: #78