本文整理汇总了C++中KalmanFilter::genVisBall方法的典型用法代码示例。如果您正苦于以下问题:C++ KalmanFilter::genVisBall方法的具体用法?C++ KalmanFilter::genVisBall怎么用?C++ KalmanFilter::genVisBall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalmanFilter
的用法示例。
在下文中一共展示了KalmanFilter::genVisBall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KalmanFilter
TEST (KalmanFilterTest, Works) {
KalmanFilter *kf = new KalmanFilter(true);
ufvector4 initX = boost::numeric::ublas::zero_vector<float> (4);
initX(0) = 50.f;
initX(1) = 0.f;
initX(2) = 0.f;
initX(3) = 0.f;
ufmatrix4 initCov = boost::numeric::ublas::identity_matrix<float> (4);
initCov(0,0) = 5.f;
initCov(1,1) = 5.f;
initCov(2,2) = 0.f;
initCov(3,3) = 0.f;
kf->initialize(initX, initCov);
kf->predict(kf->genOdometry(-5.f, 0.f, 0.f),10.f);
kf->updateWithObservation(kf->genVisBall(58.f, 0.f));
kf->predict(kf->genOdometry(0.f, 0.f, 0.f),.1f);
kf->updateWithObservation(kf->genVisBall(55.f, .05f));
kf->predict(kf->genOdometry(0.f, 0.f, 0.f),.1f);
kf->updateWithObservation(kf->genVisBall(55.f, .05f));
kf->predict(kf->genOdometry(0.f, 0.f, 0.f),.1f);
kf->updateWithObservation(kf->genVisBall(55.f, .05f));
kf->predict(kf->genOdometry(0.f, 0.f, 0.f),.1f);
kf->updateWithObservation(kf->genVisBall(83.f, .05f));
}
示例2: MMKalmanFilter
TEST (KalmanFilterTest, MMWorks) {
MMKalmanFilter *kf = new MMKalmanFilter();
KalmanFilter *poor = new KalmanFilter();
kf->initialize(50.f, 0.f, 5.f, 5.f);
messages::Motion inpMotion;
inpMotion.mutable_odometry()->CopyFrom(poor->genOdometry(0.f,0.f,0.f));
kf->update(poor->genVisBall(55.5f, 0.f),
inpMotion);
kf->update(poor->genVisBall(62.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(64.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(71.f, 0.f),
inpMotion);
kf->printEst();
/*
kf->update(poor->genVisBall(75.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(74.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(76.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(75.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(75.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(75.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(75.f, 0.f),
inpMotion);
kf->update(poor->genVisBall(75.f, 0.f),
inpMotion);
*/
}