Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ dune_option(BLUEVIEW "Enable support for the BlueView SDK")
dune_option(OPENCV "Enable support for OpenCV")
dune_option(NO_RTTI "Disable support for RTTI")
dune_option(UEYE "Enable support for IDS uEye cameras")
dune_option(ELLIPSOIDAL "Enable ellipsoidal coordinates in (WGS84) displace")

# Internationalization.
include(${PROJECT_SOURCE_DIR}/cmake/I18N.cmake)
Expand Down Expand Up @@ -231,6 +232,11 @@ endif(DUNE_SHARED)

add_dependencies(dune-core dune-version)

# WGS84 Coordinate Type
if(ELLIPSOIDAL)
add_definitions(-DDUNE_ELLIPSOIDAL_DISPLACE)
endif(ELLIPSOIDAL)

##########################################################################
# Tasks #
##########################################################################
Expand Down
12 changes: 10 additions & 2 deletions src/DUNE/Coordinates/WGS84.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,15 @@ namespace DUNE
toECEF(*lat, *lon, *hae, &x, &y, &z);

// Compute Geocentric latitude
double phi = std::atan2(z, std::sqrt(x * x + y * y));
double p = std::sqrt(x * x + y * y);
#if defined(DUNE_ELLIPSOIDAL_DISPLACE)
// Use elliptical coordinates
double N = computeRn(*lat);
double phi = std::atan2(z,p*(1 - c_wgs84_e2 * N / (N + *hae)));
#else
// Use spherical coordinates
double phi = std::atan2(z,p);
#endif

// Compute all needed sine and cosine terms for conversion.
double slon = std::sin(*lon);
Expand Down Expand Up @@ -285,7 +293,6 @@ namespace DUNE
getNEBearingAndRange(lat1, lon1, lat2, lon2, azimuth, &tmp);
}

private:
//! Convert WGS-84 coordinates to ECEF (Earch Center Earth Fixed) coordinates.
//!
//! @param[in] lat WGS-84 latitude (rad).
Expand Down Expand Up @@ -347,6 +354,7 @@ namespace DUNE
}
}

private:
//! Compute the radius of curvature in the prime vertical (Rn).
//!
//! @param[in] lat WGS-84 latitude (rad).
Expand Down