Skip to content
Snippets Groups Projects
Commit 44d0919d authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add test getState(t, struct)

parent a43e7415
No related branches found
No related tags found
1 merge request!379Resolve "Problem::getState(structure) doesn't care about structure"
Pipeline #5687 failed
...@@ -131,6 +131,36 @@ TEST_F(ProcessorMotion_test, getState_structure) ...@@ -131,6 +131,36 @@ TEST_F(ProcessorMotion_test, getState_structure)
} }
TEST_F(ProcessorMotion_test, getState_time_structure)
{
// Prior
Vector3d x0; x0 << 0, 0, 0;
Matrix3d P0; P0.setIdentity();
data << 1, 0; // advance straight
data_cov.setIdentity();
TimeStamp t(0.0);
for (int i = 0; i<9; i++)
{
t += dt;
capture->setTimeStamp(t);
capture->setData(data);
capture->setDataCovariance(data_cov);
processor->captureCallback(capture);
WOLF_DEBUG("t: ", t, " x: ", problem->getState().vector("PO").transpose());
}
ASSERT_TRUE (processor->getState(7, "P").count("P"));
ASSERT_FALSE(processor->getState(7, "P").count("O"));
ASSERT_FALSE(processor->getState(7, "O").count("P"));
ASSERT_TRUE (processor->getState(7, "O").count("O"));
WOLF_DEBUG("processor->getState(7, \"V\") = ", processor->getState(7, "V"));
ASSERT_EQ (processor->getState(7, "V").size(), 0);
}
TEST_F(ProcessorMotion_test, IntegrateStraightFactorPrior) TEST_F(ProcessorMotion_test, IntegrateStraightFactorPrior)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment