-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lowpass & refactor filter structure
- Fixed second order lowpass - Use the filtered signal for PID calculations - Add a derivative filter
- Loading branch information
Showing
11 changed files
with
436 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include <path_tracking_pid/details/fifo_array.hpp> | ||
|
||
namespace path_tracking_pid::details | ||
{ | ||
/** | ||
* @brief discrete time derivative filter | ||
*/ | ||
class Derivative | ||
{ | ||
public: | ||
/** | ||
* @brief Construct a Derivative instance | ||
*/ | ||
Derivative(); | ||
|
||
/** | ||
* @brief filter one sample of a signal | ||
* @param u signal to be filtered | ||
* @param step_size | ||
* @return derivative of the signal | ||
*/ | ||
double filter(double u, double step_size); | ||
|
||
void reset(); | ||
|
||
private: | ||
FifoArray<double, 2> u_ = {}; | ||
}; | ||
|
||
} // namespace path_tracking_pid::details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.