pub struct Targeter<'a, const V: usize, const O: usize> {
pub prop: &'a Propagator<SpacecraftDynamics>,
pub objectives: [Objective; O],
pub objective_frame: Option<Frame>,
pub variables: [Variable; V],
pub correction_frame: Option<LocalFrame>,
pub iterations: usize,
}
Expand description
An optimizer structure with V control variables and O objectives.
Fields§
§prop: &'a Propagator<SpacecraftDynamics>
The propagator setup (kind, stages, etc.)
objectives: [Objective; O]
The list of objectives of this targeter
objective_frame: Option<Frame>
An optional frame (and Cosm) to compute the objectives in. Needed if the propagation frame is separate from objectives frame (e.g. for B Plane targeting).
variables: [Variable; V]
The kind of correction to apply to achieve the objectives
correction_frame: Option<LocalFrame>
The frame in which the correction should be applied, must be either a local frame or inertial
iterations: usize
Maximum number of iterations
Implementations§
Source§impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>
Sourcepub fn try_achieve_fd(
&self,
initial_state: Spacecraft,
correction_epoch: Epoch,
achievement_epoch: Epoch,
almanac: Arc<Almanac>,
) -> Result<TargeterSolution<V, O>, TargetingError>
pub fn try_achieve_fd( &self, initial_state: Spacecraft, correction_epoch: Epoch, achievement_epoch: Epoch, almanac: Arc<Almanac>, ) -> Result<TargeterSolution<V, O>, TargetingError>
Differential correction using finite differencing
Source§impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>
Sourcepub fn try_achieve_dual(
&self,
initial_state: Spacecraft,
correction_epoch: Epoch,
achievement_epoch: Epoch,
almanac: Arc<Almanac>,
) -> Result<TargeterSolution<V, O>, TargetingError>
pub fn try_achieve_dual( &self, initial_state: Spacecraft, correction_epoch: Epoch, achievement_epoch: Epoch, almanac: Arc<Almanac>, ) -> Result<TargeterSolution<V, O>, TargetingError>
Differential correction using hyperdual numbers for the objectives
Source§impl<'a, const O: usize> Targeter<'a, 3, O>
impl<'a, const O: usize> Targeter<'a, 3, O>
Sourcepub fn delta_v(
prop: &'a Propagator<SpacecraftDynamics>,
objectives: [Objective; O],
) -> Self
pub fn delta_v( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply an impulsive delta-v correction.
Sourcepub fn delta_r(
prop: &'a Propagator<SpacecraftDynamics>,
objectives: [Objective; O],
) -> Self
pub fn delta_r( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self
Create a new Targeter which will MOVE the position of the spacecraft at the correction epoch
Sourcepub fn vnc(
prop: &'a Propagator<SpacecraftDynamics>,
objectives: [Objective; O],
) -> Self
pub fn vnc( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply an impulsive delta-v correction on all components of the VNC frame. By default, max step is 0.5 km/s.
Source§impl<'a, const O: usize> Targeter<'a, 4, O>
impl<'a, const O: usize> Targeter<'a, 4, O>
Sourcepub fn thrust_dir(
prop: &'a Propagator<SpacecraftDynamics>,
objectives: [Objective; O],
) -> Self
pub fn thrust_dir( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply a continuous thrust for the whole duration of the segment
Source§impl<'a, const O: usize> Targeter<'a, 7, O>
impl<'a, const O: usize> Targeter<'a, 7, O>
Sourcepub fn thrust_dir_rate(
prop: &'a Propagator<SpacecraftDynamics>,
objectives: [Objective; O],
) -> Self
pub fn thrust_dir_rate( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply a continuous thrust for the whole duration of the segment
Source§impl<'a, const O: usize> Targeter<'a, 10, O>
impl<'a, const O: usize> Targeter<'a, 10, O>
Sourcepub fn thrust_profile(
prop: &'a Propagator<SpacecraftDynamics>,
objectives: [Objective; O],
) -> Self
pub fn thrust_profile( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply a continuous thrust for the whole duration of the segment
Source§impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>
Sourcepub fn new(
prop: &'a Propagator<SpacecraftDynamics>,
variables: [Variable; V],
objectives: [Objective; O],
) -> Self
pub fn new( prop: &'a Propagator<SpacecraftDynamics>, variables: [Variable; V], objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply an impulsive delta-v correction.
Sourcepub fn in_frame(
prop: &'a Propagator<SpacecraftDynamics>,
variables: [Variable; V],
objectives: [Objective; O],
objective_frame: Frame,
) -> Self
pub fn in_frame( prop: &'a Propagator<SpacecraftDynamics>, variables: [Variable; V], objectives: [Objective; O], objective_frame: Frame, ) -> Self
Create a new Targeter which will apply an impulsive delta-v correction.
Sourcepub fn vnc_with_components(
prop: &'a Propagator<SpacecraftDynamics>,
variables: [Variable; V],
objectives: [Objective; O],
) -> Self
pub fn vnc_with_components( prop: &'a Propagator<SpacecraftDynamics>, variables: [Variable; V], objectives: [Objective; O], ) -> Self
Create a new Targeter which will apply an impulsive delta-v correction on the specified components of the VNC frame.
Sourcepub fn try_achieve_from(
&self,
initial_state: Spacecraft,
correction_epoch: Epoch,
achievement_epoch: Epoch,
almanac: Arc<Almanac>,
) -> Result<TargeterSolution<V, O>, TargetingError>
pub fn try_achieve_from( &self, initial_state: Spacecraft, correction_epoch: Epoch, achievement_epoch: Epoch, almanac: Arc<Almanac>, ) -> Result<TargeterSolution<V, O>, TargetingError>
Runs the targeter using finite differencing (for now).
Sourcepub fn apply(
&self,
solution: &TargeterSolution<V, O>,
almanac: Arc<Almanac>,
) -> Result<Spacecraft, TargetingError>
pub fn apply( &self, solution: &TargeterSolution<V, O>, almanac: Arc<Almanac>, ) -> Result<Spacecraft, TargetingError>
Apply a correction and propagate to achievement epoch. Also checks that the objectives are indeed matched
Sourcepub fn apply_with_traj(
&self,
solution: &TargeterSolution<V, O>,
almanac: Arc<Almanac>,
) -> Result<(Spacecraft, Traj<Spacecraft>), TargetingError>
pub fn apply_with_traj( &self, solution: &TargeterSolution<V, O>, almanac: Arc<Almanac>, ) -> Result<(Spacecraft, Traj<Spacecraft>), TargetingError>
Apply a correction and propagate to achievement epoch, return the final state and trajectory. Also checks that the objectives are indeed matched.
Trait Implementations§
Auto Trait Implementations§
impl<'a, const V: usize, const O: usize> Freeze for Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> !RefUnwindSafe for Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> Send for Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> Sync for Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> Unpin for Targeter<'a, V, O>
impl<'a, const V: usize, const O: usize> !UnwindSafe for Targeter<'a, V, O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.