Trait nyx_space::dynamics::guidance::GuidanceLaw
source · pub trait GuidanceLaw<X: SpacecraftExt>: Display + Send + Sync {
// Required methods
fn direction(&self, osc_state: &BaseSpacecraft<X>) -> Vector3<f64>;
fn throttle(&self, osc_state: &BaseSpacecraft<X>) -> f64;
fn next(&self, next_state: &mut BaseSpacecraft<X>);
// Provided method
fn achieved(&self, _osc_state: &BaseSpacecraft<X>) -> Result<bool, NyxError> { ... }
}
Expand description
The GuidanceLaw
trait handles guidance laws, optimizations, and other such methods for
controlling the overall thrust direction when tied to a Spacecraft
. For delta V control,
tie the DeltaVctrl to a MissionArc.
Required Methods§
sourcefn direction(&self, osc_state: &BaseSpacecraft<X>) -> Vector3<f64>
fn direction(&self, osc_state: &BaseSpacecraft<X>) -> Vector3<f64>
Returns a unit vector corresponding to the thrust direction in the inertial frame.
sourcefn throttle(&self, osc_state: &BaseSpacecraft<X>) -> f64
fn throttle(&self, osc_state: &BaseSpacecraft<X>) -> f64
Returns a number between [0;1] corresponding to the engine throttle level. For example, 0 means coasting, i.e. no thrusting, and 1 means maximum thrusting.
sourcefn next(&self, next_state: &mut BaseSpacecraft<X>)
fn next(&self, next_state: &mut BaseSpacecraft<X>)
Updates the state of the spacecraft for the next maneuver, e.g. prepares the controller for the next maneuver