Loading...
Searching...
No Matches
ns3::SatSGP4MobilityModel Class Reference

Keep track of the current position and velocity of satellite using SGP4 model. More...

#include "satellite-sgp4-mobility-model.h"

Inheritance diagram for ns3::SatSGP4MobilityModel:
Collaboration diagram for ns3::SatSGP4MobilityModel:

Classes

struct  Matrix
 Matrix data structure to make coordinate conversion code clearer and less verbose. More...
struct  Row
 row of a Matrix More...

Public Member Functions

 SatSGP4MobilityModel ()
 Default constructor.
virtual ~SatSGP4MobilityModel ()
 Destructor.
Ptr< MobilityModel > Copy () const override
 Copy function allows one to copy the underlying MobilityModel from a MobilityModel pointer, by calling each children Copy implementation.
JulianDate GetStartTime () const
 Get the time instant considered as the simulation start.
virtual void NotifyConstructionCompleted () override
 Notifier called once the ObjectBase is fully constructed.
void SetStartDate (std::string startStr)
 Set the simulation absolute start time in string format.
void SetStartTime (const JulianDate &t)
 Set the time instant considered as the simulation start.
void SetTleInfo (const std::string &tle)
 Set satellite's TLE information required for its initialization.
Public Member Functions inherited from ns3::SatMobilityModel
 SatMobilityModel ()
 Default constructor.
virtual ~SatMobilityModel ()=0
 Destructor for SatMobilityModel.
double GetDistanceFrom (Ptr< const SatMobilityModel > position) const
GeoCoordinate GetGeoPosition (void) const
void NotifyGeoCourseChange (void) const
void SetGeoPosition (const GeoCoordinate &position)

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID.
Static Public Member Functions inherited from ns3::SatMobilityModel
static TypeId GetTypeId (void)
 Get the type ID.

Static Public Attributes

static const uint32_t TleSatInfoWidth = 69
 Satellite's information line size defined by TLE data format.
static const gravconsttype WGeoSys = wgs72
 World Geodetic System (WGS) constants to be used by SGP4/SDP4 models.

Private Member Functions

virtual GeoCoordinate DoGetGeoPosition () const
virtual Vector DoGetPosition () const
virtual Vector DoGetVelocity () const
virtual void DoSetGeoPosition (const GeoCoordinate &position)
virtual void DoSetPosition (const Vector &position)
JulianDate GetTleEpoch (void) const
 Retrieve the TLE epoch time.
bool IsInitialized (void) const
 Check if the satellite has already been initialized.

Static Private Member Functions

static Matrix PefToItrf (const JulianDate &t)
 Retrieve the matrix for converting from PEF to ITRF at a given time.
static Vector3D rTemeTorItrf (const Vector3D &rteme, const JulianDate &t)
 Retrieve the satellite's position vector in ITRF coordinates.
static Vector3D rvTemeTovItrf (const Vector3D &rteme, const Vector3D &vteme, const JulianDate &t)
 Retrieve the satellite's velocity vector in ITRF coordinates.
static Matrix TemeToPef (const JulianDate &t)
 Retrieve the matrix for converting from TEME to PEF at a given time.

Private Attributes

GeoCoordinate m_lastPosition
 Last saved satellite position.
elsetrec m_sgp4_record
 SGP4/SDP4 record.
JulianDate m_start
 Simulation absolute start time.
std::string m_startStr
 Simulation absolute start time in string format.
Time m_timeLastUpdate
 Last position update time.
std::string m_tle1
std::string m_tle2
 satellite's TLE data.
bool m_updatePositionEachRequest
 Compute position each time a packet is transmitted.
Time m_updatePositionPeriod
 Period of satellite position refresh, if UpdatePositionEachRequest is false.

Additional Inherited Members

Public Types inherited from ns3::SatMobilityModel
typedef void(* CourseChangeCallback) (const Ptr< const SatMobilityModel > model)
 Callback signature for SatCourseChange trace source.

Detailed Description

Keep track of the current position and velocity of satellite using SGP4 model.

Definition at line 46 of file satellite-sgp4-mobility-model.h.

Constructor & Destructor Documentation

◆ SatSGP4MobilityModel()

ns3::SatSGP4MobilityModel::SatSGP4MobilityModel ( )

Default constructor.

Definition at line 68 of file satellite-sgp4-mobility-model.cc.

References m_startStr, and m_timeLastUpdate.

◆ ~SatSGP4MobilityModel()

ns3::SatSGP4MobilityModel::~SatSGP4MobilityModel ( )
virtual

Destructor.

Definition at line 85 of file satellite-sgp4-mobility-model.cc.

Member Function Documentation

◆ Copy()

Ptr< MobilityModel > ns3::SatSGP4MobilityModel::Copy ( ) const
inlineoverridevirtual

Copy function allows one to copy the underlying MobilityModel from a MobilityModel pointer, by calling each children Copy implementation.

This is primarily used by wraparound models for the spectrum channel.

Returns
a copy of the current mobility model

Implements ns3::SatMobilityModel.

Definition at line 81 of file satellite-sgp4-mobility-model.h.

◆ DoGetGeoPosition()

GeoCoordinate ns3::SatSGP4MobilityModel::DoGetGeoPosition ( ) const
privatevirtual
Returns
the current position.

Concrete subclasses of this base class must implement this method.

Implements ns3::SatMobilityModel.

Definition at line 157 of file satellite-sgp4-mobility-model.cc.

References GetTleEpoch(), IsInitialized(), m_lastPosition, m_sgp4_record, m_start, m_timeLastUpdate, m_updatePositionEachRequest, m_updatePositionPeriod, rTemeTorItrf(), sgp4(), and WGeoSys.

Referenced by DoGetPosition(), and SetTleInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoGetPosition()

Vector ns3::SatSGP4MobilityModel::DoGetPosition ( void ) const
privatevirtual
Returns
cartesian format position as vector

Implementation for method defined by MobilityModel

Reimplemented from ns3::SatMobilityModel.

Definition at line 141 of file satellite-sgp4-mobility-model.cc.

References DoGetGeoPosition(), and ns3::GeoCoordinate::ToVector().

Here is the call graph for this function:

◆ DoGetVelocity()

Vector3D ns3::SatSGP4MobilityModel::DoGetVelocity ( ) const
privatevirtual

Definition at line 115 of file satellite-sgp4-mobility-model.cc.

References GetTleEpoch(), IsInitialized(), m_sgp4_record, m_start, rvTemeTovItrf(), sgp4(), and WGeoSys.

Here is the call graph for this function:

◆ DoSetGeoPosition()

void ns3::SatSGP4MobilityModel::DoSetGeoPosition ( const GeoCoordinate & position)
privatevirtual
Parameters
positionthe position to set.

Concrete subclasses of this base class must implement this method.

Implements ns3::SatMobilityModel.

Definition at line 192 of file satellite-sgp4-mobility-model.cc.

References m_lastPosition, and ns3::SatMobilityModel::NotifyGeoCourseChange().

Referenced by DoSetPosition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoSetPosition()

void ns3::SatSGP4MobilityModel::DoSetPosition ( const Vector & position)
privatevirtual
Parameters
positionposition in Cartesian format to set

Implementation for method defined by MobilityModel

Reimplemented from ns3::SatMobilityModel.

Definition at line 149 of file satellite-sgp4-mobility-model.cc.

References DoSetGeoPosition().

Here is the call graph for this function:

◆ GetStartTime()

JulianDate ns3::SatSGP4MobilityModel::GetStartTime ( ) const

Get the time instant considered as the simulation start.

Returns
a JulianDate object with the time considered as simulation start.

Definition at line 99 of file satellite-sgp4-mobility-model.cc.

References m_start.

◆ GetTleEpoch()

JulianDate ns3::SatSGP4MobilityModel::GetTleEpoch ( void ) const
private

Retrieve the TLE epoch time.

Returns
the TLE epoch time or 0h, 1 January 1992 if the satellite has not yet been initialized.

Definition at line 209 of file satellite-sgp4-mobility-model.cc.

References IsInitialized(), and m_sgp4_record.

Referenced by DoGetGeoPosition(), DoGetVelocity(), and SetTleInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::SatSGP4MobilityModel::GetTypeId ( void )
static

Get the type ID.

Returns
the object TypeId.

Definition at line 48 of file satellite-sgp4-mobility-model.cc.

References ns3::SatMobilityModel::SatMobilityModel(), m_updatePositionEachRequest, and m_updatePositionPeriod.

Here is the call graph for this function:

◆ IsInitialized()

bool ns3::SatSGP4MobilityModel::IsInitialized ( void ) const
private

Check if the satellite has already been initialized.

Returns
a boolean indicating whether the satellite is initialized.

Definition at line 201 of file satellite-sgp4-mobility-model.cc.

References m_sgp4_record, m_tle1, and m_tle2.

Referenced by DoGetGeoPosition(), DoGetVelocity(), and GetTleEpoch().

Here is the caller graph for this function:

◆ NotifyConstructionCompleted()

void ns3::SatSGP4MobilityModel::NotifyConstructionCompleted ( )
overridevirtual

Notifier called once the ObjectBase is fully constructed.

This method is invoked once all member attributes have been initialized. Subclasses can override this method to be notified of this event but if they do this, they must chain up to their parent's NotifyConstructionCompleted method.

Definition at line 76 of file satellite-sgp4-mobility-model.cc.

References m_startStr, and SetStartTime().

Here is the call graph for this function:

◆ PefToItrf()

SatSGP4MobilityModel::Matrix ns3::SatSGP4MobilityModel::PefToItrf ( const JulianDate & t)
staticprivate

Retrieve the matrix for converting from PEF to ITRF at a given time.

Parameters
tWhen.
Returns
the PEF-ITRF conversion matrix.

Definition at line 288 of file satellite-sgp4-mobility-model.cc.

References ns3::JulianDate::GetPolarMotion().

Referenced by rTemeTorItrf(), and rvTemeTovItrf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rTemeTorItrf()

Vector3D ns3::SatSGP4MobilityModel::rTemeTorItrf ( const Vector3D & rteme,
const JulianDate & t )
staticprivate

Retrieve the satellite's position vector in ITRF coordinates.

Parameters
tWhen.
Returns
the satellite's position vector in ITRF coordinates (meters).

Definition at line 267 of file satellite-sgp4-mobility-model.cc.

References PefToItrf(), and TemeToPef().

Referenced by DoGetGeoPosition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rvTemeTovItrf()

Vector3D ns3::SatSGP4MobilityModel::rvTemeTovItrf ( const Vector3D & rteme,
const Vector3D & vteme,
const JulianDate & t )
staticprivate

Retrieve the satellite's velocity vector in ITRF coordinates.

Parameters
tWhen.
Returns
the satellite's velocity vector in ITRF coordinates (m/s).

Definition at line 276 of file satellite-sgp4-mobility-model.cc.

References ns3::CrossProduct(), ns3::JulianDate::GetOmegaEarth(), PefToItrf(), and TemeToPef().

Referenced by DoGetVelocity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStartDate()

void ns3::SatSGP4MobilityModel::SetStartDate ( std::string startStr)

Set the simulation absolute start time in string format.

Parameters
startStrStart time of simulation, on format "YYYY-MM-DD hh:mm:ss"

Definition at line 90 of file satellite-sgp4-mobility-model.cc.

References m_startStr, and SetStartTime().

Referenced by ns3::SatHelper::SetSatMobility().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStartTime()

void ns3::SatSGP4MobilityModel::SetStartTime ( const JulianDate & t)

Set the time instant considered as the simulation start.

Parameters
tthe time instant to be considered as simulation start.

Definition at line 107 of file satellite-sgp4-mobility-model.cc.

References m_start.

Referenced by NotifyConstructionCompleted(), and SetStartDate().

Here is the caller graph for this function:

◆ SetTleInfo()

void ns3::SatSGP4MobilityModel::SetTleInfo ( const std::string & tle)

Set satellite's TLE information required for its initialization.

Parameters
tleThe two lines of the TLE data format.

Definition at line 222 of file satellite-sgp4-mobility-model.cc.

