pub struct DsfbRoboticsEngine<const W: usize, const K: usize> { /* private fields */ }Expand description
Streaming DSFB engine.
All state is stack-allocated. No heap, no unsafe, no std.
Implementations§
Source§impl<const W: usize, const K: usize> DsfbRoboticsEngine<W, K>
impl<const W: usize, const K: usize> DsfbRoboticsEngine<W, K>
Sourcepub const fn new(rho: f64) -> Self
pub const fn new(rho: f64) -> Self
Create an engine from an envelope radius, using the paper defaults for the boundary fraction and slew threshold.
Sourcepub const fn from_envelope(envelope: AdmissibilityEnvelope) -> Self
pub const fn from_envelope(envelope: AdmissibilityEnvelope) -> Self
Create an engine from an explicit envelope.
Sourcepub fn set_envelope(&mut self, envelope: AdmissibilityEnvelope)
pub fn set_envelope(&mut self, envelope: AdmissibilityEnvelope)
Replace the envelope (e.g. after online recalibration on a longer healthy window).
Sourcepub fn envelope(&self) -> AdmissibilityEnvelope
pub fn envelope(&self) -> AdmissibilityEnvelope
Inspect the current envelope.
Sourcepub fn observe_one(
&mut self,
norm: f64,
below_floor: bool,
context: RobotContext,
index: usize,
) -> Episode
pub fn observe_one( &mut self, norm: f64, below_floor: bool, context: RobotContext, index: usize, ) -> Episode
Observe a single residual norm and return the emitted episode.
norm—‖r(k)‖from the upstream observer.below_floor—trueif the sample is below the known noise floor (forces drift and slew to zero for this sample).context— current robot operating regime.index— sample index within the caller’s stream, passed through toEpisode::indexfor traceability.
Sourcepub fn observe(
&mut self,
residuals: &[f64],
out: &mut [Episode],
context: RobotContext,
) -> usize
pub fn observe( &mut self, residuals: &[f64], out: &mut [Episode], context: RobotContext, ) -> usize
Stream residuals into a caller-owned output buffer out,
emitting one episode per input sample.
Returns the number of episodes written. Never writes past
out.len(): if residuals.len() > out.len() the function
stops at capacity and returns out.len() (fail-closed,
advisory-only semantics). Passing context applies uniformly
to every sample in the call — callers that need to change
context mid-stream should invoke Self::observe_one in a
loop.