Skip to main content

StatePriors

Struct StatePriors 

Source
pub struct StatePriors { /* private fields */ }
Expand description

Initial 1σ priors where the fix provides none.

A fix usually gives horizontal accuracy, rarely course accuracy, never speed accuracy, and nothing about current. The defaults are deliberately loose: an estimator recovers from a loose prior within a few observations, never from a tight wrong one.

Start from StatePriors::standard and adjust with with_*; each rejects non-positive sigmas, so no component starts as exactly known.

Implementations§

Source§

impl StatePriors

Source

pub const fn standard() -> Self

Merchant vessel with standard GNSS, gyro and log: 10 m; heading 3°, or 104° (uniform over the circle) if unknown; speed 1 kn, or 10 kn if unknown; current 1 kn.

Source

pub fn with_position(self, sigma: Distance) -> Result<Self>

Sets the horizontal position sigma used when the fix gives no accuracy.

§Errors

KernelError::OutOfRange unless positive.

Source

pub fn with_heading(self, known: Angle, unknown: Angle) -> Result<Self>

Sets the heading sigmas: known for a heading without sigma or taken from COG; unknown when neither is available.

§Errors

KernelError::OutOfRange unless both positive.

Source

pub fn with_speed(self, known: Speed, unknown: Speed) -> Result<Self>

Sets the speed-through-water sigmas: known when taken from SOG; unknown when the fix has no speed.

§Errors

KernelError::OutOfRange unless both positive.

Source

pub fn with_current(self, sigma: Speed) -> Result<Self>

Sets the sigma of each current component (not directly observed).

§Errors

KernelError::OutOfRange unless positive.

Source

pub const fn position(&self) -> Distance

Horizontal position, when the fix gives no accuracy.

Source

pub const fn heading(&self) -> Angle

Heading, when given without sigma or taken from COG.

Source

pub const fn heading_unknown(&self) -> Angle

Heading, when neither heading nor course is available.

Source

pub const fn speed(&self) -> Speed

Speed through the water, taken from SOG.

Source

pub const fn speed_unknown(&self) -> Speed

Speed through the water, when the fix has no speed.

Source

pub const fn current(&self) -> Speed

Each current component.

Trait Implementations§

Source§

impl Clone for StatePriors

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StatePriors

Source§

impl Debug for StatePriors

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for StatePriors

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StatePriors

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.