Gravity Engine 2 5.1
|
Class to determine the maneuvers required to get a ship at an existing position in orbit around a center body to a specified orbit. More...
Public Member Functions | |
TransferShip (GEBodyState shipState, Orbital.COE toOrbit, double mu, double circleThreshold=Orbital.SMALL_E, bool checkHit=false, double planetRadius=0.0, bool retrograde=false, bool legacyRetrograde=false) | |
Constructor for case with a target orbit. | |
Status | Compute (TargetMode targetMode) |
double | GetDvTotal () |
List< GEManeuver > | Maneuvers (int centerId=-1, GEPhysicsCore.Propagator propagator=GEPhysicsCore.Propagator.UNASSIGNED, bool keplerTranfer=false) |
Return the list of maneuvers. These will be maneuvers relative to some centerId and will be set to begin at t=0. | |
void | SetTargetPoint (double3 p) |
Set the transfer point in GE internal units. | |
void | SetTimeFactor (double tf) |
void | SetTimeMode (LambertTimeType timeMode) |
void | SetTimeTransfer (double t) |
double | TimeComplete () |
The relative time from start of maneuvers when the sequence will be complete. This will always be the time of the last maneuver. | |
Public Attributes | |
bool | lambertAlways = false |
Class to determine the maneuvers required to get a ship at an existing position in orbit around a center body to a specified orbit.
There are two general classes of ship transfers: SHIP_TO_ORBIT: Transfer the ship to a designated target orbit, but do not care which exact point the target orbit is entered.
SHIP_TO_TARGET: Transfer the ship to the position of a target object or a target point in physics space. This can be either a rendezvous (in which a second maneuver will match the target's velocity) or intercept in which there is no second maneuver.
SHIP_TO_POINT: Determine a transfer that gets the ship to the point specified. The point must be set with SetTransferPoint()
The specific transfer mode can be one of: BEST: If the orbits are circular, do Hohmann. Otherwise do a LAMBERT. CIRCULARIZE: HOHMANN: Explicitly request a Hohmann transfer. May fail if orbits are not circular. LAMBERT: Perform a LAMBERT transfer using the timeFactor * t_minimumEnergy for the indicated start and end points.
Q: What is end point for a Lambert to a target orbit??
In all cases (except to a target point) the constructor is given the state of the ship and the COE of the target.
These algorithms all assume the ship and target are in orbit around the same central body. This is not explicitly verified.
This code is not a Monobehaviour. To use in an object in a scene see GSTransferShip which is the "in scene" wrapper.
The maneuvers are computed via a call to Compute() and once done maneuvers can be retrieved via Maneuvers(). The caller then needs to add these to GE (using the correct bodyId and time offset)
GravityEngine2.TransferShip.TransferShip | ( | GEBodyState | shipState, |
Orbital::COE | toOrbit, | ||
double | mu, | ||
double | circleThreshold = Orbital::SMALL_E, | ||
bool | checkHit = false, | ||
double | planetRadius = 0::0, | ||
bool | retrograde = false, | ||
bool | legacyRetrograde = false ) |
Constructor for case with a target orbit.
shipState | Ship state relative to the central body |
toOrbit | |
mu | mu for the central body (from ge.GetMu() or G*M) |
List< GEManeuver > GravityEngine2.TransferShip.Maneuvers | ( | int | centerId = -1, |
GEPhysicsCore::Propagator | propagator = GEPhysicsCore::Propagator::UNASSIGNED, | ||
bool | keplerTranfer = false ) |
Return the list of maneuvers. These will be maneuvers relative to some centerId and will be set to begin at t=0.
In cases other than PKEPELR and SGP4 propagation the default values for the remaining parameters are appropriate.
In cases where SGP4 or PKEPLER is use it is sometimes desirable to change the propagator for the intermediate legs of the transfer to be KEPLER because this is what te tranfer algorithm uses when computing the transfer. Since in general a body cannot (yet?) switch a propagator in the middle of physics evolution tsuch bodies must be configured as patched so each leg of the maneuver is a patch segment. These can then have different propagators.
centerId | the optional centerId to assign to the maneuvers |
propagator | the propagator for the ship after transfer |
keplerTranfer | if true, then the intermediate maneuvers will be patched Kepler segments |
void GravityEngine2.TransferShip.SetTargetPoint | ( | double3 | p | ) |
Set the transfer point in GE internal units.
p |
double GravityEngine2.TransferShip.TimeComplete | ( | ) |
The relative time from start of maneuvers when the sequence will be complete. This will always be the time of the last maneuver.