nyx_space::dynamics::guidance

Struct Mnvr

Source
pub struct Mnvr {
    pub start: Epoch,
    pub end: Epoch,
    pub thrust_prct: f64,
    pub alpha_inplane_radians: CommonPolynomial,
    pub delta_outofplane_radians: CommonPolynomial,
    pub frame: LocalFrame,
}
Expand description

Mnvr defined a single maneuver. Direction MUST be in the VNC frame (Velocity / Normal / Cross). It may be used with a maneuver scheduler.

Fields§

§start: Epoch

Start epoch of the maneuver

§end: Epoch

End epoch of the maneuver

§thrust_prct: f64

TODO: Add a thruster group set to specify which set of thrusters to use for this maneuver, should be a key to a thruster (maybe change thruster to a hashmap actually now that I don’t care about embedded stuff). Thrust level, if 1.0 use all thruster available at full power TODO: Convert this to a common polynomial as well to optimize throttle, throttle rate (and accel?)

§alpha_inplane_radians: CommonPolynomial

The interpolation polynomial for the in-plane angle

§delta_outofplane_radians: CommonPolynomial

The interpolation polynomial for the out-of-plane angle

§frame: LocalFrame

The frame in which the maneuvers are defined.

Implementations§

Source§

impl Mnvr

Source

pub fn from_impulsive( dt: Epoch, vector: Vector3<f64>, frame: LocalFrame, ) -> Self

Creates an impulsive maneuver whose vector is the deltaV. TODO: This should use William’s algorithm

Source

pub fn from_time_invariant( start: Epoch, end: Epoch, thrust_lvl: f64, vector: Vector3<f64>, frame: LocalFrame, ) -> Self

Creates a maneuver from the provided time-invariant delta-v, in km/s

Source

pub fn vector(&self, epoch: Epoch) -> Vector3<f64>

Return the thrust vector computed at the provided epoch

Source

pub fn duration(&self) -> Duration

Return the duration of this maneuver

Source

pub fn antichronological(&self) -> bool

Return whether this is an antichronological maneuver

Source

pub fn direction(&self) -> Vector3<f64>

Returns the direction of the burn at the start of the burn, useful for setting new angles

Source

pub fn set_direction( &mut self, vector: Vector3<f64>, ) -> Result<(), GuidanceError>

Set the time-invariant direction for this finite burn while keeping the other components as they are

Source

pub fn rate(&self) -> Vector3<f64>

Returns the rate of direction of the burn at the start of the burn, useful for setting new angles

Source

pub fn set_rate(&mut self, rate: Vector3<f64>) -> Result<(), GuidanceError>

Set the rate of direction for this finite burn while keeping the other components as they are

Source

pub fn accel(&self) -> Vector3<f64>

Returns the acceleration of the burn at the start of the burn, useful for setting new angles

Source

pub fn set_accel(&mut self, accel: Vector3<f64>) -> Result<(), GuidanceError>

Set the acceleration of the direction of this finite burn while keeping the other components as they are

Source

pub fn set_direction_and_rates( &mut self, dir: Vector3<f64>, rate: Vector3<f64>, accel: Vector3<f64>, ) -> Result<(), GuidanceError>

Set the initial direction, direction rate, and direction acceleration for this finite burn

Trait Implementations§

Source§

impl Clone for Mnvr

Source§

fn clone(&self) -> Mnvr

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mnvr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Mnvr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Prints the polynomial with the least significant coefficients first

Source§

impl GuidanceLaw for Mnvr

Source§

fn direction(&self, osc: &Spacecraft) -> Result<Vector3<f64>, GuidanceError>

Returns a unit vector corresponding to the thrust direction in the inertial frame.
Source§

fn throttle(&self, osc: &Spacecraft) -> Result<f64, GuidanceError>

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.
Source§

fn next(&self, sc: &mut Spacecraft, _almanac: Arc<Almanac>)

Updates the state of the BaseSpacecraft for the next maneuver, e.g. prepares the controller for the next maneuver
Source§

fn achieved(&self, _osc_state: &Spacecraft) -> Result<bool, GuidanceError>

Returns whether this thrust control has been achieved, if it has an objective
Source§

impl Copy for Mnvr

Auto Trait Implementations§

§

impl Freeze for Mnvr

§

impl RefUnwindSafe for Mnvr

§

impl Send for Mnvr

§

impl Sync for Mnvr

§

impl Unpin for Mnvr

§

impl UnwindSafe for Mnvr

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T