Open JiatianWu opened 5 years ago
Have you solved this problem? I also meet the same error
Yeah. Initialize n
in test finite difference Jacobians
of lwf/testPrediction.cpp
TYPED_TEST(PredictionModelTest, FDjacobians) {
Eigen::MatrixXd F((int)(TestFixture::mtPredictionExample::mtState::D_),(int)(TestFixture::mtPredictionExample::mtState::D_));
Eigen::MatrixXd F_FD((int)(TestFixture::mtPredictionExample::mtState::D_),(int)(TestFixture::mtPredictionExample::mtState::D_));
typename TestFixture::mtPredictionNoise n;
n.setIdentity();
this->testPrediction_.meas_ = this->testPredictionMeas_;
this->testPrediction_.template jacInputFD<0>(F_FD,std::forward_as_tuple(this->testState_,n),this->dt_,0.0000001);
this->testPrediction_.template jacInput<0>(F,std::forward_as_tuple(this->testState_,n),this->dt_);
Eigen::MatrixXd Fn((int)(TestFixture::mtPredictionExample::mtState::D_),(int)(TestFixture::mtPredictionExample::mtNoise::D_));
Eigen::MatrixXd Fn_FD((int)(TestFixture::mtPredictionExample::mtState::D_),(int)(TestFixture::mtPredictionExample::mtNoise::D_));
this->testPrediction_.template jacInputFD<1>(Fn_FD,std::forward_as_tuple(this->testState_,n),this->dt_,0.0000001);
this->testPrediction_.template jacInput<1>(Fn,std::forward_as_tuple(this->testState_,n),this->dt_);
switch(TestFixture::id_){
case 0:
ASSERT_NEAR((F-F_FD).norm(),0.0,1e-5);
ASSERT_NEAR((Fn-Fn_FD).norm(),0.0,1e-5);
break;
case 1:
ASSERT_NEAR((F-F_FD).norm(),0.0,1e-8);
ASSERT_NEAR((Fn-Fn_FD).norm(),0.0,1e-8);
break;
default:
ASSERT_NEAR((F-F_FD).norm(),0.0,1e-5);
ASSERT_NEAR((Fn-Fn_FD).norm(),0.0,1e-5);
};
}
When I launch rrovio_node and I got below:
Does anyone know why the model jacInput test failed? It looks like it will results in large absolute errors.