exit()-> throw (Closes #427)
parent
6bf605b624
commit
1304d26e81
|
@ -44,8 +44,7 @@ Cal3_S2::Cal3_S2(const std::string &path) :
|
||||||
if (infile)
|
if (infile)
|
||||||
infile >> fx_ >> fy_ >> s_ >> u0_ >> v0_;
|
infile >> fx_ >> fy_ >> s_ >> u0_ >> v0_;
|
||||||
else {
|
else {
|
||||||
printf("Unable to load the calibration\n");
|
throw std::runtime_error("Cal3_S2: Unable to load the calibration");
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
infile.close();
|
infile.close();
|
||||||
|
|
|
@ -164,9 +164,10 @@ boost::tuple<FastVector<DenseIndex>, DenseIndex, DenseIndex> _countDims(
|
||||||
n += vardim;
|
n += vardim;
|
||||||
} else {
|
} else {
|
||||||
if(!(varDims[jointVarpos] == vardim)) {
|
if(!(varDims[jointVarpos] == vardim)) {
|
||||||
cout << "Factor " << sourceFactorI << " variable " << DefaultKeyFormatter(sourceFactor.keys()[sourceVarpos]) <<
|
std::stringstream ss;
|
||||||
" has different dimensionality of " << vardim << " instead of " << varDims[jointVarpos] << endl;
|
ss << "Factor " << sourceFactorI << " variable " << DefaultKeyFormatter(sourceFactor.keys()[sourceVarpos]) <<
|
||||||
exit(1);
|
" has different dimensionality of " << vardim << " instead of " << varDims[jointVarpos];
|
||||||
|
throw std::runtime_error(ss.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -183,12 +183,9 @@ public:
|
||||||
std::vector<Matrix> Gs(numKeys * (numKeys + 1) / 2);
|
std::vector<Matrix> Gs(numKeys * (numKeys + 1) / 2);
|
||||||
std::vector<Vector> gs(numKeys);
|
std::vector<Vector> gs(numKeys);
|
||||||
|
|
||||||
if (this->measured_.size() != cameras.size()) {
|
if (this->measured_.size() != cameras.size())
|
||||||
std::cout
|
throw std::runtime_error("SmartProjectionHessianFactor: this->measured_"
|
||||||
<< "SmartProjectionHessianFactor: this->measured_.size() inconsistent with input"
|
".size() inconsistent with input");
|
||||||
<< std::endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
triangulateSafe(cameras);
|
triangulateSafe(cameras);
|
||||||
|
|
||||||
|
|
|
@ -206,12 +206,9 @@ public:
|
||||||
std::vector<Matrix> Gs(numKeys * (numKeys + 1) / 2);
|
std::vector<Matrix> Gs(numKeys * (numKeys + 1) / 2);
|
||||||
std::vector<Vector> gs(numKeys);
|
std::vector<Vector> gs(numKeys);
|
||||||
|
|
||||||
if (this->measured_.size() != cameras.size()) {
|
if (this->measured_.size() != cameras.size())
|
||||||
std::cout
|
throw std::runtime_error("SmartStereoProjectionHessianFactor: this->"
|
||||||
<< "SmartStereoProjectionHessianFactor: this->measured_.size() inconsistent with input"
|
"measured_.size() inconsistent with input");
|
||||||
<< std::endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
triangulateSafe(cameras);
|
triangulateSafe(cameras);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue