testIMUFactor unit test fails

Issue #257 resolved
Chris Beall created an issue

This might just be a tolerance issue, but 1e-4 is already pretty lax. This failure is on Ubuntu 14.04 with Boost 1.54. Jenkins is running 1.56, so the difference in output between the two systems is probably due to a change in Boost's RNG?

131/225 Test #131: testImuFactor ..........................***Failed    0.69 sec
not equal:
expected = [
0.0020300762,   9.17425378e-06, -1.83649615e-05,    6.11878692e-07, 6.46025364e-06, 1.50640544e-07, 1.22375738e-05, 0.000129205073, 3.01281088e-06, 
9.17425378e-06, 0.00101271538,  8.56046462e-05, -2.6724765e-06, -2.68773553e-06,    -1.47595059e-07,    -5.34495299e-05,    -5.37547106e-05,    -2.95190118e-06,    
-1.83649615e-05,    8.56046462e-05, 0.00310595999,  -2.00839403e-06,    -1.57131688e-06,    -9.05058374e-06,    -4.01678805e-05,    -3.14263375e-05,    -0.000181011675,    
6.11878692e-07, -2.6724765e-06, -2.00839403e-06,    7.76082396e-06, 8.61143367e-08, 2.38379666e-08, 0.000155216479, 1.72228673e-06, 4.76759331e-07, 
6.46025364e-06, -2.68773553e-06,    -1.57131688e-06,    8.61143367e-08, 5.12312679e-06, -1.94000086e-07,    1.72228673e-06, 0.000102462536, -3.88000172e-06,    
1.50640544e-07, -1.47595059e-07,    -9.05058374e-06,    2.38379666e-08, -1.94000086e-07,    2.53292807e-06, 4.76759331e-07, -3.88000172e-06,    5.06585614e-05, 
1.22375738e-05, -5.34495299e-05,    -4.01678805e-05,    0.000155216479, 1.72228673e-06, 4.76759331e-07, 0.00310432959,  3.44457347e-05, 9.53518662e-06, 
0.000129205073, -5.37547106e-05,    -3.14263375e-05,    1.72228673e-06, 0.000102462536, -3.88000172e-06,    3.44457347e-05, 0.00204925072,  -7.76000343e-05,    
3.01281088e-06, -2.95190118e-06,    -0.000181011675,    4.76759331e-07, -3.88000172e-06,    5.06585614e-05, 9.53518662e-06, -7.76000343e-05,    0.00101317123,  
];
actual = [
       0.002,   -3.75709602e-21,    -6.10591974e-20,    7.67116361e-23, 6.20540441e-06, 8.49048176e-07, 1.53423272e-21, 0.000124108088, 1.69809635e-05, 
-3.75709602e-21,    0.00100157049,  6.13580344e-05, -1.56271359e-06,    -3.08043809e-06,    -9.3912804e-08, -3.12542719e-05,    -6.16087619e-05,    -1.87825608e-06,    
-6.10591974e-20,    6.13580344e-05, 0.00299717237,  -8.73525736e-07,    -4.70985861e-07,    -9.19502681e-06,    -1.74705147e-05,    -9.41971722e-06,    -0.000183900536,    
7.67116361e-23, -1.56271359e-06,    -8.73525736e-07,    7.50264034e-06, 4.87963833e-09, 2.5342158e-09,  0.000150052807, 9.75927665e-08, 5.0684316e-08,  
6.20540441e-06, -3.08043809e-06,    -4.70985861e-07,    4.87963833e-09, 5.01933642e-06, -1.49364303e-07,    9.75927665e-08, 0.000100386728, -2.98728606e-06,    
8.49048176e-07, -9.3912804e-08, -9.19502681e-06,    2.5342158e-09,  -1.49364303e-07,    2.5379967e-06,  5.0684316e-08,  -2.98728606e-06,    5.07599341e-05, 
1.53423272e-21, -3.12542719e-05,    -1.74705147e-05,    0.000150052807, 9.75927665e-08, 5.0684316e-08,  0.00300105614,  1.95185533e-06, 1.01368632e-06, 
0.000124108088, -6.16087619e-05,    -9.41971722e-06,    9.75927665e-08, 0.000100386728, -2.98728606e-06,    1.95185533e-06, 0.00200773457,  -5.97457211e-05,    
1.69809635e-05, -1.87825608e-06,    -0.000183900536,    5.0684316e-08,  -2.98728606e-06,    5.07599341e-05, 1.01368632e-06, -5.97457211e-05,    0.00101519868,  
];
actual - expected = [
-3.00761954e-05,    -9.17425378e-06,    1.83649615e-05, -6.11878692e-07,    -2.54849232e-07,    6.98407632e-07, -1.22375738e-05,    -5.09698464e-06,    1.39681526e-05, 
-9.17425378e-06,    -1.11448973e-05,    -2.42466118e-05,    1.1097629e-06,  -3.92702566e-07,    5.36822548e-08, 2.21952581e-05, -7.85405132e-06,    1.0736451e-06,  
1.83649615e-05, -2.42466118e-05,    -0.000108787626,    1.13486829e-06, 1.10033101e-06, -1.44443073e-07,    2.26973658e-05, 2.20066203e-05, -2.88886146e-06,    
-6.11878692e-07,    1.1097629e-06,  1.13486829e-06, -2.58183622e-07,    -8.12346983e-08,    -2.13037508e-08,    -5.16367245e-06,    -1.62469397e-06,    -4.26075015e-07,    
-2.54849232e-07,    -3.92702566e-07,    1.10033101e-06, -8.12346983e-08,    -1.03790371e-07,    4.46357829e-08, -1.62469397e-06,    -2.07580742e-06,    8.92715659e-07, 
6.98407632e-07, 5.36822548e-08, -1.44443073e-07,    -2.13037508e-08,    4.46357829e-08, 5.06863319e-09, -4.26075015e-07,    8.92715659e-07, 1.01372664e-07, 
-1.22375738e-05,    2.21952581e-05, 2.26973658e-05, -5.16367245e-06,    -1.62469397e-06,    -4.26075015e-07,    -0.000103273449,    -3.24938793e-05,    -8.5215003e-06, 
-5.09698464e-06,    -7.85405132e-06,    2.20066203e-05, -1.62469397e-06,    -2.07580742e-06,    8.92715659e-07, -3.24938793e-05,    -4.15161483e-05,    1.78543132e-05, 
1.39681526e-05, 1.0736451e-06,  -2.88886146e-06,    -4.26075015e-07,    8.92715659e-07, 1.01372664e-07, -8.5215003e-06, 1.78543132e-05, 2.02745327e-06, 
];
/home/cbeall3/git/gtsam/gtsam/navigation/tests/testImuFactor.cpp:701: Failure: "MonteCarlo(pim, NavState(x1, v1), bias, dt, body_P_sensor, measuredAcc, measuredOmega, accNoiseVar2, omegaNoiseVar2, 10000)" 
not equal:
expected = [
0.00310787707,  -3.77037458e-05,    2.26334804e-05, 4.02408293e-07, -6.22778501e-07,    1.36298031e-06, 8.04816586e-06, -1.245557e-05,  2.72596062e-05, 
-3.77037458e-05,    0.0030300488,   -1.22252265e-05,    5.62749489e-07, 6.02072833e-07, -1.10574275e-06,    1.12549898e-05, 1.20414567e-05, -2.2114855e-05, 
2.26334804e-05, -1.22252265e-05,    0.00304643606,  -2.34940282e-08,    -5.75131955e-08,    5.45568239e-07, -4.69880565e-07,    -1.15026391e-06,    1.09113648e-05, 
4.02408293e-07, 5.62749489e-07, -2.34940282e-08,    2.47217579e-06, 2.96908405e-08, -1.73574005e-08,    4.94435158e-05, 5.9381681e-07,  -3.47148009e-07,    
-6.22778501e-07,    6.02072833e-07, -5.75131955e-08,    2.96908405e-08, 2.54009611e-06, -1.24946851e-08,    5.9381681e-07,  5.08019222e-05, -2.49893701e-07,    
1.36298031e-06, -1.10574275e-06,    5.45568239e-07, -1.73574005e-08,    -1.24946851e-08,    2.57103582e-06, -3.47148009e-07,    -2.49893701e-07,    5.14207163e-05, 
8.04816586e-06, 1.12549898e-05, -4.69880565e-07,    4.94435158e-05, 5.9381681e-07,  -3.47148009e-07,    0.000988870316, 1.18763362e-05, -6.94296018e-06,    
-1.245557e-05,  1.20414567e-05, -1.15026391e-06,    5.9381681e-07,  5.08019222e-05, -2.49893701e-07,    1.18763362e-05, 0.00101603844,  -4.99787403e-06,    
2.72596062e-05, -2.2114855e-05, 1.09113648e-05, -3.47148009e-07,    -2.49893701e-07,    5.14207163e-05, -6.94296018e-06,    -4.99787403e-06,    0.00102841433,  
];
actual = [
0.00299950657,  2.46715759e-07, 2.46715759e-07,          0.0,            0.0,            0.0,            0.0,            0.0,            0.0,   
2.46715759e-07, 0.00299950657,  2.46715759e-07,          0.0,            0.0,            0.0,            0.0,            0.0,            0.0,   
2.46715759e-07, 2.46715759e-07, 0.00299950657,           0.0,            0.0,            0.0,            0.0,            0.0,            0.0,   
         0.0,            0.0,            0.0,        2.5e-06,   6.90695811e-23, 3.97046694e-23,        5e-05,   1.28378431e-21, 1.27054942e-21, 
         0.0,            0.0,            0.0,   4.25998015e-23,      2.5e-06,   6.6174449e-23,  1.29040176e-21,        5e-05,   1.27054942e-21, 
         0.0,            0.0,            0.0,   6.6174449e-23,  3.97046694e-23,      2.5e-06,   1.27054942e-21, 1.27054942e-21,        5e-05,   
         0.0,            0.0,            0.0,          5e-05,   1.50215999e-21, 1.05879118e-21,        0.001,   2.75285708e-20, 2.71050543e-20, 
         0.0,            0.0,            0.0,   1.07202607e-21,        5e-05,   1.48230766e-21, 2.75285708e-20,        0.001,   2.71050543e-20, 
         0.0,            0.0,            0.0,   1.48230766e-21, 1.05879118e-21,        5e-05,   2.71050543e-20, 2.71050543e-20,        0.001,   
];
actual - expected = [
-0.000108370504,    3.79504616e-05, -2.23867646e-05,    -4.02408293e-07,    6.22778501e-07, -1.36298031e-06,    -8.04816586e-06,    1.245557e-05,   -2.72596062e-05,    
3.79504616e-05, -3.05422298e-05,    1.24719423e-05, -5.62749489e-07,    -6.02072833e-07,    1.10574275e-06, -1.12549898e-05,    -1.20414567e-05,    2.2114855e-05,  
-2.23867646e-05,    1.24719423e-05, -4.69294959e-05,    2.34940282e-08, 5.75131955e-08, -5.45568239e-07,    4.69880565e-07, 1.15026391e-06, -1.09113648e-05,    
-4.02408293e-07,    -5.62749489e-07,    2.34940282e-08, 2.78242088e-08, -2.96908405e-08,    1.73574005e-08, 5.56484176e-07, -5.9381681e-07, 3.47148009e-07, 
6.22778501e-07, -6.02072833e-07,    5.75131955e-08, -2.96908405e-08,    -4.00961085e-08,    1.24946851e-08, -5.9381681e-07, -8.0192217e-07, 2.49893701e-07, 
-1.36298031e-06,    1.10574275e-06, -5.45568239e-07,    1.73574005e-08, 1.24946851e-08, -7.10358153e-08,    3.47148009e-07, 2.49893701e-07, -1.42071631e-06,    
-8.04816586e-06,    -1.12549898e-05,    4.69880565e-07, 5.56484176e-07, -5.9381681e-07, 3.47148009e-07, 1.11296835e-05, -1.18763362e-05,    6.94296018e-06, 
1.245557e-05,   -1.20414567e-05,    1.15026391e-06, -5.9381681e-07, -8.0192217e-07, 2.49893701e-07, -1.18763362e-05,    -1.60384434e-05,    4.99787403e-06, 
-2.72596062e-05,    2.2114855e-05,  -1.09113648e-05,    3.47148009e-07, 2.49893701e-07, -1.42071631e-06,    6.94296018e-06, 4.99787403e-06, -2.84143261e-05,    
];
/home/cbeall3/git/gtsam/gtsam/navigation/tests/testImuFactor.cpp:841: Failure: "MonteCarlo(pim, NavState(x1, v1), bias, 0.1, boost::none, measuredAcc, measuredOmega, Vector3::Constant(accNoiseVar), Vector3::Constant(omegaNoiseVar))" 
There were 2 failures

Comments (7)

  1. Duy-Nguyen Ta

    I have to reproduce the error with Boost 1.54. But ~0.00011 errors for MC tests do not look too bad for me. I don't think random seeds are ok as we need deterministic test results.

  2. Frank Dellaert

    I have fixed this in a branch by increasing nr of samples. Note I am also looking again at the IMU factor. I think NavState as a Lie group might have been one bridge too far,

  3. Duy-Nguyen Ta

    I'm glad it works. Increasing nr of samples sometimes cause bad effects in my experiments. I usually need to double-check the statistics of generated RVs.

    Why don't you like NavState? I didn't like it at first as it's not atomic and I'm not sure if it's "physically" correct, but then I feel it's kind of neat. Some of its functions are specific for preintegration and should be taken out though.

    --

    Duy-Nguyen

  4. Frank Dellaert

    I am retreating from the position that it should be a lie group. Maybe it's simply a manifold, with a retractor permission compatible with SE3

  5. Log in to comment