References DoGetGeoPosition(), GetTleEpoch(), m_sgp4_record, m_start, m_tle1, m_tle2, sgp4(), TleSatInfoWidth, twoline2rv(), and WGeoSys.

Referenced by ns3::SatHelper::SetSatMobility().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TemeToPef()

SatSGP4MobilityModel::Matrix ns3::SatSGP4MobilityModel::TemeToPef ( const JulianDate & t)
staticprivate

Retrieve the matrix for converting from TEME to PEF at a given time.

Parameters
tWhen.
Returns
the TEME-PEF conversion matrix.

Definition at line 318 of file satellite-sgp4-mobility-model.cc.

References ns3::JulianDate::GetGmst().

Referenced by rTemeTorItrf(), and rvTemeTovItrf().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_lastPosition

GeoCoordinate ns3::SatSGP4MobilityModel::m_lastPosition
mutableprivate

Last saved satellite position.

Definition at line 221 of file satellite-sgp4-mobility-model.h.

Referenced by DoGetGeoPosition(), and DoSetGeoPosition().

◆ m_sgp4_record

elsetrec ns3::SatSGP4MobilityModel::m_sgp4_record
mutableprivate

SGP4/SDP4 record.

Definition at line 166 of file satellite-sgp4-mobility-model.h.

Referenced by DoGetGeoPosition(), DoGetVelocity(), GetTleEpoch(), IsInitialized(), and SetTleInfo().

◆ m_start

JulianDate ns3::SatSGP4MobilityModel::m_start
private

Simulation absolute start time.

Definition at line 226 of file satellite-sgp4-mobility-model.h.

Referenced by DoGetGeoPosition(), DoGetVelocity(), GetStartTime(), SetStartTime(), and SetTleInfo().

◆ m_startStr

std::string ns3::SatSGP4MobilityModel::m_startStr
private

Simulation absolute start time in string format.

Definition at line 231 of file satellite-sgp4-mobility-model.h.

Referenced by SatSGP4MobilityModel(), NotifyConstructionCompleted(), and SetStartDate().

◆ m_timeLastUpdate

Time ns3::SatSGP4MobilityModel::m_timeLastUpdate
mutableprivate

Last position update time.

Definition at line 246 of file satellite-sgp4-mobility-model.h.

Referenced by SatSGP4MobilityModel(), and DoGetGeoPosition().

◆ m_tle1

std::string ns3::SatSGP4MobilityModel::m_tle1
private

Definition at line 165 of file satellite-sgp4-mobility-model.h.

Referenced by IsInitialized(), and SetTleInfo().

◆ m_tle2

std::string ns3::SatSGP4MobilityModel::m_tle2
private

satellite's TLE data.

Definition at line 165 of file satellite-sgp4-mobility-model.h.

Referenced by IsInitialized(), and SetTleInfo().

◆ m_updatePositionEachRequest

bool ns3::SatSGP4MobilityModel::m_updatePositionEachRequest
private

Compute position each time a packet is transmitted.

Definition at line 236 of file satellite-sgp4-mobility-model.h.

Referenced by DoGetGeoPosition(), and GetTypeId().

◆ m_updatePositionPeriod

Time ns3::SatSGP4MobilityModel::m_updatePositionPeriod
private

Period of satellite position refresh, if UpdatePositionEachRequest is false.

Definition at line 241 of file satellite-sgp4-mobility-model.h.

Referenced by DoGetGeoPosition(), and GetTypeId().

◆ TleSatInfoWidth

const uint32_t ns3::SatSGP4MobilityModel::TleSatInfoWidth = 69
static

Satellite's information line size defined by TLE data format.

Definition at line 52 of file satellite-sgp4-mobility-model.h.

Referenced by SetTleInfo().

◆ WGeoSys

const gravconsttype ns3::SatSGP4MobilityModel::WGeoSys = wgs72
static

World Geodetic System (WGS) constants to be used by SGP4/SDP4 models.

Definition at line 50 of file satellite-sgp4-mobility-model.h.

Referenced by DoGetGeoPosition(), DoGetVelocity(), and SetTleInfo().


The documentation for this class was generated from the following files: