Shows how to read the BOG format which is used by DaimlerChrysler.
, Matrix3x3
- Author
- Jan Woetzel
#include <Base/Common/BIASpragma.hh>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <Base/Math/Vector3.hh>
#include <Base/Math/Matrix3x3.hh>
#include <Base/Math/BogIO.hh>
using namespace std;
using namespace BIAS;
int main(int argc, char** argv){
cout<<"started "<<argv[0]<<endl;
#ifdef BIAS_TESTS_DATA
string filename(BIAS_TESTS_DATA "calib01.bog");
#else
string filename("calib01.bog");
cout<<"BIAS_TESTS_DATA not defined."<<endl;
return -1;
#endif
if (argc>1) filename=argv[1];
cout<<"using filename "<<filename<<endl;
cout<<"C: "<<C<<endl;
cout<<"R: "<<R<<endl;
if (0!=
LoadBogK(filename, K))
return -3;
cout<<"K: "<<K<<endl;
int result=0;
const double v[3] = { -317.4137573 , 0.4055223 , -3.9081306 };
const double eps=1E-10;
for (unsigned int i=0; i<3; i++) {
if (fabs(v[i] - C.
GetData()[i]) >eps){
cout<<"Error: mismatch for element "<<i<<" : "<<endl
<<" should be: "<<v[i]
<<endl;
result += -1*i;
}
}
cout<<"done with result="<<result<<endl;
return result;
}