Keep track of the current position and velocity of satellite using SGP4 model. More...
#include "satellite-sgp4-mobility-model.h"
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. | |
Keep track of the current position and velocity of satellite using SGP4 model.
Definition at line 46 of file satellite-sgp4-mobility-model.h.
| ns3::SatSGP4MobilityModel::SatSGP4MobilityModel | ( | ) |
Default constructor.
Definition at line 68 of file satellite-sgp4-mobility-model.cc.
References m_startStr, and m_timeLastUpdate.
|
virtual |
Destructor.
Definition at line 85 of file satellite-sgp4-mobility-model.cc.
|
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.
Implements ns3::SatMobilityModel.
Definition at line 81 of file satellite-sgp4-mobility-model.h.
|
privatevirtual |
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().
|
privatevirtual |
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().
|
privatevirtual |
Definition at line 115 of file satellite-sgp4-mobility-model.cc.
References GetTleEpoch(), IsInitialized(), m_sgp4_record, m_start, rvTemeTovItrf(), sgp4(), and WGeoSys.
|
privatevirtual |
| position | the 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().
|
privatevirtual |
| position | position 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().
| JulianDate ns3::SatSGP4MobilityModel::GetStartTime | ( | ) | const |
Get the time instant considered as the simulation start.
Definition at line 99 of file satellite-sgp4-mobility-model.cc.
References m_start.
|
private |
Retrieve the TLE epoch time.
Definition at line 209 of file satellite-sgp4-mobility-model.cc.
References IsInitialized(), and m_sgp4_record.
Referenced by DoGetGeoPosition(), DoGetVelocity(), and SetTleInfo().
|
static |
Get the type ID.
Definition at line 48 of file satellite-sgp4-mobility-model.cc.
References ns3::SatMobilityModel::SatMobilityModel(), m_updatePositionEachRequest, and m_updatePositionPeriod.
|
private |
Check if the satellite has already been 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().
|
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().
|
staticprivate |
Retrieve the matrix for converting from PEF to ITRF at a given time.
| t | When. |
Definition at line 288 of file satellite-sgp4-mobility-model.cc.
References ns3::JulianDate::GetPolarMotion().
Referenced by rTemeTorItrf(), and rvTemeTovItrf().
|
staticprivate |
Retrieve the satellite's position vector in ITRF coordinates.
| t | When. |
Definition at line 267 of file satellite-sgp4-mobility-model.cc.
References PefToItrf(), and TemeToPef().
Referenced by DoGetGeoPosition().
|
staticprivate |
Retrieve the satellite's velocity vector in ITRF coordinates.
| t | When. |
Definition at line 276 of file satellite-sgp4-mobility-model.cc.
References ns3::CrossProduct(), ns3::JulianDate::GetOmegaEarth(), PefToItrf(), and TemeToPef().
Referenced by DoGetVelocity().
| void ns3::SatSGP4MobilityModel::SetStartDate | ( | std::string | startStr | ) |
Set the simulation absolute start time in string format.
| startStr | Start 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().
| void ns3::SatSGP4MobilityModel::SetStartTime | ( | const JulianDate & | t | ) |
Set the time instant considered as the simulation start.
| t | the 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().
| void ns3::SatSGP4MobilityModel::SetTleInfo | ( | const std::string & | tle | ) |
Set satellite's TLE information required for its initialization.
| tle | The 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().
|
staticprivate |
Retrieve the matrix for converting from TEME to PEF at a given time.
| t | When. |
Definition at line 318 of file satellite-sgp4-mobility-model.cc.
References ns3::JulianDate::GetGmst().
Referenced by rTemeTorItrf(), and rvTemeTovItrf().
|
mutableprivate |
Last saved satellite position.
Definition at line 221 of file satellite-sgp4-mobility-model.h.
Referenced by DoGetGeoPosition(), and DoSetGeoPosition().
|
mutableprivate |
SGP4/SDP4 record.
Definition at line 166 of file satellite-sgp4-mobility-model.h.
Referenced by DoGetGeoPosition(), DoGetVelocity(), GetTleEpoch(), IsInitialized(), and SetTleInfo().
|
private |
Simulation absolute start time.
Definition at line 226 of file satellite-sgp4-mobility-model.h.
Referenced by DoGetGeoPosition(), DoGetVelocity(), GetStartTime(), SetStartTime(), and SetTleInfo().
|
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().
|
mutableprivate |
Last position update time.
Definition at line 246 of file satellite-sgp4-mobility-model.h.
Referenced by SatSGP4MobilityModel(), and DoGetGeoPosition().
|
private |
Definition at line 165 of file satellite-sgp4-mobility-model.h.
Referenced by IsInitialized(), and SetTleInfo().
|
private |
satellite's TLE data.
Definition at line 165 of file satellite-sgp4-mobility-model.h.
Referenced by IsInitialized(), and SetTleInfo().
|
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().
|
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().
|
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().
|
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().