Skip to content

Added Proj integration#373

Merged
JanuszBedkowski merged 1 commit intomainfrom
mp/proj2
Mar 2, 2026
Merged

Added Proj integration#373
JanuszBedkowski merged 1 commit intomainfrom
mp/proj2

Conversation

@michalpelka
Copy link
Copy Markdown
Contributor

I am publishing current state of proj integration.
It seems to improve quality of geographics conversions (I am comparing it to airborne Lidar).

Zrzut ekranu 2026-02-25 023158

However I have some misaligment in height (about 3-5 meters):
image
I am consulting with experts in the field. It seems that is result of GNSS receiver in test data.

About this change:

  • I am adding Proj similar to opencv (download binaries on Windows, get from apt on Linux).
  • I've wrote CI pipeline to build Proj in github actions.
  • I've fixed height in pose grahp slam for GNSS.

What need to be done:

  • fixes for Linux build.

@michalpelka michalpelka added the help wanted Extra attention is needed label Feb 25, 2026
@michalpelka
Copy link
Copy Markdown
Contributor Author

I do not have idea how to install proj on Mac.

@michalpelka
Copy link
Copy Markdown
Contributor Author

Done research, I am little less stupid.

I think I understand what’s happening. The GPSA fix is the WGS84 height.
But the NMEA GGA message, in the alt field, has: “Antenna altitude above/below mean sea level.”
In the following fields there is the parameter u: “Undulation – the relationship between the geoid and the WGS84 ellipsoid.”

So you need to subtract (or add) u to alt to obtain the ellipsoidal height.

The data confirms this (from our system):
11984423415770 1747581809550 $GNGGA,092656.000,5036.007407,N,02258.318671,E,1,08,2.42,231.474,M,38.832,M,,*76
231.474 is the height above mean sea level.
38.832 is the geoid height above the ellipsoid.

The difference I’m seeing now in HDMapping is due to the fact that the mean sea level used in NMEA does not match the mean sea level used in ISOK.

@JanuszBedkowski
Copy link
Copy Markdown
Member

Done research, I am little less stupid.

I think I understand what’s happening. The GPSA fix is the WGS84 height. But the NMEA GGA message, in the alt field, has: “Antenna altitude above/below mean sea level.” In the following fields there is the parameter u: “Undulation – the relationship between the geoid and the WGS84 ellipsoid.”

So you need to subtract (or add) u to alt to obtain the ellipsoidal height.

The data confirms this (from our system): 11984423415770 1747581809550 $GNGGA,092656.000,5036.007407,N,02258.318671,E,1,08,2.42,231.474,M,38.832,M,,*76 231.474 is the height above mean sea level. 38.832 is the geoid height above the ellipsoid.

The difference I’m seeing now in HDMapping is due to the fact that the mean sea level used in NMEA does not match the mean sea level used in ISOK.

Michal --> this is very significant step to City Level mapping! Many THX

@michalpelka michalpelka force-pushed the mp/proj2 branch 7 times, most recently from 7604857 to 1f0ccde Compare February 25, 2026 21:25
@michalpelka
Copy link
Copy Markdown
Contributor Author

I had to update runner to ubuntu 24.04 - 22.04 had ancient proj in apt.

@michalpelka michalpelka added enhancement New feature or request and removed help wanted Extra attention is needed labels Feb 26, 2026
@michalpelka michalpelka marked this pull request as ready for review February 26, 2026 11:14
@michalpelka
Copy link
Copy Markdown
Contributor Author

It is ready for review! Ready for testing!

@michalpelka
Copy link
Copy Markdown
Contributor Author

here is how it looks like:
image

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates the PROJ library into the project to improve GNSS/geographic coordinate conversions and adds UI support for exporting data in multiple coordinate reference systems (with optional geoid models). It also updates CI and build scripts to install/link PROJ and adjusts GNSS usage in pose-graph SLAM to use the newly introduced projected coordinates.

Changes:

  • Add PROJ build integration (CMake + 3rd-party binary fetch on Windows; system dependency on Linux) and link it into core and the GUI app.
  • Refactor GNSS loading/projection APIs and migrate internal usage from x/y/alt to enu_x/enu_y/enu_z.
  • Update GitHub Actions workflows and Ubuntu dependency scripts to include libproj-dev and use Ubuntu 24.04 runners.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
ubuntu-24.04-apt-requirements.sh Adds libproj-dev to Ubuntu apt requirements.
core/src/pose_graph_loop_closure.cpp Switches pose-graph GNSS fusion to use enu_* coordinates.
core/src/gnss.cpp Adds PROJ-based projection/unprojection, geoid discovery, CRT conversion, and migrates GNSS fields to enu_*.
core/include/gnss.h Updates GNSS API and data model (enu_*), adds CRT identifiers and new conversion APIs.
core/CMakeLists.txt Links core targets against PROJ.
apps/multi_view_tls_registration/multi_view_tls_registration_gui.cpp Updates GNSS import/export UI to use new GNSS APIs; adds geoid/CRT export options.
apps/multi_view_tls_registration/CMakeLists.txt Links the GUI executable against PROJ.
CMakeLists.txt Includes new PROJ setup script.
3rdpartyBinary/Proj/CMakeLists.txt Adds PROJ discovery on Linux and prebuilt download on Windows.
.gitignore Ignores additional build directories.
.github/workflows/python-bindings-linux.yml Moves to ubuntu-24.04 and installs libproj-dev.
.github/workflows/cmake-linux.yml Moves to ubuntu-24.04, installs libproj-dev, and adjusts PKG_CONFIG_PATH.
.github/workflows/cmake-linux-deb.yml Moves to ubuntu-24.04 and installs libproj-dev.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Proj is a library for performing cartographic transformations and geodetic computations.
This commit integrates proj into the project, allowing for more accurate and flexible handling of geospatial data.
The data fron NMEA sequences are projected to local ENU coordinates for GNSS processing.
The ellipsoid height is obtained from the NMEA sequences instead of using mean sea level (MSL) height.
Added conversion to WPUWG92 and UTM.
Old code was kept to prevent breaking changes, but it is marked as deprecated and will be removed in future releases.

Signed-off-by: Michał Pełka <michalpelka@gmail.com>
@MapsHD MapsHD deleted a comment from Copilot AI Mar 1, 2026
@JanuszBedkowski JanuszBedkowski merged commit 8627652 into main Mar 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants