mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 04:43:34 +08:00
Work on LPE GPS delay.
This commit is contained in:
@@ -581,7 +581,7 @@ int blockDelayTest()
|
||||
{
|
||||
printf("Test BlockDelay\t\t\t: ");
|
||||
using namespace matrix;
|
||||
BlockDelay<float, 2, 3> delay(NULL, "TEST");
|
||||
BlockDelay<float, 2, 1, 3> delay(NULL, "TEST");
|
||||
Vector2f u1(1, 2);
|
||||
Vector2f y1 = delay.update(u1);
|
||||
ASSERT_CL(equal(y1(0), u1(0)));
|
||||
|
||||
@@ -601,7 +601,7 @@ private:
|
||||
|
||||
int __EXPORT blockStatsTest();
|
||||
|
||||
template<class Type, size_t M, size_t LEN>
|
||||
template<class Type, size_t M, size_t N, size_t LEN>
|
||||
class __EXPORT BlockDelay: public Block
|
||||
{
|
||||
public:
|
||||
@@ -615,7 +615,7 @@ public:
|
||||
{
|
||||
};
|
||||
virtual ~BlockDelay() {};
|
||||
matrix::Vector<Type, M> update(const matrix::Vector<Type, M> &u)
|
||||
matrix::Matrix<Type, M, N> update(const matrix::Matrix<Type, M, N> &u)
|
||||
{
|
||||
// store current value
|
||||
_h[_index] = u;
|
||||
@@ -644,9 +644,9 @@ public:
|
||||
// get delayed value
|
||||
return _h[j];
|
||||
}
|
||||
matrix::Vector<Type, M> get()
|
||||
matrix::Matrix<Type, M, N> get(size_t delay)
|
||||
{
|
||||
int j = _index - _delay;
|
||||
int j = _index - delay;
|
||||
|
||||
if (j < 0) { j += LEN; }
|
||||
|
||||
@@ -654,7 +654,7 @@ public:
|
||||
}
|
||||
private:
|
||||
// attributes
|
||||
matrix::Vector<Type, M> _h[LEN];
|
||||
matrix::Matrix<Type, M, N> _h[LEN];
|
||||
size_t _index;
|
||||
int _delay;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user