Made load2D throw exception on error instead of calling 'exit', to allow error handling and not cause matlab to exit
parent
5c22654194
commit
6a88497a6e
|
@ -90,10 +90,8 @@ pair<pose2SLAM::Graph::shared_ptr, pose2SLAM::Values::shared_ptr> load2D(
|
||||||
bool addNoise, bool smart) {
|
bool addNoise, bool smart) {
|
||||||
cout << "Will try to read " << filename << endl;
|
cout << "Will try to read " << filename << endl;
|
||||||
ifstream is(filename.c_str());
|
ifstream is(filename.c_str());
|
||||||
if (!is) {
|
if (!is)
|
||||||
cout << "load2D: can not find the file!";
|
throw std::invalid_argument("load2D: can not find the file!");
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
pose2SLAM::Values::shared_ptr poses(new pose2SLAM::Values);
|
pose2SLAM::Values::shared_ptr poses(new pose2SLAM::Values);
|
||||||
pose2SLAM::Graph::shared_ptr graph(new pose2SLAM::Graph);
|
pose2SLAM::Graph::shared_ptr graph(new pose2SLAM::Graph);
|
||||||
|
|
Loading…
Reference in New Issue