Skip to main content
Skip table of contents

Custom geodetic datum and orthometric height

The branch feature/proj of the ROS driver (located at https://github.com/fixposition/fixposition_driver/tree/feature/proj) presents a new configuration model to manually select the desired geodetic datums to convert ECEF coordinates to LLH.

The updated configuration file contains the following section:

YAML
proj:
  enabled: true               # Use PROJ for ECEF/LLH conversions
  ecef_crs: "EPSG:4978"       # Source CRS for ECEF coordinates
  llh_crs: "EPSG:4979"        # Target CRS for LLH coordinates

where:

  • enabled indicates whether to use the proj library to use the custom geodetic datum when converting coordinates from ECEF to LLH.

  • ecef_crs is the source CRS for ECEF coordinates.

  • llh_crs is the target CRS for LLH coordinates.


Instalation procedure

First, install the proj library. To do this, you must ensure all the required libraries are installed (see https://proj.org/en/9.4/install.html#build-requirements for more information). For example, here is a short snippet with some of the required libraries:

CODE
sudo apt update
sudo apt install curl sqlite3

Then, head to the root of the fixposition_driver repository and run the following script:

CODE
cd fixposition-sdk/docker/scripts/
sudo bash install_proj.sh

Source the setup.bash from the ROS2 distro repository (/opt/ros/{ROS_DISTRO}/setup.bash). For example:

CODE
source /opt/ros/$ROS_DISTRO/setup.bash

Then, build the ROS2 driver node and all its dependencies with:

CODE
colcon build --symlink-install --cmake-args -DBUILD_TESTING=OFF -DFPSDK_USE_PROJ=ON

Lastly, source the development environment:

CODE
source install/setup.bash

If the ROS2 driver was installed previously, make sure to clean the colcon workspace before running the previous commands. To ensure it is clean, run rm -rf build/ install/ log/.


Known transformations

For documentation on the definition of each coordinate frame, please refer to https://epsg.io/. For example, for WGS84: https://epsg.io/4979.


Orthometric height

The geoid height, N, can be used to convert a height above the ellipsoid, h, to the corresponding height above the geoid (roughly the height above mean sea level), H, using the relation:

h = N + H; H = -N + h.

To calculate the height above the geoid (normal altitude used in sectors such as mining), use the following equation:

CODE
Height above the Geoid = Height above the Ellipsoid - Geodetic Height

Where:

  • Height above the Geoid is the orthometric height.

  • Height above the Ellipsoid is the ellipsoidal height in Fixposition's output.

  • Geodetic Height is the height above the geoid model.

To enable this output, please follow these steps:

  1. Download the geoid grid into a known PROJ data dir:

CODE
projsync --file us_nga_egm08_25.tif --user-writable-directory
  1. Ensure PROJ can see that directory (run everytime or set it in your launch environment):

CODE
export PROJ_DATA=/usr/share/proj:$HOME/.local/share/proj
  1. Use a compound CRS for LLH + orthometric height. For example, EGM2008 vertical CRS is typically EPSG (line 3855), so the compound CRS is:

YAML
EPSG:4326+3855
  1. Update the config.yaml file accordingly:

YAML
proj:
  enabled: true
  ecef_crs: "EPSG:4936"
  llh_crs: "EPSG:4326+3855"
  1. Verify the grid is picked up:

CODE
projinfo -o PROJ -s EPSG:4936 -t "EPSG:4326+3855"

If this step fails, copy the geoid grid into the system PROJ data dir:

CODE
sudo cp ~/.local/share/proj/us_nga_egm08_25.tif /usr/share/proj/

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.