Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_filter.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------------
2// A filter
3//-----------------------------------------------------------------------------------------
4// Copyright (c) 2009 Princeton Satellite Systems. All rights reserved.
5//-----------------------------------------------------------------------------------------
6
9
10#ifndef __FILTER__
11#define __FILTER__
12
13#ifdef AS_OS_WINDOWS
14 #include "matrixlib.h"
15#else
16 #include <MatrixLib/MatrixLib.h>
17#endif
18
28class Filter
29{
30
31 private:
33 ml_matrix gain_a;
35 ml_matrix gain_b;
37 ml_matrix gain_c;
39 ml_matrix gain_d;
41 ml_matrix x;
42
43
44 public:
45 Filter( void );
46 void Initialize( const ml_matrix& a, const ml_matrix& b, const ml_matrix& c, const ml_matrix& d );
47 void SetState( const ml_matrix& x );
48 ml_matrix Update( const ml_matrix& u );
49 void Reset( void );
50
51};
52
53
54#endif
Definition: sc_filter.h:29
void Initialize(const ml_matrix &a, const ml_matrix &b, const ml_matrix &c, const ml_matrix &d)
Initialize the filter with the state space matrices.
Definition: sc_filter.cc:21
void SetState(const ml_matrix &x)
Set the state.
Definition: sc_filter.cc:34
ml_matrix Update(const ml_matrix &u)
Update the filter The output y is c*x + d*u.
Definition: sc_filter.cc:56
void Reset(void)
Reset the filter state x to zero.
Definition: sc_filter.cc:43