mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
a/math: Fix conversion warnings
This commit is contained in:
parent
32a893fd2b
commit
d8970f25f9
|
@ -49,7 +49,7 @@ namespace detail {
|
||||||
* before initializing the filter with the first sample.
|
* before initializing the filter with the first sample.
|
||||||
*/
|
*/
|
||||||
explicit LowPassIIR(Scalar cutoff_hz, Value const &val) noexcept
|
explicit LowPassIIR(Scalar cutoff_hz, Value const &val) noexcept
|
||||||
: state(val), time_constant(1.f / (2.f * M_PI * cutoff_hz))
|
: state(val), time_constant(static_cast<Scalar>(1.f / (2.f * M_PI * cutoff_hz)))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -82,7 +82,7 @@ namespace detail {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// get dt in seconds
|
// get dt in seconds
|
||||||
Scalar dt = time_ns_to_s(timestamp_ns - filter_timestamp_ns);
|
Scalar dt = static_cast<Scalar>(time_ns_to_s(timestamp_ns - filter_timestamp_ns));
|
||||||
//! @todo limit max dt?
|
//! @todo limit max dt?
|
||||||
Scalar weighted = dt * weight;
|
Scalar weighted = dt * weight;
|
||||||
Scalar alpha = weighted / (time_constant + weighted);
|
Scalar alpha = weighted / (time_constant + weighted);
|
||||||
|
|
Loading…
Reference in a new issue