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