40 : meas_dim_(dim), state_dim_(dim * 2), G_(dim * 2), G_small_(dim), a_max_(0) {
72 F(i, i + meas_dim_) = dt;
78 x(i) += x(i + meas_dim_) * dt;
86 double dt4 = dt2 * dt2;
90 P(i, i) += dt4 / 4 * q;
91 P(i, i + meas_dim_) += dt4 / 4 * q;
92 P(i + meas_dim_, i + meas_dim_) += dt2 * q;
const pbl::Matrix & getStateCovariance() const
Returns the covariance of the Kalman state.
double getLikelihood(const pbl::Gaussian &z) const
Calculates the likelihood that the given measurement originates from the estimated Kalman state...
void setMaxAcceleration(double a_max)
Set the maximum expected acceleration. This parameter is used to determine the system noise in the pr...
KalmanFilter(int dim)
Constructs a Kalman filter with specified state dimensionality.
const pbl::Vector & getState() const
Returns the Kalman state (mean of the estimated Gaussian)
Kalman filter with constant-velocity system model. The system noise is automatically calculated from ...
TFSIMD_FORCE_INLINE const tfScalar & y() const
virtual void init(const pbl::Gaussian &G)
Initializes the Kalman filter according to the given Gaussian, i.e., the initial state and state cova...
virtual ~KalmanFilter()
Destructor.
const arma::mat & getCovariance() const
void setMean(const arma::vec &mu)
const arma::vec & getMean() const
static bool inv(Mat< eT > &out, const Base< eT, T1 > &X, const bool slow=false)
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual void propagate(const double &dt)
Propagates the state of the Kalman filter according to the (constant- velocity) system model...
double getDensity(const arma::vec &v, double max_mah_dist=0) const
const pbl::Gaussian & getGaussian() const
Returns the Kalman state and covariance as Gaussian.
void update(const pbl::Gaussian &z)
Updates the Kalman filter with the given (Gaussian) measurement.
arma_inline const Gen< mat::elem_type, gen_ones_diag > eye(const uword n_rows, const uword n_cols)
void setCovariance(const arma::mat &cov)
virtual KalmanFilter * clone() const
Clone operator.