mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 15:42:35 +08:00
manual_control: use constrain() instead
This commit is contained in:
committed by
Matthias Grob
parent
2a41ade223
commit
374c9f38a7
@@ -59,12 +59,7 @@ class MovingDiff
|
|||||||
public:
|
public:
|
||||||
void update(float value, float dt_s)
|
void update(float value, float dt_s)
|
||||||
{
|
{
|
||||||
if (dt_s < 0.0f) {
|
math::constrain(dt_s, 0.f, _time_period_s);
|
||||||
dt_s = 0.0f;
|
|
||||||
|
|
||||||
} else if (dt_s > _time_period_s) {
|
|
||||||
dt_s = _time_period_s;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Leave _diff at 0.0f if we don't have a _last_value yet.
|
// Leave _diff at 0.0f if we don't have a _last_value yet.
|
||||||
if (PX4_ISFINITE(_last_value)) {
|
if (PX4_ISFINITE(_last_value)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user