[wpimath] Add TimeInterpolatableBuffer (#2695)

These classes are useful for storing previous robot positions to use in conjunction with the upcoming pose estimators.

Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com>
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: cttew <cttewari@gmail.com>
This commit is contained in:
Matt
2021-12-30 20:08:05 -07:00
committed by GitHub
parent b8d019cdb4
commit 315be873c4
14 changed files with 485 additions and 20 deletions

View File

@@ -157,20 +157,6 @@ class WPILIB_DLLEXPORT Trajectory {
private:
std::vector<State> m_states;
units::second_t m_totalTime = 0_s;
/**
* Linearly interpolates between two values.
*
* @param startValue The start value.
* @param endValue The end value.
* @param t The fraction for interpolation.
*
* @return The interpolated value.
*/
template <typename T>
static T Lerp(const T& startValue, const T& endValue, const double t) {
return startValue + (endValue - startValue) * t;
}
};
WPILIB_DLLEXPORT