44 #include <visp3/core/vpLinearKalmanFilterInstantiation.h>
45 #include <visp3/core/vpDebug.h>
46 #include <visp3/core/vpException.h>
177 double rho,
double delta_t)
186 sigma_measure, delta_t);
190 sigma_measure, rho, delta_t);
316 double dt3 = dt2*
dt ;
318 for (
unsigned int i=0; i <
size_measure*n_signal ; i++ ) {
326 F[2*i+1][2*i+1] = 1 ;
332 double sR = sigma_measure[i] ;
333 double sQ = sigma_state[2*i] ;
339 Q[2*i][2*i] = sQ * dt3/3;
340 Q[2*i][2*i+1] = sQ * dt2/2;
341 Q[2*i+1][2*i] = sQ * dt2/2;
342 Q[2*i+1][2*i+1] = sQ *
dt;
344 Pest[2*i][2*i] = sR ;
345 Pest[2*i][2*i+1] = sR/(2*
dt) ;
346 Pest[2*i+1][2*i] = sR/(2*
dt) ;
347 Pest[2*i+1][2*i+1] = sQ*2*dt/3.0+ sR/(2*dt2) ;
510 if ((rho < 0) || (rho >= 1)) {
527 for (
unsigned int i=0; i <
size_measure*n_signal ; i++ ) {
535 F[2*i+1][2*i+1] = rho ;
541 double sR = sigma_measure[i] ;
542 double sQ = sigma_state[2*i+1] ;
551 Q[2*i+1][2*i+1] = sQ ;
553 Pest[2*i][2*i] = sR ;
554 Pest[2*i][2*i+1] = 0. ;
555 Pest[2*i+1][2*i] = 0 ;
556 Pest[2*i+1][2*i+1] = sQ/(1-rho*rho) ;
734 if ((rho < 0) || (rho >= 1)) {
760 F[3*i+1][3*i+1] = rho ;
761 F[3*i+2][3*i+2] = 1 ;
768 double sR = sigma_measure[i] ;
769 double sQ1 = sigma_state[3*i+1] ;
770 double sQ2 = sigma_state[3*i+2] ;
776 Q[3*i+1][3*i+1] = sQ1;
777 Q[3*i+2][3*i+2] = sQ2;
779 Pest[3*i][3*i] = sR ;
780 Pest[3*i][3*i+1] = 0. ;
781 Pest[3*i][3*i+2] = sR/
dt ;
782 Pest[3*i+1][3*i+1] = sQ1/(1-rho*rho) ;
783 Pest[3*i+1][3*i+2] = -rho*sQ1/((1-rho*rho)*
dt) ;
784 Pest[3*i+2][3*i+2] = (2*sR+sQ1/(1-rho*rho))/(
dt*
dt) ;
786 Pest[3*i+1][3*i] =
Pest[3*i][3*i+1];
787 Pest[3*i+2][3*i] =
Pest[3*i][3*i+2];
788 Pest[3*i+2][3*i+1] =
Pest[3*i+1][3*i+2];
809 vpERROR_TRACE(
"Bad signal number. You need to initialize the Kalman filter") ;
811 "Bad signal number")) ;
836 else if (
iter == 1) {
void initStateConstAccWithColoredNoise_MeasureVel(unsigned int nsignal, vpColVector &sigma_state, vpColVector &sigma_measure, double rho, double dt)
void initFilter(unsigned int nsignal, vpColVector &sigma_state, vpColVector &sigma_measure, double rho, double dt)
long iter
Filter step or iteration. When set to zero, initialize the filter.
unsigned int size_state
Size of the state vector .
void filter(vpColVector &z)
vpMatrix R
Measurement noise covariance matrix .
unsigned int size_measure
Size of the measure vector .
error that can be emited by ViSP classes.
void initStateConstVelWithColoredNoise_MeasureVel(unsigned int nsignal, vpColVector &sigma_state, vpColVector &sigma_measure, double rho)
void filtering(const vpColVector &z)
unsigned int nsignal
Number of signal to filter.
void init(unsigned int size_state, unsigned int size_measure, unsigned int n_signal)
Implementation of column vector and the associated operations.
void initStateConstVel_MeasurePos(unsigned int nsignal, vpColVector &sigma_state, vpColVector &sigma_measure, double dt)
vpMatrix F
Transition matrix that describes the evolution of the state.
void setStateModel(vpStateModel model)
vpMatrix H
Matrix that describes the evolution of the measurements.
vpMatrix Q
Process noise covariance matrix .