add set_state to kalman filter for the case we know the initial state (#246)

This commit is contained in:
Ehsan Azar 2017-02-25 03:32:07 -08:00 committed by Davis E. King
parent a3023fdeea
commit 81b3272382
2 changed files with 19 additions and 0 deletions

View File

@ -36,6 +36,13 @@ namespace dlib
void set_process_noise ( const matrix<double,states,states>& Q_) { Q = Q_; }
void set_measurement_noise ( const matrix<double,measurements,measurements>& R_) { R = R_; }
void set_estimation_error_covariance( const matrix<double,states,states>& P_) { P = P_; }
void set_state ( const matrix<double,states,1>& xb_) {
xb = xb_;
if (!got_first_meas) {
x = xb_;
got_first_meas = true;
}
}
const matrix<double,measurements,states>& get_observation_model (
) const { return H; }

View File

@ -93,6 +93,18 @@ namespace dlib
understand what you are doing.)
!*/
void set_state (
const matrix<double,states,1>& xb
);
/*!
ensures
- #get_predicted_next_state() == xb
- If update() is never called with a measurement
#get_current_state() == get_predicted_next_state()
(Can be used when the initial state is known, or if the state needs to be corrected
before the next update())
!*/
const matrix<double,measurements,states>& get_observation_model (
) const;
/*!