Represents a specific orbital ephemeris for an Earth-centered trajectory.
More...
#include <perturb.hpp>
Represents a specific orbital ephemeris for an Earth-centered trajectory.
This is the primary type in this library. Wraps the internal SGP4 record type perturb::sgp4::elsetrec
. Generally constructed via TLEs through Satellite::from_tle
constructors. Of particular importance is the Satellite::last_error
method which you can check to determine if there were any issues with TLE initialization or propagation. The primary method of running the SGP4 algorithm is the Satellite::propagate
method.
◆ Satellite() [1/2]
Construct from a raw SGP4 orbital record.
- Parameters
-
sat_rec | Pre-initialized SGP4 orbital record |
◆ Satellite() [2/2]
Construct and initialize from a pre-parsed TLE record.
Does not require any string parsing, so aight for embedded. Does the same initialization steps as perturb::sgp4::twoline2rv
and then uses perturb::sgp4::sgp4init
to fully initialize.
You probably don't want to parse a TLE string into a TwoLineElement
and then construct a Satellite
via this. You should instead use the Satellite::from_tle
constructor directly.
This is only useful if you don't want any IO (via the PERTURB_DISABLE_IO
flag), because then this and the Satellite(sgp4::elsetrec)
constructor are the only way of constructing a Satellite
object. It's up to you how you wanna construct the parsed perturb::TwoLineElement
object.
- Precondition
- The TLE must be valid and contain valid values.
- Parameters
-
tle | Parsed and valid TLE |
grav_model | Gravity constants to use (default GravModel::WGS72 ) |
◆ from_tle() [1/2]
Satellite perturb::Satellite::from_tle |
( |
char * |
line_1, |
|
|
char * |
line_2, |
|
|
GravModel |
grav_model = GravModel::WGS72 |
|
) |
| |
|
static |
Construct and initialize a Satellite
from a TLE record.
The strings are mutable because the underlying implementation in perturb::sgp4::twoline2rv
may modify the string during parsing. Left as mutable instead of internally copying for efficiency reasons as this may be okay for the caller.
- Parameters
-
- Returns
- An initialized
Satellite
◆ from_tle() [2/2]
Satellite perturb::Satellite::from_tle |
( |
std::string & |
line_1, |
|
|
std::string & |
line_2, |
|
|
GravModel |
grav_model = GravModel::WGS72 |
|
) |
| |
|
static |
Wrapper for Satellite::from_tle
that accepts C++ style strings.
- Parameters
-
line_1 | First line of TLE |
line_2 | Second line of TLE |
grav_model | Gravity constants to use (default GravModel::WGS72 ) |
- Returns
- An initialized
Satellite
◆ propagate()
Propagate the SGP4 model to a specific time point.
- Parameters
-
jd | Time point in UTC or UT1 |
posvel | Returned state vector in the TEME frame |
- Returns
- Issues during propagation, should usually be
Sgp4Error::NONE
◆ propagate_from_epoch()
Propagate the SGP4 model based on time around the epoch.
- Parameters
-
mins_from_epoch | Offset number of minutes around the epoch |
posvel | Returned state vector in the TEME frame |
- Returns
- Issues during propagation, should usually be
Sgp4Error::NONE
The documentation for this class was generated from the following files:
- /github/workspace/include/perturb/perturb.hpp
- /github/workspace/src/perturb.cpp