本文整理汇总了C++中KalmanFilter::getState方法的典型用法代码示例。如果您正苦于以下问题:C++ KalmanFilter::getState方法的具体用法?C++ KalmanFilter::getState怎么用?C++ KalmanFilter::getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalmanFilter
的用法示例。
在下文中一共展示了KalmanFilter::getState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: A
TEST(KalmanFilterTest, validationEffect)
{
KalmanFilter kf;
MatrixXd A(1,1); A << 1;
kf.setStateTransitionModel(A);
MatrixXd H(1,1); H << 1;
kf.setObservationModel(H);
MatrixXd Q(1,1); Q << 0.1;
kf.setProcessNoiseCovariance(Q);
MatrixXd R(1,1); R << 10;
kf.setMeasurementNoiseCovariance(R);
// validate has an effect?
InputValue measurement(1);
Input in(measurement);
Output out;
EXPECT_THROW(out = kf.estimate(in), IEstimator::estimator_error); // "not yet validated"
EXPECT_NO_THROW(kf.validate());
// changing a parameter -> KF must be re-validated
kf.setProcessNoiseCovariance(Q);
EXPECT_THROW(out = kf.estimate(in), IEstimator::estimator_error); // "not yet validated"
EXPECT_NO_THROW(kf.validate());
// KF should now be released and return an estimate (should not be
// the default)
EXPECT_NO_THROW(out = kf.estimate(in));
EXPECT_GT(out.size(), 0);
EXPECT_EQ(kf.getState().size(), out.size());
}