Work on LPE GPS delay.

This commit is contained in:
James Goppert
2016-03-08 09:38:31 -05:00
parent ac66050cd6
commit d37ddb6102
5 changed files with 56 additions and 50 deletions
+1 -1
View File
@@ -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)));
+5 -5
View File
@@ -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;
};