pub enum PlaneLoop {
RollRate,
PitchRate,
Roll,
Pitch,
}Expand description
A loop of the PlaneStabilizer that a tuning stage can replace.
Variants§
RollRate
Roll rate loop: a probe sets the roll rate setpoint, in rad/s.
PitchRate
Pitch rate loop: a probe sets the pitch rate setpoint, in rad/s.
Roll
Roll angle loop: a probe sets the bank setpoint, in rad.
Pitch
Pitch angle loop: a probe sets the pitch setpoint, in rad.
Implementations§
Source§impl PlaneLoop
impl PlaneLoop
Sourcepub fn axis(self) -> usize
pub fn axis(self) -> usize
The body axis this loop flies: 0 roll, 1 pitch.
§Examples
use stable_flight::stabilizers::plane::PlaneLoop;
assert_eq!(PlaneLoop::Pitch.axis(), 1);Sourcepub fn inner(self) -> Option<Self>
pub fn inner(self) -> Option<Self>
The rate loop under this angle loop; None for a rate loop.
§Examples
use stable_flight::stabilizers::plane::PlaneLoop;
assert_eq!(PlaneLoop::Roll.inner(), Some(PlaneLoop::RollRate));
assert_eq!(PlaneLoop::RollRate.inner(), None);Sourcepub fn gains(self, config: &PlaneStabilizerConfig) -> PlaneAxisGains
pub fn gains(self, config: &PlaneStabilizerConfig) -> PlaneAxisGains
The gains of this loop’s axis in config.
§Examples
use stable_flight::stabilizers::plane::{PlaneLoop, PlaneStabilizerConfig};
let mut config = PlaneStabilizerConfig::default();
let mut gains = PlaneLoop::Pitch.gains(&config);
gains.time_constant_s = 0.6;
PlaneLoop::PitchRate.set_gains(&mut config, gains);
assert_eq!(config.time_constant_s.y, 0.6);Sourcepub fn set_gains(
self,
config: &mut PlaneStabilizerConfig,
gains: PlaneAxisGains,
)
pub fn set_gains( self, config: &mut PlaneStabilizerConfig, gains: PlaneAxisGains, )
Sets the gains of this loop’s axis in config.
Trait Implementations§
impl Copy for PlaneLoop
impl Eq for PlaneLoop
impl StructuralPartialEq for PlaneLoop
Source§impl Tunable<PlaneLoop> for PlaneStabilizer
impl Tunable<PlaneLoop> for PlaneStabilizer
Source§fn start_probe(&mut self, target: PlaneLoop, config: ProbeConfig)
fn start_probe(&mut self, target: PlaneLoop, config: ProbeConfig)
Starts a probe on target: from the next stabilize,
a Probe with config sets that loop’s setpoint (see the “Tuning” section on the
module docs).
§Examples
use stable_flight::stabilizers::plane::{PlaneLoop, PlaneStabilizer, PlaneStabilizerConfig};
use stable_flight::tuning::{ProbeConfig, ProbeStatus, StepConfig, Tunable};
use stable_flight::{PlaneSetpoint, Setpoint, Stabilizer, VehicleState};
let mut stabilizer = PlaneStabilizer::new(PlaneStabilizerConfig::default());
let step = StepConfig { amplitude: 0.3, duration_s: 1.0, settle_band: 0.1, filter_hz: 0.0 };
stabilizer.start_probe(PlaneLoop::Roll, ProbeConfig::Step(step));
// Level, with a level setpoint: the step asks for 0.3 rad of bank, so the wing rolls right.
let level = Setpoint::Plane(PlaneSetpoint { thrust: 0.6, ..Default::default() });
let output = stabilizer.stabilize(0.004, &level, &VehicleState::default());
assert!(output.moments.x > 0.0);
assert!(matches!(stabilizer.probe(), Some((PlaneLoop::Roll, ProbeStatus::Running(_)))));
stabilizer.stop_probe(); // hands the roll loop back
assert!(Tunable::<PlaneLoop>::probe(&stabilizer).is_none());Source§fn probe(&self) -> Option<(PlaneLoop, ProbeStatus)>
fn probe(&self) -> Option<(PlaneLoop, ProbeStatus)>
Source§fn stop_probe(&mut self) -> Option<(PlaneLoop, ProbeStatus)>
fn stop_probe(&mut self) -> Option<(PlaneLoop, ProbeStatus)>
Source§fn probe_frame(&self) -> UnitQuaternion<f32>
fn probe_frame(&self) -> UnitQuaternion<f32>
View’s rotation for loops run in it (nose-up
hover reads level in a tailsitter’s view). The autotune supervisor reads tilt and
per-axis rates in this frame, so its envelope and settle judge the axes the loops fly. Read moreSource§impl Tunable<PlaneLoop> for QuadPlaneStabilizer
Plane probes, on the surfaces: they fly only while the plane side flies alone.
impl Tunable<PlaneLoop> for QuadPlaneStabilizer
Plane probes, on the surfaces: they fly only while the plane side flies alone.
Source§fn start_probe(&mut self, target: PlaneLoop, config: ProbeConfig)
fn start_probe(&mut self, target: PlaneLoop, config: ProbeConfig)
target with config, from the next tick. A running probe is handed
back first. Read moreSource§fn probe(&self) -> Option<(PlaneLoop, ProbeStatus)>
fn probe(&self) -> Option<(PlaneLoop, ProbeStatus)>
Source§fn stop_probe(&mut self) -> Option<(PlaneLoop, ProbeStatus)>
fn stop_probe(&mut self) -> Option<(PlaneLoop, ProbeStatus)>
Source§fn probe_frame(&self) -> UnitQuaternion<f32>
fn probe_frame(&self) -> UnitQuaternion<f32>
View’s rotation for loops run in it (nose-up
hover reads level in a tailsitter’s view). The autotune supervisor reads tilt and
per-axis rates in this frame, so its envelope and settle judge the axes the loops fly. Read moreSource§impl Tunable<PlaneLoop> for TailsitterStabilizer
Plane probes, on the plane side: they fly only while it does, and a transition ramp
interrupts them.
impl Tunable<PlaneLoop> for TailsitterStabilizer
Plane probes, on the plane side: they fly only while it does, and a transition ramp interrupts them.
Source§fn start_probe(&mut self, target: PlaneLoop, config: ProbeConfig)
fn start_probe(&mut self, target: PlaneLoop, config: ProbeConfig)
target with config, from the next tick. A running probe is handed
back first. Read moreSource§fn probe(&self) -> Option<(PlaneLoop, ProbeStatus)>
fn probe(&self) -> Option<(PlaneLoop, ProbeStatus)>
Source§fn stop_probe(&mut self) -> Option<(PlaneLoop, ProbeStatus)>
fn stop_probe(&mut self) -> Option<(PlaneLoop, ProbeStatus)>
Source§fn probe_frame(&self) -> UnitQuaternion<f32>
fn probe_frame(&self) -> UnitQuaternion<f32>
View’s rotation for loops run in it (nose-up
hover reads level in a tailsitter’s view). The autotune supervisor reads tilt and
per-axis rates in this frame, so its envelope and settle judge the axes the loops fly. Read moreAuto Trait Implementations§
impl Forget for PlaneLoop
impl Freeze for PlaneLoop
impl Move for PlaneLoop
impl RefUnwindSafe for PlaneLoop
impl Send for PlaneLoop
impl Sync for PlaneLoop
impl Unpin for PlaneLoop
impl UnsafeUnpin for PlaneLoop
impl UnwindSafe for PlaneLoop
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.