Skip to main content

DsfbRoboticsEngine

Struct DsfbRoboticsEngine 

Source
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>

Source

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.

Source

pub const fn from_envelope(envelope: AdmissibilityEnvelope) -> Self

Create an engine from an explicit envelope.

Source

pub fn set_envelope(&mut self, envelope: AdmissibilityEnvelope)

Replace the envelope (e.g. after online recalibration on a longer healthy window).

Source

pub fn envelope(&self) -> AdmissibilityEnvelope

Inspect the current envelope.

Source

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_floortrue if 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 to Episode::index for traceability.
Source

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.

Source

pub fn reset(&mut self)

Reset the streaming state (sign window + grammar hysteresis) without touching the envelope.

Use after a commissioning-to-operating transition to avoid pre-commissioning noise bleeding into the operating state.

Auto Trait Implementations§

§

impl<const W: usize, const K: usize> Freeze for DsfbRoboticsEngine<W, K>

§

impl<const W: usize, const K: usize> RefUnwindSafe for DsfbRoboticsEngine<W, K>

§

impl<const W: usize, const K: usize> Send for DsfbRoboticsEngine<W, K>

§

impl<const W: usize, const K: usize> Sync for DsfbRoboticsEngine<W, K>

§

impl<const W: usize, const K: usize> Unpin for DsfbRoboticsEngine<W, K>

§

impl<const W: usize, const K: usize> UnsafeUnpin for DsfbRoboticsEngine<W, K>

§

impl<const W: usize, const K: usize> UnwindSafe for DsfbRoboticsEngine<W, K>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.