mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
removed asserts on CameraModel constructor when fx != 0 (but added the check in isValid() method)
This commit is contained in:
@@ -65,7 +65,9 @@ public:
|
|||||||
bool isValid() const {return !K_.empty() &&
|
bool isValid() const {return !K_.empty() &&
|
||||||
!D_.empty() &&
|
!D_.empty() &&
|
||||||
!R_.empty() &&
|
!R_.empty() &&
|
||||||
!P_.empty();}
|
!P_.empty() &&
|
||||||
|
fx()>0.0 &&
|
||||||
|
fy()>0.0;}
|
||||||
|
|
||||||
const std::string & name() const {return name_;}
|
const std::string & name() const {return name_;}
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ CameraModel::CameraModel(
|
|||||||
P_(cv::Mat::eye(3, 4, CV_64FC1)),
|
P_(cv::Mat::eye(3, 4, CV_64FC1)),
|
||||||
localTransform_(localTransform)
|
localTransform_(localTransform)
|
||||||
{
|
{
|
||||||
UASSERT_MSG(fx > 0.0, uFormat("fx=%f", fx).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(fy >= 0.0, uFormat("fy=%f", fy).c_str());
|
||||||
UASSERT_MSG(cx >= 0.0, uFormat("cx=%f", cx).c_str());
|
UASSERT_MSG(cx >= 0.0, uFormat("cx=%f", cx).c_str());
|
||||||
UASSERT_MSG(cy >= 0.0, uFormat("cy=%f", cy).c_str());
|
UASSERT_MSG(cy >= 0.0, uFormat("cy=%f", cy).c_str());
|
||||||
P_.at<double>(0,0) = fx;
|
P_.at<double>(0,0) = fx;
|
||||||
|
|||||||
@@ -289,6 +289,12 @@ int main(int argc, char * argv[])
|
|||||||
showUsage();
|
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;
|
UTimer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
std::queue<double> iterationMeanTime;
|
std::queue<double> iterationMeanTime;
|
||||||
@@ -296,7 +302,7 @@ int main(int argc, char * argv[])
|
|||||||
Camera * camera = 0;
|
Camera * camera = 0;
|
||||||
if(UDirectory::exists(path))
|
if(UDirectory::exists(path))
|
||||||
{
|
{
|
||||||
camera = new CameraImages(path, startAt, false, 1/rate);
|
camera = new CameraImages(path, startAt, false, false, 1/rate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -311,12 +317,6 @@ int main(int argc, char * argv[])
|
|||||||
|
|
||||||
std::map<int, int> groundTruth;
|
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
|
// Create tasks
|
||||||
Rtabmap rtabmap;
|
Rtabmap rtabmap;
|
||||||
if(inputDbPath.empty())
|
if(inputDbPath.empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user