mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 11:23:34 +08:00
[Multirotor] add yaw torque low pass filter (#24173)
co-authored-by: danielmellinger <107884356+danielmellinger@users.noreply.github.com> co-authored-by: Eric Katzfey <eric.katzfey@modalai.com>
This commit is contained in:
co-authored by
danielmellinger
Eric Katzfey
parent
974446c0e8
commit
8ecb76aba2
@@ -89,6 +89,16 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void setCutoffFreq(float cutoff_freq)
|
||||
{
|
||||
if (cutoff_freq > FLT_EPSILON) {
|
||||
_time_constant = 1.f / (M_TWOPI_F * cutoff_freq);
|
||||
|
||||
} else {
|
||||
_time_constant = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filter parameter alpha directly without time abstraction
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user