Skip to content

C-API: Add set/get origin, xyz2enh and enh2xyz functions#136

Open
CarawaySeed42 wants to merge 8 commits into
masterfrom
c-api-add-set-origin-feature
Open

C-API: Add set/get origin, xyz2enh and enh2xyz functions#136
CarawaySeed42 wants to merge 8 commits into
masterfrom
c-api-add-set-origin-feature

Conversation

@CarawaySeed42

@CarawaySeed42 CarawaySeed42 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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

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>
@CarawaySeed42 CarawaySeed42 added the isState:InProgress An issue that is assigned a responsible, has a due date and clear requirements label Jun 11, 2026
Signed-off-by: Patrick Kuemmerle <patrick.kuemmerle@3d-mapping.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isState:InProgress An issue that is assigned a responsible, has a due date and clear requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C-API: Add relative offset change

1 participant