mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +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:
|
||||
void update(float value, float dt_s)
|
||||
{
|
||||
if (dt_s < 0.0f) {
|
||||
dt_s = 0.0f;
|
||||
|
||||
} else if (dt_s > _time_period_s) {
|
||||
dt_s = _time_period_s;
|
||||
}
|
||||
math::constrain(dt_s, 0.f, _time_period_s);
|
||||
|
||||
// Leave _diff at 0.0f if we don't have a _last_value yet.
|
||||
if (PX4_ISFINITE(_last_value)) {
|
||||
|
||||
Reference in New Issue
Block a user