Struct sensulator::Sensulator

source ·
pub struct Sensulator<'a, T: RngCore> { /* private fields */ }

Implementations§

Initialize an instance with

  • ctr_vl : The value that an ideal sensor would measure on every measurement.
  • abs_err_range : The accuracy of the sensor.
  • rel_err: The precision of the sensor.
  • rng: A random number generator to be used for simulation

Set the range of absolute error: the accuracy of the sensor.

Set the concrete offset of the simulator’s “sensed” measurement from the actual value.

Generally you should prefer set_absolute_error_range instead

Set the sensor simulator’s relative error: the precision of the sensor.

Set the sensor simulator’s “ideal” value. This will be adjusted by absolute and relative errors to provide simulated measurement noise.

Take a new measurement. This method updates the measured value.

Peek at the last measured value. This does not update the measured value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.