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

Make the bias test a true gtest by adding asserts

parent 90dfa096
No related branches found
No related tags found
3 merge requests!39release after RAL,!38After 2nd RAL submission,!26Motion intrinsics update gtest
#include <fstream> #include <fstream>
#include "imu/internal/config.h"
#include "core/utils/utils_gtest.h" #include "core/utils/utils_gtest.h"
#include "core/utils/logging.h"
#include "core/common/wolf.h" #include "core/common/wolf.h"
#include "core/problem/problem.h" #include "core/problem/problem.h"
...@@ -227,6 +229,28 @@ TEST_F(ProcessorImuTest, getState) ...@@ -227,6 +229,28 @@ TEST_F(ProcessorImuTest, getState)
#if WRITE_CSV_FILE #if WRITE_CSV_FILE
file_est.close(); file_est.close();
#endif #endif
/** assert final results
*
* t 0 .9 1 1.9 2 3
* BIAS .4 .4 0 0 0 0
* BIAS PREINT .4 .4 .4 .4 0 0
* X 0 !0 0 0 0 0
* V 0 !0 0 0 0 0
*
* though we only test at KFs so t = { 0, 1, 2, 3 }
*/
for (auto F : *problem_->getTrajectory() )
{
auto ts = F->getTimeStamp();
double bias = (t == 0 ? 0.42 : 0.0);
ASSERT_NEAR(F->getCaptureOf(sensor_)->getSensorIntrinsic()->getState()(0), bias, 1e-6);
ASSERT_NEAR(F->getP()->getState()(0),0.0,1e-6);
ASSERT_NEAR(F->getV()->getState()(0),0.0,1e-6);
}
} }
......
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