Skip to content

Commit

Permalink
ns3: Update patch set
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniGrieco committed Jul 13, 2023
1 parent 980a6fe commit 893cb31
Showing 1 changed file with 47 additions and 0 deletions.
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

0 comments on commit 893cb31

Please sign in to comment.