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. More...
 
virtual ~SatSGP4MobilityModel ()
 Destructor. More...
 
TypeId GetInstanceTypeId (void) const
 
JulianDate GetStartTime () const
 Get the time instant considered as the simulation start. More...
 
void SetStartTime (const JulianDate &t)
 Set the time instant considered as the simulation start. More...
 
void SetTleInfo (const std::string &tle)
 Set satellite's TLE information required for its initialization. More...
 
- Public Member Functions inherited from ns3::SatMobilityModel
 SatMobilityModel ()
 Default constructor. More...
 
virtual ~SatMobilityModel ()=0
 Destructor for SatMobilityModel. More...
 
GeoCoordinate GetGeoPosition (void) const
 
TypeId GetInstanceTypeId (void) const
 
void NotifyGeoCourseChange (void) const
 
void SetGeoPosition (const GeoCoordinate &position)
 

Static Public Member Functions

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

Static Public Attributes

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

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. More...
 
bool IsInitialized (void) const
 Check if the satellite has already been initialized. More...
 

Static Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

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

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

Constructor & Destructor Documentation

◆ SatSGP4MobilityModel()

ns3::SatSGP4MobilityModel::SatSGP4MobilityModel ( )

Default constructor.

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

References m_startStr, and SetStartTime().

+ Here is the call graph for this function:

◆ ~SatSGP4MobilityModel()

ns3::SatSGP4MobilityModel::~SatSGP4MobilityModel ( )
virtual

Destructor.

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

Member Function Documentation

◆ 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 145 of file satellite-sgp4-mobility-model.cc.

References elsetrec::error, 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 129 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 ( void  ) const
privatevirtual

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

References elsetrec::error, 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 176 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 137 of file satellite-sgp4-mobility-model.cc.

References DoSetGeoPosition().

+ Here is the call graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::SatSGP4MobilityModel::GetInstanceTypeId ( void  ) const

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

References GetTypeId().

+ Here is the call graph for this function:

◆ GetStartTime()

JulianDate ns3::SatSGP4MobilityModel::GetStartTime ( void  ) const

Get the time instant considered as the simulation start.

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

Definition at line 91 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 193 of file satellite-sgp4-mobility-model.cc.

References IsInitialized(), elsetrec::jdsatepoch, 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 45 of file satellite-sgp4-mobility-model.cc.

References m_startStr, m_updatePositionEachRequest, and m_updatePositionPeriod.

Referenced by GetInstanceTypeId().

+ Here is the caller 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 185 of file satellite-sgp4-mobility-model.cc.

References elsetrec::jdsatepoch, m_sgp4_record, m_tle1, and m_tle2.

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

+ Here is the caller 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 270 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 249 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 258 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:

◆ 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 99 of file satellite-sgp4-mobility-model.cc.

References m_start.

Referenced by SatSGP4MobilityModel().

+ 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 204 of file satellite-sgp4-mobility-model.cc.

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

+ Here is the call 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 300 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 196 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 141 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 201 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 206 of file satellite-sgp4-mobility-model.h.

Referenced by SatSGP4MobilityModel(), and GetTypeId().

◆ m_timeLastUpdate

Time ns3::SatSGP4MobilityModel::m_timeLastUpdate
mutableprivate

Last position update time.

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

Referenced by DoGetGeoPosition().

◆ m_tle1

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

Definition at line 140 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 140 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 211 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 216 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 49 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 47 of file satellite-sgp4-mobility-model.h.

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


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