Firmware
Public Member Functions | List of all members
Integrator Class Reference

Public Member Functions

 Integrator (uint32_t auto_reset_interval=4000, bool coning_compensation=false)
 
 Integrator (const Integrator &)=delete
 
Integratoroperator= (const Integrator &)=delete
 
 Integrator (Integrator &&)=delete
 
Integratoroperator= (Integrator &&)=delete
 
bool put (const uint64_t &timestamp, const matrix::Vector3f &val, matrix::Vector3f &integral, uint32_t &integral_dt)
 Put an item into the integral. More...
 
bool put_with_interval (unsigned interval_us, matrix::Vector3f &val, matrix::Vector3f &integral, uint32_t &integral_dt)
 Put an item into the integral but provide an interval instead of a timestamp. More...
 
matrix::Vector3f get (bool reset, uint32_t &integral_dt)
 Get the current integral and reset the integrator if needed. More...
 
matrix::Vector3f get_and_filtered (bool reset, uint32_t &integral_dt, matrix::Vector3f &filtered_val)
 Get the current integral and reset the integrator if needed. More...
 
void set_autoreset_interval (uint32_t auto_reset_interval)
 Set auto reset interval during runtime. More...
 

Member Function Documentation

§ get()

matrix::Vector3f Integrator::get ( bool  reset,
uint32_t &  integral_dt 
)

Get the current integral and reset the integrator if needed.

Parameters
resetReset the integral to zero.
integral_dtGet the dt in us of the current integration (only if reset).
Returns
the integral since the last read-reset

§ get_and_filtered()

matrix::Vector3f Integrator::get_and_filtered ( bool  reset,
uint32_t &  integral_dt,
matrix::Vector3f &  filtered_val 
)

Get the current integral and reset the integrator if needed.

Additionally give the integral over the samples differentiated by the integration time (mean filtered values).

Parameters
resetReset the integral to zero.
integral_dtGet the dt in us of the current integration (only if reset).
filtered_valThe integral differentiated by the integration time.
Returns
the integral since the last read-reset

§ put()

bool Integrator::put ( const uint64_t &  timestamp,
const matrix::Vector3f &  val,
matrix::Vector3f &  integral,
uint32_t &  integral_dt 
)

Put an item into the integral.

Parameters
timestampTimestamp of the current value.
valItem to put.
integralCurrent integral in case the integrator did reset, else the value will not be modified
integral_dtGet the dt in us of the current integration (only if reset).
Returns
true if putting the item triggered an integral reset and the integral should be published.

§ put_with_interval()

bool Integrator::put_with_interval ( unsigned  interval_us,
matrix::Vector3f &  val,
matrix::Vector3f &  integral,
uint32_t &  integral_dt 
)

Put an item into the integral but provide an interval instead of a timestamp.

Parameters
interval_usInterval in us since last integration.
valItem to put.
integralCurrent integral in case the integrator did reset, else the value will not be modified
integral_dtGet the dt in us of the current integration (only if reset). Note that this values might not be accurate vs. hrt_absolute_time because it is just the sum of the supplied intervals.
Returns
true if putting the item triggered an integral reset and the integral should be published.

§ set_autoreset_interval()

void Integrator::set_autoreset_interval ( uint32_t  auto_reset_interval)
inline

Set auto reset interval during runtime.

This won't reset the integrator.

Parameters
auto_reset_intervalNew reset time interval for the integrator (+- 10%).

The documentation for this class was generated from the following files: