-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
980a6fe
commit 893cb31
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
tools/0012-geocentric-mobility-model-Switch-to-WGS84-as-default.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From 90b4b0fc9594f8bfcea45b59a938b07dbe017bf0 Mon Sep 17 00:00:00 2001 | ||
From: Giovanni Grieco <giovanni.grieco@poliba.it> | ||
Date: Thu, 13 Jul 2023 12:38:25 +0000 | ||
Subject: [PATCH] geocentric-mobility-model: Switch to WGS84 as default Earth | ||
Spheroid Type | ||
|
||
--- | ||
src/mobility/model/geocentric-mobility-model.cc | 9 +++++++-- | ||
1 file changed, 7 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/mobility/model/geocentric-mobility-model.cc b/src/mobility/model/geocentric-mobility-model.cc | ||
index bed9b8cae..9bcbf3339 100644 | ||
--- a/src/mobility/model/geocentric-mobility-model.cc | ||
+++ b/src/mobility/model/geocentric-mobility-model.cc | ||
@@ -37,7 +37,7 @@ GeocentricMobilityModel::GetTypeId() | ||
.SetGroupName("Mobility") | ||
.AddAttribute("EarthSpheroidType", | ||
"Spheroid model to use for Earth", | ||
- EnumValue(GeographicPositions::SPHERE), | ||
+ EnumValue(GeographicPositions::WGS84), | ||
MakeEnumAccessor(&GeocentricMobilityModel::m_earthSpheroidType), | ||
MakeEnumChecker(GeographicPositions::SPHERE, | ||
"SPHERE", | ||
@@ -56,6 +56,8 @@ GeocentricMobilityModel::GetTypeId() | ||
} | ||
|
||
GeocentricMobilityModel::GeocentricMobilityModel() | ||
+ : m_earthSpheroidType(GeographicPositions::WGS84), | ||
+ m_geographicReferencePoint({0.0, 0.0, 0.0}) | ||
{ | ||
} | ||
|
||
@@ -102,7 +104,10 @@ GeocentricMobilityModel::GetEarthSpheroidType() const | ||
Vector | ||
GeocentricMobilityModel::DoGetPosition() const | ||
{ | ||
- return DoGetPosition(PositionType::TOPOCENTRIC); | ||
+ // TODO: we should implement a proper way to understand what projection to use | ||
+ return (GetEarthSpheroidType() == GeographicPositions::EarthSpheroidType::WGS84) | ||
+ ? DoGetPosition(PositionType::PROJECTED) | ||
+ : DoGetPosition(PositionType::TOPOCENTRIC); | ||
} | ||
|
||
void | ||
-- | ||
2.41.0 | ||
|