14 #include <dynamic-graph/factory.h> 22 using command::Setter;
29 measureSIN(NULL,
"Kalman(" + name +
")::input(vector)::y"),
30 modelTransitionSIN(NULL,
"Kalman(" + name +
")::input(matrix)::F"),
31 modelMeasureSIN(NULL,
"Kalman(" + name +
")::input(matrix)::H"),
32 noiseTransitionSIN(NULL,
"Kalman(" + name +
")::input(matrix)::Q"),
33 noiseMeasureSIN(NULL,
"Kalman(" + name +
")::input(matrix)::R")
36 statePredictedSIN(0,
"Kalman(" + name +
")::input(vector)::x_pred"),
37 observationPredictedSIN(0,
"Kalman(" + name +
")::input(vector)::y_pred"),
38 varianceUpdateSOUT(
"Kalman(" + name +
")::output(vector)::P"),
39 stateUpdateSOUT(
"Kalman(" + name +
")::output(vector)::x_est"),
53 std::string docstring =
54 " Set initial state estimation\n" 57 " - a vector: initial state\n";
63 " Set variance of initial state estimation\n" 66 " - a matrix: variance covariance matrix\n";
88 sotDEBUG(15) <<
"Q=" << Q << std::endl;
89 sotDEBUG(15) <<
"R=" << R << std::endl;
90 sotDEBUG(15) <<
"F=" << F << std::endl;
91 sotDEBUG(15) <<
"H=" << H << std::endl;
92 sotDEBUG(15) <<
"Pk_1_k_1=" << Pk_1_k_1 << std::endl;
98 sotDEBUG(15) <<
"F " << std::endl << F << std::endl;
99 sotDEBUG(15) <<
"P_{k-1|k-1} " << std::endl << Pk_1_k_1 << std::endl;
100 sotDEBUG(15) <<
"F^T " << std::endl << F.transpose() << std::endl;
107 sotDEBUG(15) <<
"S_{k} " << std::endl <<
S_ << std::endl;
108 sotDEBUG(15) <<
"K_{k} " << std::endl <<
K_ << std::endl;
109 sotDEBUG(15) <<
"P_{k|k} " << std::endl << Pk_k << std::endl;
156 sotDEBUG(25) <<
"K_{k} = " << std::endl <<
K_ << std::endl;
157 sotDEBUG(25) <<
"y = " << y << std::endl;
158 sotDEBUG(25) <<
"h (\\hat{x}_{k|k-1}) = " << y_pred << std::endl;
159 sotDEBUG(25) <<
"y = " << y << std::endl;
164 x_est = x_pred +
K_ *
z_;
166 sotDEBUG(25) <<
"z_{k} = " << z_ << std::endl;
167 sotDEBUG(25) <<
"x_{k|k} = " << x_est << std::endl;
Kalman(const std::string &name)
void setStateVariance(const Matrix &P0)
SignalPtr< Vector, int > statePredictedSIN
void signalRegistration(const SignalArray< int > &signals)
#define sotDEBUGOUT(level)
SignalPtr< Matrix, int > modelMeasureSIN
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
#define sotDEBUGIN(level)
SignalPtr< Matrix, int > noiseTransitionSIN
void display(std::ostream &os) const
SignalPtr< Matrix, int > modelTransitionSIN
virtual void addDependency(const SignalBase< Time > &signal)
SignalTimeDependent< Matrix, int > varianceUpdateSOUT
SignalPtr< Vector, int > observationPredictedSIN
SignalTimeDependent< Vector, int > stateUpdateSOUT
virtual void recompute(const Time &t)
Vector & computeStateUpdate(Vector &x_est, const int &time)
SignalPtr< Matrix, int > noiseMeasureSIN
Matrix & computeVarianceUpdate(Matrix &P_k_k, const int &time)
void addCommand(const std::string &name, command::Command *command)
void setStateEstimation(const Vector &x0)
SignalPtr< Vector, int > measureSIN
virtual void setFunction(boost::function2< T &, T &, Time > t, Mutex *mutexref=NULL)