removed asserts on CameraModel constructor when fx != 0 (but added the check in isValid() method)

This commit is contained in:
matlabbe
2015-07-18 17:26:41 -04:00
parent 6bbde72840
commit 8c7f6ced6f
3 changed files with 12 additions and 10 deletions
+3 -1
View File
@@ -65,7 +65,9 @@ public:
bool isValid() const {return !K_.empty() &&
!D_.empty() &&
!R_.empty() &&
!P_.empty();}
!P_.empty() &&
fx()>0.0 &&
fy()>0.0;}
const std::string & name() const {return name_;}
+2 -2
View File
@@ -81,8 +81,8 @@ CameraModel::CameraModel(
P_(cv::Mat::eye(3, 4, CV_64FC1)),
localTransform_(localTransform)
{
UASSERT_MSG(fx > 0.0, uFormat("fx=%f", fx).c_str());
UASSERT_MSG(fy > 0.0, uFormat("fy=%f", fy).c_str());
UASSERT_MSG(fx >= 0.0, uFormat("fx=%f", fx).c_str());
UASSERT_MSG(fy >= 0.0, uFormat("fy=%f", fy).c_str());
UASSERT_MSG(cx >= 0.0, uFormat("cx=%f", cx).c_str());
UASSERT_MSG(cy >= 0.0, uFormat("cy=%f", cy).c_str());
P_.at<double>(0,0) = fx;
+7 -7
View File
@@ -289,6 +289,12 @@ int main(int argc, char * argv[])
showUsage();
}
ULogger::setType(ULogger::kTypeConsole);
//ULogger::setType(ULogger::kTypeFile, rtabmap.getWorkingDir()+"/LogConsole.txt", false);
//ULogger::setBuffered(true);
ULogger::setLevel(logLevel);
ULogger::setExitLevel(exitLevel);
UTimer timer;
timer.start();
std::queue<double> iterationMeanTime;
@@ -296,7 +302,7 @@ int main(int argc, char * argv[])
Camera * camera = 0;
if(UDirectory::exists(path))
{
camera = new CameraImages(path, startAt, false, 1/rate);
camera = new CameraImages(path, startAt, false, false, 1/rate);
}
else
{
@@ -311,12 +317,6 @@ int main(int argc, char * argv[])
std::map<int, int> groundTruth;
ULogger::setType(ULogger::kTypeConsole);
//ULogger::setType(ULogger::kTypeFile, rtabmap.getWorkingDir()+"/LogConsole.txt", false);
//ULogger::setBuffered(true);
ULogger::setLevel(logLevel);
ULogger::setExitLevel(exitLevel);
// Create tasks
Rtabmap rtabmap;
if(inputDbPath.empty())