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:
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:
enabledindicates whether to use the proj library to use the custom geodetic datum when converting coordinates from ECEF to LLH.ecef_crsis the source CRS for ECEF coordinates.llh_crsis 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:
sudo apt update
sudo apt install curl sqlite3
Then, head to the root of the fixposition_driver repository and run the following script:
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:
source /opt/ros/$ROS_DISTRO/setup.bash
Then, build the ROS2 driver node and all its dependencies with:
colcon build --symlink-install --cmake-args -DBUILD_TESTING=OFF -DFPSDK_USE_PROJ=ON
Lastly, source the development environment:
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.
WGS84 (Used on VRTK2 for FP_A-LLH, NMEA-Gx-GGA, etc. outputs):
ecef_crs: "EPSG:4978" (https://epsg.io/4978)llh_crs: "EPSG:4979" (https://epsg.io/4979)
For example, if correction data is in ETRS89, and you want LLH coordinates in WGS84:
ecef_crs: "EPSG:4936" (https://epsg.io/4936)llh_crs: "EPSG:4326" (https://epsg.io/4326)
NAD83(2011) - US coverage:
ecef_crs: "EPSG:6317" (https://epsg.io/6317)llh_crs: "EPSG:6319" (https://epsg.io/6319)
NAD83(CSRS) - Canada coverage:
ecef_crs: "EPSG:4954" (https://epsg.io/4954)llh_crs: "EPSG:4955" (https://epsg.io/4955)
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:
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:
Download the geoid grid into a known PROJ data dir:
projsync --file us_nga_egm08_25.tif --user-writable-directory
Ensure PROJ can see that directory (run everytime or set it in your launch environment):
export PROJ_DATA=/usr/share/proj:$HOME/.local/share/proj
Use a compound CRS for LLH + orthometric height. For example, EGM2008 vertical CRS is typically EPSG (line 3855), so the compound CRS is:
EPSG:4326+3855
Update the
config.yamlfile accordingly:
proj:
enabled: true
ecef_crs: "EPSG:4936"
llh_crs: "EPSG:4326+3855"
Verify the grid is picked up:
projinfo -o PROJ -s EPSG:4936 -t "EPSG:4326+3855"
If this step fails, copy the geoid grid into the system PROJ data dir:
sudo cp ~/.local/share/proj/us_nga_egm08_25.tif /usr/share/proj/