1use crate::cosmic::AstroError;
20use crate::dynamics::guidance::GuidanceError;
21use crate::propagators::PropagationError;
22use crate::Spacecraft;
23use snafu::prelude::*;
24
25pub mod prelude {
26 pub use super::{
27 targeter::*,
28 trajectory::{ExportCfg, Interpolatable, Traj},
29 StateParameter, Trajectory,
30 };
31 pub use crate::cosmic::{try_achieve_b_plane, BPlane, BPlaneTarget, GuidanceMode};
32 pub use crate::dynamics::{
33 Drag, Harmonics, OrbitalDynamics, PointMasses, SolarPressure, SpacecraftDynamics,
34 };
35 pub use crate::dynamics::{Dynamics, NyxError};
36 pub use crate::io::gravity::HarmonicsMem;
37 pub use crate::md::objective::Objective;
38 pub use crate::propagators::{IntegratorOptions, Propagator};
39 pub use crate::time::{Duration, Epoch, TimeUnits, Unit};
40 pub use crate::Spacecraft;
41 pub use crate::{State, TimeTagged};
42
43 pub use anise::analysis::event::Event;
44 pub use anise::analysis::prelude::OrbitalElement;
45 pub use anise::prelude::*;
46 pub use std::sync::Arc;
47}
48
49pub mod trajectory;
50
51pub mod objective;
52pub mod opti;
53pub use opti::targeter;
54pub type Trajectory = trajectory::Traj<Spacecraft>;
55
56mod param;
57pub use param::StateParameter;
58
59pub use opti::target_variable::{Variable, Vary};
60
61use self::trajectory::TrajError;
62
63#[allow(clippy::result_large_err)]
64#[derive(Debug, Snafu)]
65#[snafu(visibility(pub(crate)))]
66pub enum TargetingError {
67 #[snafu(display(
68 "The variables to be adjusted lead to an under-determined of the problem for the targeter"
69 ))]
70 UnderdeterminedProblem,
71 #[snafu(display("Incorrectly configured variable: {msg}"))]
73 VariableError { msg: String },
74 #[snafu(display("Frame error in targeter: {msg}"))]
76 FrameError { msg: String },
77 #[snafu(display("Unsupported variable in problem: {var}"))]
79 UnsupportedVariable { var: String },
80 #[snafu(display("Verification of targeting solution failed: {msg}"))]
81 Verification { msg: String },
82 #[snafu(display("astro error during targeting: {source}"))]
83 Astro { source: AstroError },
84 #[snafu(display("targeting aborted, too many iterations"))]
85 TooManyIterations,
86 #[snafu(display("correction is ineffective at {action}: value at previous iteration {prev_val}, current value: {cur_val}"))]
87 CorrectionIneffective {
88 prev_val: f64,
89 cur_val: f64,
90 action: &'static str,
91 },
92 #[snafu(display("encountered a guidance error: {source}"))]
93 GuidanceError { source: GuidanceError },
94 #[snafu(display("not a finite burn"))]
95 NotFinite,
96 #[snafu(display("Jacobian is signular"))]
97 SingularJacobian,
98 #[snafu(display("propagation error during targeting: {source}"))]
99 PropError { source: PropagationError },
100 #[snafu(display("during an optimization, encountered {source}"))]
101 TargetingTrajError { source: TrajError },
102 #[snafu(display("during an optimization targets are too close"))]
103 TargetsTooClose,
104}