pub struct Envelope {
pub max_tilt_rad: f32,
pub max_rate_radps: f32,
pub max_altitude_loss_m: f32,
pub settle: Settle,
pub settle_timeout_s: f32,
pub recovery_s: f32,
pub max_stale_s: f32,
}Expand description
Limits that end a stage, and how still the vehicle must be before a probe starts.
Fields§
§max_tilt_rad: f32Roll or pitch from level beyond this aborts the stage, in rad, in the probed loops’ frame
(Tunable::probe_frame): a tailsitter’s view, where nose-up hover is level.
max_rate_radps: f32A rate about any of the probed loops’ axes beyond this aborts the stage, in rad/s.
max_altitude_loss_m: f32Sinking more than this below the altitude at Autotune::start aborts, in m.
settle: SettleLevel and still enough to start a probe, unless the stage’s method sets its own
(Method::settle).
settle_timeout_s: f32How long to wait for a settle, in s. At the timeout a step fails the stage, and an identification starts anyway: a fit only gains excitation from a ringing loop.
recovery_s: f32After a probe on candidate gains ends, how long the vehicle has on the committed gains
to come back inside the limits before a breach fails the stage, in s. A breach while
the candidate flies fails only the candidate. After a freeze
(Autotune::note_stall), breaches don’t count for as long. Non-negative.
max_stale_s: f32How long the host may go without a fresh vehicle state
(Autotune::set_state_stale) before the run fails
HostFault, in s: meanwhile the vehicle flies on unseen.
Positive.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn large_copter() -> Self
pub fn large_copter() -> Self
Default’s limits, waiting up to 30 s to settle: a full-size multirotor brakes a
step’s sideways speed slowly, and the Alia 250’s sim model doesn’t level within the
default 10 s (#351).
The wait alone isn’t enough on a slow angle loop (angle P near 1, against 9 on the sim
airframes): guidance’s lateral loop must be slowed to match it too, or after a large
rate step the position hold and the angle loop swing against each other for longer than
the wait. At the Alia’s angle P (1.03), quad_x on core’s lateral loop swung at up
to 4 m/s and was still swinging after 30 s; on the Alia’s slower one it settled (#588).
§Examples
use stable_flight::tuning::autotune::Envelope;
assert_eq!(Envelope::large_copter().settle_timeout_s, 30.0);Sourcepub fn validate(&self) -> Result<(), InvalidConfig>
pub fn validate(&self) -> Result<(), InvalidConfig>
Checks that every limit and time is positive and finite, and that settling
(check_settle) is tighter than aborting.
Sourcepub fn check_settle(&self, settle: &Settle) -> Result<(), InvalidConfig>
pub fn check_settle(&self, settle: &Settle) -> Result<(), InvalidConfig>
Checks that settle is positive and tighter than the abort limits, that its hold fits
in settle_timeout_s, and that its speed is positive and finite.
Trait Implementations§
impl Copy for Envelope
Source§impl Default for Envelope
impl Default for Envelope
Source§fn default() -> Self
fn default() -> Self
Copter limits: 35° tilt, 4 rad/s, 3 m sink; settle within 6° of the attitude target and 0.3 rad/s for 1 s, waiting up to 10 s; 1 s to recover from a candidate; 2 s without a fresh state. RealFlight’s reconnects come 0.5, 1.5, and 3.5 s into an outage, so the run rides through the first two; a QuadCopterX unseen for 3.5 s mid-step rolled over (#309).
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Forget for Envelope
impl Freeze for Envelope
impl Move for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.