use crate::cosmic::AstroError;
use crate::dynamics::guidance::GuidanceError;
use crate::errors::NyxError;
use crate::propagators::PropagationError;
use crate::Spacecraft;
use snafu::prelude::*;
pub mod prelude {
pub use super::{
targeter::*,
trajectory::{ExportCfg, Interpolatable, Traj},
Event, ScTraj, StateParameter,
};
pub use crate::cosmic::{try_achieve_b_plane, BPlane, BPlaneTarget, GuidanceMode, OrbitDual};
pub use crate::dynamics::{
Drag, Harmonics, OrbitalDynamics, PointMasses, SolarPressure, SpacecraftDynamics,
};
pub use crate::dynamics::{Dynamics, NyxError};
pub use crate::io::gravity::HarmonicsMem;
pub use crate::md::objective::Objective;
pub use crate::propagators::{IntegratorOptions, Propagator};
pub use crate::time::{Duration, Epoch, TimeUnits, Unit};
pub use crate::Spacecraft;
pub use crate::{State, TimeTagged};
pub use anise::prelude::*;
pub use std::sync::Arc;
}
pub mod trajectory;
pub(crate) mod events;
pub use events::{Event, EventEvaluator};
pub mod objective;
pub mod opti;
pub use opti::targeter;
pub type ScTraj = trajectory::Traj<Spacecraft>;
mod param;
pub use param::StateParameter;
pub use opti::target_variable::{Variable, Vary};
use self::trajectory::TrajError;
#[allow(clippy::result_large_err)]
#[derive(Debug, Snafu)]
#[snafu(visibility(pub(crate)))]
pub enum TargetingError {
#[snafu(display(
"The variables to be adjusted lead to an under-determined of the problem for the targeter"
))]
UnderdeterminedProblem,
#[snafu(display("Incorrectly configured variable: {msg}"))]
VariableError { msg: String },
#[snafu(display("Frame error in targeter: {msg}"))]
FrameError { msg: String },
#[snafu(display("Unsupported variable in problem: {var}"))]
UnsupportedVariable { var: String },
#[snafu(display("Verification of targeting solution failed: {msg}"))]
Verification { msg: String },
#[snafu(display("astro error during targeting: {source}"))]
Astro { source: AstroError },
#[snafu(display("targeting aborted, too many iterations"))]
TooManyIterations,
#[snafu(display("correction is ineffective at {action}: value at previous iteration {prev_val}, current value: {cur_val}"))]
CorrectionIneffective {
prev_val: f64,
cur_val: f64,
action: &'static str,
},
#[snafu(display("encountered a guidance error: {source}"))]
GuidanceError { source: GuidanceError },
#[snafu(display("not a finite burn"))]
NotFinite,
#[snafu(display("Jacobian is signular"))]
SingularJacobian,
#[snafu(display("propagation error during targeting: {source}"))]
PropError { source: PropagationError },
#[snafu(display("during an optimization, encountered {source}"))]
TargetingTrajError { source: TrajError },
#[snafu(display("during an optimization targets are too close"))]
TargetsTooClose,
}